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. Qt Native Stye for macOS

Qt Native Stye for macOS

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 682 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.
  • J Offline
    J Offline
    JackMyson
    wrote on last edited by
    #1

    I have noticed that when users use the Apple macOS system, they should experience some UI-widgets, such as combo-boxes, and message-boxes.
    If the macOS developers chooses to use the Qt framework instead of the Swift framework because of its re-usability and code-simplicity, we will discover that some Qt widgets will not look like the same as the traditional native Swift UI widgets.

    For example, QComboBox vs NSComboBox (menu).
    The typical drop-down menu of Swift UIKit.NSComboBox.menu looks like this:
    Qt

    However, a native C++ Qt::QtWidgets::QCombBox::private::m_menu may looks like this:

    QComboBox::menu

    For another example, a native UIAlertControler may look like this:

    Swift.UIKit.UIAlertControler

    On the other hand, a typical C++ Qt::QtWidgets::QMessageBox will look like this:

    alt text


    My question is, are there any method to control and use the native format for the menus and messages and widgets, but not the Qt styling one?

    /* my aim is not using these codes:
    QStyle style = QStyle();
    style.setPalette();
    style.asdfasdf();
    ...;...;
    setStyle(style);
    */
    
    QApplication::setNativeFormatStyle(true);
    // or
    QApplication::setAttribute(Qt::AA_MacMenusUseNative);
    QApplication::setAttribute(Qt::AA_MacMessageboxUseNativeInBigSur);
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      One thing I am not sure about your comparison is that you are comparing a menu to a combo box drop-down. They are not the same thing so you should in fact compare it to QMenu.

      As for the rest, I think bringing this to the
      interest mailing list would be better as you'll find there Qt's developers/maintainers. This forum is more user oriented.

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

      J 1 Reply Last reply
      1
      • J JackMyson has marked this topic as solved on
      • SGaistS SGaist

        Hi,

        One thing I am not sure about your comparison is that you are comparing a menu to a combo box drop-down. They are not the same thing so you should in fact compare it to QMenu.

        As for the rest, I think bringing this to the
        interest mailing list would be better as you'll find there Qt's developers/maintainers. This forum is more user oriented.

        J Offline
        J Offline
        JackMyson
        wrote on last edited by
        #3

        @SGaist

        Thanks for the answer.

        In Qt 6.5, it finally support native macOS message box!

        1 Reply Last reply
        1

        • Login

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