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. QWidgetAction in Menu not showing on OS X

QWidgetAction in Menu not showing on OS X

Scheduled Pinned Locked Moved General and Desktop
qwidgetactionos x
5 Posts 3 Posters 2.2k 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.
  • C Offline
    C Offline
    cgarry
    wrote on 8 Oct 2015, 08:46 last edited by cgarry 10 Aug 2015, 15:57
    #1

    I am trying to add a widget (QDoubleSpinbox) to a menu using a QWidgetAction in my Qt (5.4.2) application. This is working fine on Windows, but the widget is not displayed on OS X, though a blank area is displayed where the widget should be.

    This is the code that creates the menu and widget:

        // QDoubleSpinbox to add to menu
        QDoubleSpinBox *colsat_DSpinbox = new QDoubleSpinBox;
        colsat_DSpinbox->setMinimum(0.0);
        colsat_DSpinbox->setMaximum(15.0);
        colsat_DSpinbox->setSingleStep(0.25);
        colsat_DSpinbox->setValue(1.0);
        connect(colsat_DSpinbox, SIGNAL(valueChanged(double)), this, SLOT(colour_saturation_changed(double)));
    
        mp_colour_saturation_Menu = playback_menu->addMenu(tr("Colour Saturation (%1)").arg(tr("Off", "No colour saturation")));
        QWidgetAction *colsat_Widgetaction = new QWidgetAction(mp_colour_saturation_Menu);
        colsat_Widgetaction->setDefaultWidget(colsat_DSpinbox);
        mp_colour_saturation_Menu->addAction(colsat_Widgetaction);
    

    (Complete code: at https://github.com/cgarry/ser-player)

    The widget has been added to the Colour Saturation menu as expected when running on Windows:
    Windows version

    The widget is missing when running on OS X (Yosemite):
    OS X version

    The QWidgetAction documentation does say that there are some limitations on OS X, but nothing as serious as not being displayed at all. Is there a way to fix this?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cgarry
      wrote on 9 Oct 2015, 21:40 last edited by
      #2

      I am not sure if it helps, but I have just upgraded Qt to version 5.5.0 and the OS X version of the application still behaves the same way with the QWidgetAction still not being displayed.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 23 Dec 2015, 00:41 last edited by
        #3

        Hi,

        I have it working with 5.6 (beta stage). Can you post a minimal QMainWindow implementation that triggers this ?

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

        R 1 Reply Last reply 23 Dec 2015, 14:54
        0
        • S SGaist
          23 Dec 2015, 00:41

          Hi,

          I have it working with 5.6 (beta stage). Can you post a minimal QMainWindow implementation that triggers this ?

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 23 Dec 2015, 14:54 last edited by
          #4

          @SGaist said:

          I have it working with 5.6 (beta stage).

          I currently don't have a Mac to text this on, but Qt uses the system menubar when a (top-levle) QMenuBar is used. I could imagine that there are no widget actions supported.
          QMainWindow widget of course still have a it's own menubar though, with working widget actions since it is completely handled by Qt.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 23 Dec 2015, 22:22 last edited by
            #5

            Sorry, I've haven't given enough info: it's working on 10.8.5 with a Qt 5.6 build

            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

            • Login

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