How can i hide a QAction in the QToolbar?



  • 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 ;-)



  • @nickvan86

    setVisible can be applied to QAction in the toolbar.



  • 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



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.