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. QT 5.4 - Need to disable a button on Toolbar
QtWS25 Last Chance

QT 5.4 - Need to disable a button on Toolbar

Scheduled Pinned Locked Moved General and Desktop
toolbarbuttonqstackedwidgetsstackview
2 Posts 2 Posters 1.7k 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.
  • D Offline
    D Offline
    Dragon123
    wrote on 18 Apr 2015, 21:32 last edited by
    #1

    Hi everyone,

    I need some help.
    I've been trying to figure this out for a few week but I can't seem to find the solution.
    I have an application with multiple pages, so I am using QStackedWidgets. What I would need to do is disabling a button on the toolbar of the application when I am on a certain Index.
    For example on Index 0 and Index 6 I would need for a button on my toolbar to be disabled.
    How can I manage to do this?

    Thanks
    Dragon

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 Apr 2015, 22:44 last edited by
      #2

      Hi and welcome to devnet,

      Add a slot in the widget containing the toolbar and connect QStackedWidget::currentChanged to it. In the slot check the index value and enable/disable the button.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      1/2

      18 Apr 2015, 21:32

      • Login

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