Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-40985

Inconsistency when loading images on windows VS linux

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.3.1
    • Core: Resource System
    • None
    • Windows using the latest Qt Creator package from the site.
      Arch Linux using Qt 5.3.1-1 and Qtcreator 3.2.0-1

      In the global scope of an application, the following code acts different on windows and linux:
      QImage RedCircleImage(":/images/test1.png");

      (The file is added as a resource and is being compiled into the executable successfully)
      On windows, this works fine and the image is loaded. On linux, the file is not loaded and everything set to display the image is blank.

      Fix for linux is to move it into open function like so;

      MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
      {
      ui->setupUi(this);
      QImage RedCircleImage(":/images/test1.png");
      }

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            hjk hjk
            thedjnk Mr nK
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes