⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

Does Qt support Mac-style pop-out widgets?

  • I am not a Mac developer does anyone know what these kind of controls are called:

    Here this pops out from a button and is able to extend beyond the parent/main window, but if you click outside the popout widget it automatically disappears. I'm not familiar with this kind of toolbar widget in WinAPI and as we're developing a cross-platform application based on an existing Mac application, I'd like to know if Qt can provide something similar/use these native widgets in a cross-platform way?


  • OK so in Mac speak these are "popovers" https://developer.apple.com/design/human-interface-guidelines/macos/windows-and-views/popovers/

    Does Qt support them, and if so what is the Windows equivalent? If not, what is the closest cross-platform alternative - it's just neat they disappear when you click away.

  • Lifetime Qt Champion

    Qt do not have such control/widget. (as far as i know)
    For a cross platform solution, i think you would have to make a custom widget.
    Technically its similar to a QComboBox that also allows to go out side parents area and
    will close on click outside. It uses a event filter to be able to close if click outside.

    alt text

    so you could go dig around in its code

    to be inspired.
    Basically it would be a frame less floating window and some eventfilter to
    obtain a similar effect.

  • You can make your own custom widget based on Qt::PopUp window flag.
    Here my own widget constructor:

    static const int ArrowSize=13;
    PopupWindow::PopupWindow(QWidget *parent) : QWidget(parent)
        oContentWidget=new ContentWidget(this);
         // widget shadow
        pShadowEffect = new QGraphicsDropShadowEffect();

    You need to define an AnchorPoint and a AnchorWidget to position the popup correctly. For ex:

    void PopupWindow::showWithAnchor(QWidget* anchorWidget, Qt::AnchorPoint anchorPt)

    Some work required ;)


  • Thanks, this is most helpful. It seems this is a Mac-native control so it makes sense Qt doesn't support directly.

  • Lifetime Qt Champion


    It's a NSPopover. However you might be able to integrate it into your Qt application.

    Here you have an example on how to show on programmatically using Objective-C.

Log in to reply