Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-1058

Layout flickers when combobox changes sizehint

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.3.1
    • Widgets: Layout
    • None

    Description

      The following example shows some suboptimal flickering and even widgets overlapping each other and getting clipped.

      #include <QtGui>

      class Widget : public QWidget
      {
      public:
      Widget()

      { cbox = new QComboBox; cbox->setSizeAdjustPolicy(QComboBox::AdjustToContents); QLineEdit *spaceEater = new QLineEdit; QHBoxLayout *hbox = new QHBoxLayout; hbox->addWidget(cbox); hbox->addWidget(spaceEater); setLayout(hbox); timerid = startTimer(500); }

      protected:
      void timerEvent(QTimerEvent *e)
      {
      if (e->timerId() == timerid)

      { static int count = 0; QString string; string.fill('X', ++count); cbox->addItem(string); }

      QWidget::timerEvent(e);
      }

      private:
      int timerid;
      QComboBox *cbox;
      };

      int main(int argc, char **argv)
      {
      QApplication app(argc, argv);

      Widget w;
      w.show();

      return app.exec();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes