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. How to set Alerts in MAC system
Qt 6.11 is out! See what's new in the release blog

How to set Alerts in MAC system

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 2.2k 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
    borisa
    wrote on last edited by
    #1

    Hi,

    Mac has Banners, Alerts, and Badges (https://support.apple.com/en-il/HT204079)
    How can I use this tool from the QT?

    Thx

    raven-worxR 1 Reply Last reply
    0
    • B borisa

      Hi,

      Mac has Banners, Alerts, and Badges (https://support.apple.com/en-il/HT204079)
      How can I use this tool from the QT?

      Thx

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #2

      @borisa
      not directly, but it can be easily mimed (platform independently) with QWidgets:

      QFrame* notifier = new QFrame;
      notifier ->setWindowFlags( Qt::Tool | Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint );
      notifier ->setFocusPolicy( Qt::NoFocus );
      const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry(); // Qt5 way; for Qt4 use QDesktopWidget::availableGeometry(notifier);
      QRect geom = notifier ->geometry();
      geom.moveBottomRight( availableGeometry.bottomRight() - QPoint(20,20) );
      notifier ->setGeometry( geom  );
      notifier ->show();
      

      For a nicer effect you can additionally use QGraphicsOpacityEffect to fade the widget in and out.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

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

        Hi,

        IIRC messages can be sent using QSystemTrayIcon

        Badges can be set using QtMac::setBadgeLabelText

        I don't remember if there's something for the banner however you can use Objective-C++ for that without any problem.

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

        1 Reply Last reply
        1
        • B Offline
          B Offline
          borisa
          wrote on last edited by
          #4

          Can i included in my project only the relevant h and cpp files (like System.Classes.hpp, FMX.Controls.hpp, FMX.Forms.hpp ....)?
          If so, where can i found them?
          If not, How can i include the Objective-C++ in my QT?

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

            What relevant header file do you mean ?

            Take a look e.g. at the QtMacExtras module there are several examples there.

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

            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