Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Solved] Problem with Qt Resource System
Forum Updated to NodeBB v4.3 + New Features

[Solved] Problem with Qt Resource System

Scheduled Pinned Locked Moved Qt Creator and other tools
13 Posts 2 Posters 3.6k 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.
  • K Offline
    K Offline
    koahnig
    wrote on last edited by
    #1

    As the title indicates I have an issue with the Qt Resource System.

    I have a very small .qrc file holding the information for one icon file. In my application I am using this icon for display. Everything works as anticipated on my development platform (Windows 7 professional, 64 bit).
    When I deploy my application to Windows Server 2008 64 bit the icon is not displayed.
    I am using Qt 5.1 with MinGW.

    I have not used .qrc very much so far, so I thought I have misinterpret something.
    However the "documentation":http://qt-project.org/doc/qt-5.0/qtcore/resources.html says:
    [quote]
    The Qt resource system is a platform-independent mechanism for storing binary files in the application's executable. This is useful if your application always needs a certain set of files (icons, translation files, etc.) and you don't want to run the risk of losing the files.
    [/quote]

    Anyone an idea what the cause could be?

    Vote the answer(s) that helped you to solve your issue(s)

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

      Hi,

      What size/resolution is your icon ? I've had problem on Windows XP where I had to have a low-res/low-size icon to get it shown.

      IIRC a 32x32 icon

      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
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        Thanks for feedback.

        I had used 16x16. In the meantime I have tested 32x32 and 48x48. Each of these formats are shown on my local machine (development), but not on the server where I am running the application.
        When running on my local machine it is always ok, regardless if through Qt creator or on a deployment folder. The deployment folder is copied with all the dependencies to the server. So, it has the same dlls including the ones required for MinGW. Only a couple of windows dlls as supplied by the system shall be different.

        Vote the answer(s) that helped you to solve your issue(s)

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

          Do you also have the rc (not qrc) file for your application ?

          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
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            Yep, I have.

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              I have removed the .rc file and compiled the same result, but the application icon is missing as well ;(

              Vote the answer(s) that helped you to solve your issue(s)

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

                Well, at least we know that something is working if the icon disappeared...

                Can you post the rc and pro file ?

                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
                • K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #8

                  bliblablo.pro
                  @
                  QT += core gui network
                  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

                  TEMPLATE = app
                  TARGET = bliblablo

                  include(../../CompileSettings/blabla.inc)
                  INCLUDEPATH += .
                  ./Gui

                  include(bliblablo.pri)

                  win32:RC_FILE = bliblablo.rc

                  HEADERS +=
                  Gui/blobloProcessInformation.h

                  SOURCES +=
                  Gui/blobloProcessInformation.cpp
                  @

                  bliblablo.rc
                  @
                  IDI_ICON1 ICON DISCARDABLE "bliblablo.ico"
                  @

                  bliblablo.qrc
                  @
                  <RCC>
                  <qresource prefix="/bliblablo">
                  <file>pictograms-road_signs-stop_sign(16x16).ico</file>
                  <file>pictograms-road_signs-stop_sign(32x32).ico</file>
                  <file>pictograms-road_signs-stop_sign(48x48).ico</file>
                  </qresource>
                  </RCC>
                  @

                  The pixel sizes are given in the names. These icons are from open_icon_library. bliblablo.ico is self-generated icon. Do not remember any more how.

                  Note: I have anonymized the names, but they are consistent.

                  Vote the answer(s) that helped you to solve your issue(s)

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

                    Just to rule out the obvious, is bliblablo.ico in the same folder as the rc file ?

                    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
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #10

                      Yes. All icons are in the same folder as well as the (q)rc files.

                      The problem is not bliblablo,ico which is shown in left corner of mainwindow and everywhere where it should appear. The problems are with the stop sign. They are loaded out of the qrc file with
                      @
                      QIcon icon ( ":/bliblablo/pictograms-road_signs-stop_sign(48x48).ico" );
                      QTableWidgetItem *wgt = new QTableWidgetItem (icon, runName );
                      ui->twProcessOverview->setItem ( cnt, _ActionCol, wgt );
                      @

                      No problem on development machine started inside and outside of creator with and without debug mode.
                      When bringing to other machine, the application does work as expected. Only the stupid stop icons are not shown.

                      Vote the answer(s) that helped you to solve your issue(s)

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

                        Woops sorry… I misunderstood you.

                        Is your ico plugin missing ?

                        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
                        • K Offline
                          K Offline
                          koahnig
                          wrote on last edited by
                          #12

                          Hpfff...
                          You hit the nail on the head.
                          Thanks a lot!

                          Vote the answer(s) that helped you to solve your issue(s)

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

                            You're welcome !

                            That's why I use png for images other than the required application icon, no plugin needed :)

                            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