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 resources doesn't work in windows platform
QtWS25 Last Chance

Qt resources doesn't work in windows platform

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 1.3k 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.
  • A Offline
    A Offline
    adam_zhang
    wrote on last edited by
    #1

    Hi Guys:
    I met a problem. I compiled Qt 4.8.5 with MinGW 4.8.1. When I used an embeded resources in my project, I found that I can't use code like @ QPixmap pixmap(":/images/abc.jpg")@ to create a Pixmap. I know that pixmap already created but which's width() and height() is 0, and used same code in Linux, I found that it works.
    I don't why it doesn't work in windows. And I don't how can I makt it worked.
    Help me.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      amonR
      wrote on last edited by
      #2

      And if you try through a QLabel like this:
      @
      QLabel *label = new QLabel(this);
      label->setPixmap(QPixmap(":/images/abc.jpg"));
      @
      Does it work?

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

        Hi and welcome to devnet,

        Since you compiled Qt yourself, are you sure the jpeg plugin was compiled ? (should be but one never knows)

        You can get a list of known readable image format using:

        @qDebug() << QImageReader::supportedImageFormats();@

        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
        • A Offline
          A Offline
          adam_zhang
          wrote on last edited by
          #4

          thanks for SGaist, I saw it, witch can not support jpeg. I'm compling qt project with -qt-jpeg -qt-tiff -qt-png. Maybe tomorrow I will know the answer.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            adam_zhang
            wrote on last edited by
            #5

            Thank you, SGaist. you helped me lot. I recompiled the qt project, it's still compiling. But jpeg format worked.

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

              Glad you have it working now

              Can you also please update the thread title prepending [solved] so other forum users may know a solution has been found :)

              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