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

QToolButton setVisible(true) not working when setVisible(false) called before adding to toolbar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 4.8.1, 4.8.5, 5.2.0
    • None

      Test case attached, compile with:

      g++ -o test test.cpp `pkg-config --cflags --libs Qt5Widgets` -fPIC

      Sequence of events:

      button->setVisible(false)
      toolbar->addWidget(button)
      button->setVisible(true)

      The result is that the button is not shown.

      Seems that calling addWidget with a hidden widget sets some internal state on the widget that causes subsequent calls to setVisible(true) to not have any effect. The WA_WState_Hidden bit is still set on the widget's attributes at the end of this test.

      Tested in 5.2.0, 4.8.1 and 4.8.5, with GCC 4.4.6 on RHEL6.

      Thanks

        1. test.cpp
          0.7 kB
          Alexander Jones
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            peppe Giuseppe D'Angelo
            alex-weej Alexander Jones
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes