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. System Tray Icon in Application linked to a static Qt
QtWS25 Last Chance

System Tray Icon in Application linked to a static Qt

Scheduled Pinned Locked Moved General and Desktop
6 Posts 5 Posters 4.2k 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.
  • L Offline
    L Offline
    lossio
    wrote on last edited by
    #1

    I have compiled Qt 4.7.2 statically by following this link: http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/

    Now, using the System Tray example from C:\Qt\4.7.2\examples\desktop\systray , I succeed to compile and run it, however the icons from the system tray were not loaded. Looks like I got some problem with the embedded resources, which are supposed to be statically added in the executable file. The example source code contains:

    @Q_INIT_RESOURCE(systray);@

    and

    @iconComboBox->addItem(QIcon(":/images/bad.svg"), tr("Bad"));
    iconComboBox->addItem(QIcon(":/images/heart.svg"), tr("Heart"));
    iconComboBox->addItem(QIcon(":/images/trash.svg"), tr("Trash"));@

    I can run the same example without any problem with the icons if I link the application with a shared compilation of Qt.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      You must link to XML and SVG static plugins. There are some qmake config variables to add those to the build automatically. You'll have to fire up Qt Assistant for a search.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lossio
        wrote on last edited by
        #3

        I think XML and SVG are not plugins, they are part of the Qt library. When compiling the Qt libraries, there is not such option to add them, only libjpeg, zlib ...

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          xml and svg are no plugins, that's correct. but they a libraries of qt.
          you need to link them in the pro file:

          @
          QT += core gui xml svg
          @

          Nokia Certified Qt Specialist.
          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dangelog
            wrote on last edited by
            #5

            "Almost". QtSvg is the SVG module for Qt; if you want to read an image with QImageReader (or anything that uses it) an image plugin is required (qsvg in this case).

            http://doc.qt.nokia.com/4.7/plugins-howto.html#static-plugins

            Software Engineer
            KDAB (UK) Ltd., a KDAB Group company

            1 Reply Last reply
            0
            • W Offline
              W Offline
              watchdog
              wrote on last edited by
              #6

              I came across the same issue. But I still don't know how to fix it.
              The method here doesn't work.
              Anyone can help?
              Thanks!

              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