Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to make QQuickView behave like a popup menu?
Forum Updated to NodeBB v4.3 + New Features

How to make QQuickView behave like a popup menu?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 277 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    Using Qt 5.15, I'd like to create a QQuickView which behaves exactly like an application context menu. That is, it is modal, and automatically closes if the user clicks elsewhere.

    I can set the Window flag Qt::Popup, and also set modality to Qt::ApplicationModal. The resulting window is top-level and modal, but it does not automatically close when clicking outside, as a popup menu should.

    What am I missing?

    A 1 Reply Last reply
    0
    • A Asperamanca

      Using Qt 5.15, I'd like to create a QQuickView which behaves exactly like an application context menu. That is, it is modal, and automatically closes if the user clicks elsewhere.

      I can set the Window flag Qt::Popup, and also set modality to Qt::ApplicationModal. The resulting window is top-level and modal, but it does not automatically close when clicking outside, as a popup menu should.

      What am I missing?

      A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      This doesn't seem to be implemented. Setting Qt::Popup doesn't work for QQuickView, and doesn't work for QQuickWidget, either.

      A workaround is to use a plain QWidget as popup, and add a QQuickWidget as child.

      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