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
Forum Updated to NodeBB v4.3 + New Features

Qt resources doesn't work in windows platform

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 1.3k 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.
  • A Offline
    A Offline
    adam_zhang
    wrote on 16 May 2014, 01:59 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 16 May 2014, 02:18 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
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 16 May 2014, 07:38 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 16 May 2014, 15:42 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 18 May 2014, 11:25 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
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 18 May 2014, 20:15 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

              1/6

              16 May 2014, 01:59

              • Login

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