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

[4.4.0] QToolButton::setPopupMode() - impossible to disable pop-up menu if it was set before

    XMLWordPrintable

Details

    Description

      Situation: one needs to decline the pop-up mode of the tool button, but setMenu(0) and setArrowType(Qt::NoArrow) do not hide the arrow, and there is no appropriate facility. It would be nice to add to the enum ToolButtonPopupMode an entry like ToolButtonPopupMode::NoPopup to remove the popup arrow.

      Code to reproduce:

      #include <QtGui>
      
      int main( int argc, char * argv[] )
      {
          QApplication app( argc, argv );
          QToolButton * toolButton = new QToolButton;
          toolButton->setPopupMode( QToolButton::MenuButtonPopup );
      
          // NONE OF THESE MAKES THE ARROW HIDDEN FROM NOW ON
          toolButton->setMenu( 0 );
          toolButton->setArrowType( Qt::NoArrow );
      
          toolButton->show();
          return app.exec();
      }
      

      Attachments

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

        Activity

          People

            monsen Marius Bugge Monsen
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes