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

QDockWidget can be resized despite having fixed width

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3: Somewhat important P3: Somewhat important
    • 4.6.0
    • 4.2.3
    • Widgets: Main Window
    • None

      Trying to resize a dockwidget with a fixed width will let the splitter move ca 2px and leave the area it moves away from unpainted.

      #include <QtGui>

      class myDock : public QDockWidget
      {
      public: myDock(QWidget *parent) : QDockWidget(parent){}
      QSize sizeHint() const

      { return QSize(300,200); }

      };

      int main(int argc, char **argv)
      {
      QApplication app(argc, argv);
      QMainWindow window;
      myDock *dock1 = new myDock(&window);
      window.addDockWidget(Qt::RightDockWidgetArea, dock1);

      dock1->setFixedSize(300, 200);
      dock1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
      dock1->setWindowFlags(dock1->windowFlags() | Qt::MSWindowsFixedSizeDialogHint);

      QLabel *label = new QLabel("This is a label", dock1);
      dock1->setWidget(label);
      QTextEdit *edit = new QTextEdit(&window);
      window.setCentralWidget(edit);
      window.show();
      return app.exec();
      }

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

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes