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

Calling showMinimized on a docked QDockWidget creates artifact when trying to undock

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • 4.6.0
    • 4.3.0
    • Widgets: Main Window
    • None

      When calling showMinimized on a docked QDockWidget, nothing happens.
      Except when trying to undock the dockwidget, then it suddenly tries to minimize itself. If the dock is
      redocked before it is minimized it will redock and show up as a docked dockwidget. If the dockwidget is undocked it will minimize as soon as releasing the mouse button.

      Maybe the correct behaviour would be to ignore showMinimized if it is called when it is docked.

      Reproducible with:

      #include <QtGui>
      #include <QDebug>

      class CustomWidget : public QPushButton
      { Q_OBJECT
      public:
      CustomWidget(QWidget* parent=0) : QPushButton(parent)

      { connect(this,SIGNAL(clicked()), this, SLOT(aSlot())); }

      public: QDockWidget *dock;

      public slots:
      void aSlot()
      {
      qDebug() << "aSlot invoked";
      static int a=0;
      if (a == 0)

      { dock->showMinimized(); a = 1; }

      else

      { dock->showNormal(); a=0; }

      }

      protected:
      void paintEvent(QPaintEvent *pe)

      { QPushButton::paintEvent(pe); }

      };

      #include "main.moc"

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

      CustomWidget c;
      c.show();

      QMainWindow w;
      w.show();
      QDockWidget widget(&w);
      c.dock = &widget;
      widget.show();
      widget.setFloating(true);

      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)
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes