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 create an clean an simple window for macosx without dock entry and any menubar?
Forum Update on Monday, May 27th 2025

How to create an clean an simple window for macosx without dock entry and any menubar?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 1.1k 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.
  • R Offline
    R Offline
    robert23
    wrote on last edited by
    #1

    Hi

    I'm new to QtQuick and like to way to desing an application. But unfortunately I don't know how to configure my application as I want.

    Currently I am at a mac and I want my application to look and feel like the macosx spotlight window.
    !https://9to5mac.files.wordpress.com/2014/06/screenshot-2014-06-02-13-22-08.jpg?w=704&h=398(picture of spotlight)!

    It is an window without decoration, without an menu bar and without an application entry at the task bar called "dock" macosx as show at the image. If you click outside of the window it will simply disapear.

    How do I have to modify my qml application window?

    @
    ApplicationWindow {
    width: 640
    height: 40
    opacity: 0.9
    visible: true
    flags: Qt.Window

    TaskBarForm {
        id: taskBarForm1
        anchors.fill: parent
    
        Keys.onEscapePressed: {
            Qt.quit()
        }
    
        onActiveFocusChanged: {
            if (Window.activeFocusItem == null)
                Qt.quit()
        }
    
    
    }
    

    }
    @

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

      Hi robert23,

      the basic idea is to create a Window with 'Qt.Popup' flag set. Unfortunately this feature is broken in Qt 5.4.0, at least on Windows and Linux. But I have found a workaround for this:

      @
      import QtQuick 2.4
      import QtQuick.Controls 1.3
      import QtQuick.Window 2.2

      ApplicationWindow {
      id: window
      width: 100
      height: 100
      visible: false

      property var popup: null
      
      property string comp: "import QtQuick 2.4
          import QtQuick.Controls 1.3
          import QtQuick.Controls.Private 1.0
          PopupWindow {
          id: window
      
          Rectangle {
              id: rect
              width: 400
              height: 300
      
              Button {
                  text: 'Close'
                  anchors.centerIn: parent
                  onClicked: dismissPopup()
              }
          }
      }"
      
      function afterPopupClosed() {
          popup.destroy()
          window.close()
      }
      
      Component.onCompleted: {
          popup = Qt.createQmlObject( comp, window )
          popup.popupDismissed.connect( afterPopupClosed )
          popup.x = 200
          popup.y = 300
          popup.show()
      }
      

      }
      @

      I don't have a Mac, so I only tested it on Windows and Linux. But would be nice to hear from you if it works on Mac OS, too.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        robert23
        wrote on last edited by
        #3

        [quote author="Wieland" date="1424567026"]Hi robert23,
        I don't have a Mac, so I only tested it on Windows and Linux. But would be nice to hear from you if it works on Mac OS, too.
        [/quote]

        Hey Wieland

        First of all, thanks for your reply.

        Unfortunately it doesn't work at macosx. The window has no decoration and disappears after loosing the focus but it still has an dock entry and has a menu.

        I've seen that, this kind of mac windows also has an special type of form with round corners.

        I've made an video to see this.
        http://youtu.be/IQtC66YpQko

        Robert

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

          Sorry, no idea :-/

          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