Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.5.1
-
None
-
13b1c23f8b2cdf283703a75f475ddcf06653bf7e (qtbase/5.5, 23.10.2015)
Description
QLineEdit side action widgets overlaps each other until I resize the QLineEdit.
Looks like the bug related with QTBUG-39660:
after this fix QLineEditPrivate::positionSideWidgets() isn't working properly.
Complete example:
#include <QLineEdit> #include <QIcon> #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); QLineEdit lineEdit; QPixmap pixmap(16, 16); pixmap.fill(Qt::red); lineEdit.addAction(QIcon(pixmap), QLineEdit::TrailingPosition); pixmap.fill(Qt::green); lineEdit.addAction(QIcon(pixmap), QLineEdit::TrailingPosition); lineEdit.setClearButtonEnabled(true); lineEdit.setText("resize me please"); lineEdit.show(); return a.exec(); }
Seat of the trouble:
QWidget *QLineEditPrivate::addAction(QAction *newAction, QAction *before, QLineEdit::ActionPosition position, int flags) { ... positionSideWidgets(); //side widget still hidden w->show(); ... } void QLineEditPrivate::positionSideWidgets() { ... if (e.widget->isVisible()) // QTBUG-39660 widgetGeometry.moveLeft(widgetGeometry.left() + delta); ...
Attachments
Issue Links
- relates to
-
QTBUG-48899 QLineEdit does not properly handle trailing actions when there is the clear button
- Closed
- resulted from
-
QTBUG-39660 QAction::setVisible() has no effect for side widget actions of QLineEdit
- Closed