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

Toggle() on QDockWidget::toggleViewAction() is not working

XMLWordPrintable

    • Windows
    • de6520805abafbc6f898b3fec043e5d85827dfd0 (qt/qtbase/5.15)

      QdockWidget:: toggleViewAction(), dockwidget’s visibility is toggled on triggered() signal whereas it could/should be toggled() signal as user wants to control the dock visibility with some property, say checked.
      If you set action.setChecked(true) or action.toggle(), it does not make any impact on dock’s visibility. Like in qdockWidget.cpp, line no. 679, we have

        QObject::connect(toggleViewAction, SIGNAL(triggered(bool)), q, SLOT(_q_toggleView(bool)));
      

      Like if you try,

          b = w1->toggleViewAction();
          qDebug()<< b->isChecked();  // false, which seems incorrect
          // Following code does not make any difference as toggle does not emit triggered signal
          b->setChecked(false); 
          b->toggle();
      

        1. qtbug80022.zip
          3 kB
          Shveta Mittal
        For Gerrit Dashboard: QTBUG-80022
        # Subject Branch Project Status CR V

            vhilshei Volker Hilsheimer
            shmittal Shveta Mittal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes