Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can i hide a QAction in the QToolbar?
QtWS25 Last Chance

How can i hide a QAction in the QToolbar?

Scheduled Pinned Locked Moved General and Desktop
qactionqtoolbarhidebutton
4 Posts 2 Posters 8.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nickvan86
    wrote on 10 Jul 2015, 15:48 last edited by
    #1

    Hello,

    how can hide one QAction in a QToolbar? I will hide one Button from two.
    I hope someone have a good answer.
    Sorry for my worst englisch.

    Bye

    Alex from Germany ;-)

    Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

    K 1 Reply Last reply 10 Jul 2015, 16:13
    0
    • N nickvan86
      10 Jul 2015, 15:48

      Hello,

      how can hide one QAction in a QToolbar? I will hide one Button from two.
      I hope someone have a good answer.
      Sorry for my worst englisch.

      Bye

      Alex from Germany ;-)

      K Offline
      K Offline
      koahnig
      wrote on 10 Jul 2015, 16:13 last edited by
      #2

      @nickvan86

      setVisible can be applied to QAction in the toolbar.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nickvan86
        wrote on 10 Jul 2015, 16:27 last edited by
        #3

        Hello,

        thanks for the answer.
        When i write this code:

        ui->toolBar->setVisible(false);

        The completly toolBar is hide.

        When i will the first button hide, i write this:

        ui->toolBar->actions().at(index)->setVisible(false);

        Thank you ;-)

        Bye

        Alex from Germany

        Qt 5.2.1 Creator 3.0.1 Windows 7 64bit

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on 10 Jul 2015, 16:33 last edited by
          #4

          Yes, that is the way it should work.

          You can hide also anything based on QWidget Sometimes you have more than one possibility. So there is also some redundancy.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0

          4/4

          10 Jul 2015, 16:33

          • Login

          • Login or register to search.
          4 out of 4
          • First post
            4/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved