Remove the QT4 TextBox selection bug workaround. It prevents the selection method from working in some cases.

[GB.QT4]
* BUG: Remove the QT4 TextBox selection bug workaround. It prevents the selection method from working in some cases.

[GB.QT5]
* BUG: Remove the QT4 TextBox selection bug workaround. It prevents the selection method from working in some cases.
This commit is contained in:
gambas 2018-12-10 22:39:07 +01:00
parent b897cec6cf
commit 0706d6d170
2 changed files with 11 additions and 5 deletions

View file

@ -83,7 +83,7 @@ BEGIN_METHOD(TextBox_new, GB_OBJECT parent)
QObject::connect(wid, SIGNAL(textChanged(const QString &)), &CTextBox::manager, SLOT(onChange()));
QObject::connect(wid, SIGNAL(returnPressed()), &CTextBox::manager, SLOT(onActivate()));
QObject::connect(wid, SIGNAL(selectionChanged()), &CTextBox::manager, SLOT(onSelectionChanged()));
//QObject::connect(wid, SIGNAL(selectionChanged()), &CTextBox::manager, SLOT(onSelectionChanged()));
wid->setAlignment(Qt::AlignLeft);
@ -113,7 +113,10 @@ BEGIN_PROPERTY(TextBox_Text)
if (READ_PROPERTY)
RETURN_NEW_STRING(TEXTBOX->text());
else
{
TEXTBOX->deselect();
TEXTBOX->setText(QSTRING_PROP());
}
END_PROPERTY
@ -417,7 +420,10 @@ static void combo_set_text(CCOMBOBOX *_object, QString &text)
if (!COMBOBOX->isEditable() || pos >= 0)
combo_set_current_item(_object, pos);
if (COMBOBOX->isEditable())
{
COMBOBOX->lineEdit()->deselect();
COMBOBOX->lineEdit()->setText(text);
}
}
static void combo_set_editable(void *_object, bool ed)
@ -439,7 +445,7 @@ static void combo_set_editable(void *_object, bool ed)
COMBOBOX->setCompleter(0);
//CWidget::installFilter(COMBOBOX);
QObject::connect(COMBOBOX->lineEdit(), SIGNAL(returnPressed()), &CTextBox::manager, SLOT(onActivate()));
QObject::connect(COMBOBOX->lineEdit(), SIGNAL(selectionChanged()), &CTextBox::manager, SLOT(onSelectionChanged()));
//QObject::connect(COMBOBOX->lineEdit(), SIGNAL(selectionChanged()), &CTextBox::manager, SLOT(onSelectionChanged()));
if (CWIDGET_test_flag(THIS, WF_DESIGN))
{
@ -813,7 +819,7 @@ void CTextBox::onClick()
}
void CTextBox::onSelectionChanged(void)
/*void CTextBox::onSelectionChanged(void)
{
GET_SENDER();
GET_TEXT_BOX();
@ -831,7 +837,7 @@ void CTextBox::onSelectionChanged(void)
{
get_selection(textbox, &THIS->start, &THIS->length);
}
}
}*/

View file

@ -104,7 +104,7 @@ public slots:
void onChange(void);
void onActivate(void);
void onClick(void);
void onSelectionChanged(void);
//void onSelectionChanged(void);
};