Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtMacExtras - How to disable item in a toolbar.
Qt 6.12 LTS is out! See what's new in the release blog

QtMacExtras - How to disable item in a toolbar.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    toptan
    wrote on last edited by
    #1

    Hello, everyone,

    I am using QtMacExtras for native toolbar in my app. Does anybody knows how to disable button in a toolbar?
    Using standard method some_action->setEnabled(false) does not work, the button in toolbar for that action remains "clickable".

    Here is the relevant piece of code
    @
    toolBar = new QMacNativeToolBar(this);
    myAction = toolBar->addAction(QIcon(":/qtlogo.png"), "Disabled action");
    myAction->setEnabled(false);
    @

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      I think that the mac native toolbar is still far from a fully functional component. For instance, it does not support item groups, you cannot remove items, &c. Looking into its code, it appears that an action's changed() signal is never connected, it even seems that QMacNativeToolBar assumes that all of its actions are enabled regardless of their state. Which means, we probably have to implement this functionality ourselves or wait until somebody else does ;-).

      1 Reply Last reply
      0
      • T Offline
        T Offline
        toptan
        wrote on last edited by
        #3

        I thought as much. Thank you for clarification.

        1 Reply Last reply
        0

        • Login

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