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. examples/macextras question
Forum Updated to NodeBB v4.3 + New Features

examples/macextras question

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 841 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.
  • B Offline
    B Offline
    bozz
    wrote on last edited by
    #1

    Inside macextras there is an example how to customise the macOS toolbar, using embeddedqwindow.

    The code looks really nice, but for some reason when closing an "embeddedqwindow" the app remains in the dock. It is usually supposed to close completely. Is this bad coding?

    Secondly, are there any other mac specific classes apart from QMacToolBar().
    QMacToolBar(), closes correctly btw in the example provided!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Not on macOS. macOS has always been an application centric OS so closing a window doesn't mean ending the app. Just use CMD+Q and you'll quit the application properly.

      As for your other question: QMacNativeWidget and QMacCocoaViewContainer.

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

      B 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Not on macOS. macOS has always been an application centric OS so closing a window doesn't mean ending the app. Just use CMD+Q and you'll quit the application properly.

        As for your other question: QMacNativeWidget and QMacCocoaViewContainer.

        B Offline
        B Offline
        bozz
        wrote on last edited by
        #3

        Thank you! I have tested some other apps on the mac and you are absolutely right, they all remain in the dock.

        Looks like "that is just how macs work" https://www.howtogeek.com/279086/why-do-mac-apps-stay-open-when-i-hit-the-red-x-button/

        Thank you for the c++ classes! I will take a look.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mpergand
          wrote on last edited by
          #4

          You can change this behavior by calling:

          setQuitOnLastWindowClosed(bool quit)
          

          macOS has always been an application centric OS so closing a window doesn't mean ending the app

          With the exception of apps called Utlity apps, usely with a single window that quit when this window is closed. (ex: Preference dialog, Disc utilty)

          I see versions of Qt reporting as inactive an mac app with no window open, that's wrong of course.

          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