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. .jpeg / .jpg not displaying in CLion
QtWS25 Last Chance

.jpeg / .jpg not displaying in CLion

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++clion-ide
2 Posts 2 Posters 148 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.
  • E Offline
    E Offline
    EpicP
    wrote on last edited by
    #1

    Windows10, Clion, Qt 6.8.1 (also tried 6.6.1), mingw_64

    I am trying to display images inside listWidget. .png files are displayed properly, .jpg files are just ignored.
    I recretaed it in Qt Creator where it works.

    What i am trying to do:

    auto *item = new QListWidgetItem(QIcon(filePath), filePath);
    item->setData(Qt::UserRole, filePath);
    ui->listWidget->addItem(item);
    

    Moving images, dlls, and /imageformats into the working directory/the plugins folder did not help, even though QImageReader::supportedImageFormats() returns the following:

    Supported image formats:  "bmp, cur, gif, icns, ico, jfif, jpeg, jpg, pbm, pgm, png, ppm, tga, tif, tiff, wbmp, webp, xb
    m, xpm"
    

    clion.PNG
    qtcreator.PNG

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

      Hi and welcome to devnet,

      I haven't used CLion yet but I found this tutorial from their documentation. Did you follow it ?

      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