I see this wierd behavoir happening with QComboBox, it doesn't update as soon as its contents change. To demonstrate the issue here is a sample code and some screen shots.
Initial widget
Add Item to combobox (See how the checkbox is overlapped)
Manually resized updates and adjusts the layout & combobox
#include <QApplication>
#include <QtGui>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QWidget parentWidget;
QCheckBox checker;
QComboBox comber;
QHBoxLayout layoot;
comber.setEditable (true);
comber.setSizeAdjustPolicy(QComboBox::AdjustToContents);
layoot.addWidget (&comber);
layoot.addWidget (&checker);
parentWidget.setLayout(&layoot);
parentWidget.show();
return app.exec();
}
I tried update() and repaint() on the combobox and also the layout after the item is edited but doesn't have any effect. Do I really have to manually resize the widget for the combobox to readjust?? Is anyone aware of a fix for this problem??
Thank you.
CV
It sounds like a bug to me, especially if manually calling update
on the layout is having no effect. Perhaps what you are seeing is this bug. Apparently that one is fixed in 4.8.0.