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. BadgeLable related methods deprecated, how to access NSApp etc. from Qt?
Forum Updated to NodeBB v4.3 + New Features

BadgeLable related methods deprecated, how to access NSApp etc. from Qt?

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 2 Posters 559 Views 2 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.
  • artwawA Offline
    artwawA Offline
    artwaw
    wrote on last edited by
    #1

    Good afernoon,
    since I am getting deprecated warning:
    warning: 'setBadgeLabelText' is deprecated: Use NSApp.dockTile.badgeLabel
    how can I implement simple number appearing over the tile?

    So far I had a signal reporting the amount of new items and slot that simply used the now deprecated method.

    Any advice would be highly appreciated.

    For more information please re-read.

    Kind Regards,
    Artur

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

      You can take a look at the QtMacExtras module code behind the method and replicate it within your code.

      Something like:

      #import <AppKit/NSApplication.h>
      #import <AppKit/NSDockTile.h>
      
      void MyClass::showLabel(const QString& label)
      {
       [[NSApplication sharedApplication] dockTile].badgeLabel = label.toNSString();
      }
      

      The MyClass implementation should be in a file with a .mm extension and that file be added to the OBJECTIVE_SOURCES variable.

      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
      2
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        Are you using the QtMacExtras module ?

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

        artwawA 2 Replies Last reply
        0
        • SGaistS SGaist

          Hi,

          Are you using the QtMacExtras module ?

          artwawA Offline
          artwawA Offline
          artwaw
          wrote on last edited by
          #3

          @SGaist I do, yes.

          For more information please re-read.

          Kind Regards,
          Artur

          1 Reply Last reply
          0
          • artwawA Offline
            artwawA Offline
            artwaw
            wrote on last edited by
            #4

            Anyone? Anything? I am not in the rush but I'd like to at least know where to search for the answer.

            For more information please re-read.

            Kind Regards,
            Artur

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

              You can take a look at the QtMacExtras module code behind the method and replicate it within your code.

              Something like:

              #import <AppKit/NSApplication.h>
              #import <AppKit/NSDockTile.h>
              
              void MyClass::showLabel(const QString& label)
              {
               [[NSApplication sharedApplication] dockTile].badgeLabel = label.toNSString();
              }
              

              The MyClass implementation should be in a file with a .mm extension and that file be added to the OBJECTIVE_SOURCES variable.

              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
              2
              • artwawA Offline
                artwawA Offline
                artwaw
                wrote on last edited by
                #6

                Thank you, will go that way.

                For more information please re-read.

                Kind Regards,
                Artur

                1 Reply Last reply
                0
                • SGaistS SGaist

                  Hi,

                  Are you using the QtMacExtras module ?

                  artwawA Offline
                  artwawA Offline
                  artwaw
                  wrote on last edited by
                  #7

                  @SGaist FYI, manual now states:

                  OBJECTIVE_SOURCES
                  
                  Specifies the names of all Objective-C/C++ source files in the project.
                  
                  This variable is now obsolete, Objective-C/C++ files (.m and .mm) can be added to the SOURCES variable.
                  

                  Same for headers. Again, thanks for your help, I think I've got this up and running :)

                  For more information please re-read.

                  Kind Regards,
                  Artur

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

                    Thanks for the info. I did that from memory.

                    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

                    • Login

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