Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QImage::Format_Grayscale16 not supported in 4.10.2 open source



  • Hi,

    I tested for loading 16 bit images by using QImage::Format_Grayscale16 as the format with 5.13 (4.10.2) enterprise version.

    I use 4.10.2 open source community version and open the same project where i am able to test 16 bit images, i get the error that the format is not supported. I go to QImage.h and add the format, my application crashes after trying to load 16 bit images

    Could you please help me in solving this?

    Thanks
    Sachin



  • @SachinBhat said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    4.10.2 open source community version

    Are you talking about Qt Kit or Qt Creator (the IDE)?
    If you want to use QImage::Format_Grayscale16, you need to use Qt 5.13.0 or superior.
    Please don't mix Qt Creator, which is an IDE to help to develop an application with Qt, and Qt Kit version.
    QtCreator 4.10.2 is build using Qt Kit 5.13, but this has absolute no link with the Qt version you are using to build your project.
    This is my QtCreator version:
    1fd6c2ce-c62e-49c5-8c83-d577adf6965c-image.png

    Those are the Qt Kit I use to build my applications:
    bc0d7a23-efeb-4119-9e14-d630ad1a2459-image.png



  • My Qt creator version is 4.10.2 and Qt kit is 5.13.2

    66d65947-5969-49dc-ae72-a87da0eae68c-image.png
    I need an open source version as the license ends in 4 days. We have developed an application with Qtkit version 5.3.2 and creator version 4.3.2 where the code is open and there is a need to port to latest version 5.13.0 or more

    I guess I have messed up with installation when i tried to install the open source version later

    Could you please help me to install both Qt creator and its kit which is open source?

    Thanks
    Sachin



  • @SachinBhat said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    My Qt creator version is 4.10.2 and Qt kit is 5.13.2

    Are you sure you are using Qt kit 5.13.2?
    On the screenshot, I can only see that you are using Qt Creator 4.10.2 which has been built with Qt 5.13.2.
    The Qt kits your are using are defined in Tools/Options/Kits.
    For example, as you can see in my previous post, I am using following kits:

    • Qt 5.12.6 Android ARMv7
    • Qt 5.12.6 MSVC2017 32bit
    • QT 5.4.2 MSVC2013 32bit


  • @SachinBhat said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    Could you please help me to install both Qt creator and its kit which is open source?

    To install a Qt kit, you only need to restart Qt Maintenance Tool, which is in you Qt installation directory, per default it is c:\Qt\MaintenanceTool.exe on Windows systems.

    The select "Add or remove components"
    1cec4bf3-25ba-419a-82b4-8b317f9fc8b5-image.png

    The check LTS and Latest releases, and click Refresh to get Component list refreshed
    ae4e40b9-798b-4715-b2c6-f515bd671673-image.png

    After that, you can choose with Qt Kit you want, be aware, each Qt version has several kits (MSVC, MinGW, Android, etc.).
    77a01cea-11cf-41ca-9a91-abfdc69865c6-image.png

    Only select the Qt kit you are really need to not pollute your PC!



  • This post is deleted!


  • Thanks a lot for the information.

    Currently, I uninstalled everything and just installed the open source Qt creator. I go to tools/option/kit and I get window as below which should be obvious as I do not have the kit.

    379c73b4-7f01-4ef6-a965-8e86be1b5ebc-image.png

    Now I just install the unified qt package from qt website https://account.qt.io

    Just wanted to clarify that I am doint the right thing

    Thanks
    Sachin



  • @SachinBhat I think you have some bad settings in your QtCreator.
    First, a Qt Kit is a combination of a Qt version + Compiler + Debugger.
    So to be usable, all those elements must be present, in the awaited path to work.

    Qt MaintenanceTool can only install the tools which are created by Qt, for example for Windows:

    • pre-builds of Qt versions (5.12.6, 5.13.2, 5.14.0, etc.) with given compiler (MSVC, MinGW, GCC, etc.)
    • MinGW toolchains
    • Qt Creator
    • Qt 3D Studio
    • etc.

    If you want to use Qt 5.13.2 for MSVC 2017, you must first install MSVC 2017 on your PC, if you want to use Qt 5.13.2 for MinGW 7.3.0, you must ensure MinGW 7.3.0 is also selected in Devlopper and Designer Tools (which is the case per default).

    After Qt MaintenanceTool has finished installation, (re)start Qt Creator, which will scan the C:\Qt directory to find all available Qt Kits, which will be listed under "Kits/Auto-detected", as you can see on my previous sent screenshots.

    After that, you can select this kit to build and run your project.



  • I install using unified installer and select the follwing components as my application is 32 bit. I get hid api error as below

    Qtinstallsettings.PNG

    I get :-1: error: skipping incompatible ../GUI/hidapi-master/windows/debug/hidapi.dll when searching for -lhidapi

    I am making sure it is 32 bit.

    I got this error before and i was able to resolve when i removed 64 bit components

    Sorry for bugging you continuously as I am new to this platform

    Thanks
    Sachin



  • @SachinBhat said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    I get :-1: error: skipping incompatible ../GUI/hidapi-master/windows/debug/hidapi.dll when searching for -lhidapi

    First: are you sure you need all those 6 Kits for Qt 5.13.2? To you really want to target 6 different hardware types?
    Second: when do you have this error? during Qt installation or during the build of your project?



  • During build of my project



  • for your first question, i need only for just one of them. I added them just to debug if hid api is using any other package



  • @SachinBhat said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    I added them just to debug if hid api is using any other package

    To avoid problems and to not slow down Qt Creator launch, install only the Qt Kit you want to use, this will save space on your disk and time!
    Qt Kit do never share packages, all libraries are build for a specific target + compiler combination, there no need to select all, the only things that are common are: Sources, Qt Charts, Qt Data Visualisation, Qt...



  • @SachinBhat said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    During build of my project

    this look like a problem with you project file



  • I do not get when i build with 5.3.2 version. So I believe it wont be a problem with my project file..



  • @SachinBhat said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    I do not get when i build with 5.3.2 version.

    Interesting, which Qt Kit you are using for Qt 5.3.2:

    • MSVC2013 64bit?
    • MSVC2013 32bit?
    • MSVC2012 32bit?
    • MSVC2010 32bit?
    • MinGW 4.8.2?


  • @KroMignon
    I am using MinGW 4.8.2
    Build build-GUI-Desktop_Qt_5_3_MinGW_32bit-Debug
    I also get this error along with hid api error if it helps collect2.exe:-1: error: error: ld returned 1 exit status

    Thanks
    Sachin



  • Here are the build settings for 5.13.2
    a39b3ae9-520d-4aba-9b54-f8c0dd85e77b-image.png

    Here are the build settings for 4.8.2
    6726d14c-2ce0-4e27-b994-23ce3094ad72-image.png

    Thanks
    Sachin



  • @SachinBhat said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    I also get this error along with hid api error if it helps collect2.exe:-1: error: error: ld returned 1 exit status

    I am lost, is this project working with Qt 5.3.2 or not?
    It is very hard to follow your explanations.
    What is working and what is not working:

    • can you build with Qt 5.3.2/MinGW?
    • can you run your project with Qt 5.3.2/MinGW?
    • can you build with Qt 5.13.2/MinGW 32bit?
    • can you run your project with Qt 5.13.2/MinGW 32bit?


  • @KroMignon said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    can you build with Qt 5.3.2/MinGW? yes
    can you run your project with Qt 5.3.2/MinGW? yes
    can you build with Qt 5.13.2/MinGW 32bit? No
    can you run your project with Qt 5.13.2/MinGW 32bit? No

    I apologise if i was not being clear.

    I had a working version with 5.13.2 when i installed all the packages after only removing 64 bit ones.

    I uninstalled it for getting the open source. I install with the packages selected in the image i sent. It doesn't build the project

    What does the hidapi.dll require exactly?

    Thanks
    Sachin



  • @SachinBhat said in QImage::Format_Grayscale16 not supported in 4.10.2 open source:

    What does the hidapi.dll require exactly?

    As far as I know, hidapi.dll is not part of Qt, and a quick google search gives me ==> https://github.com/libusb/hidapi

    So, how did you compile hidapi?



  • I will let you know how the hidapi.dll was compiled by asking my team. Are the build settings correct?



  • Let me mark this thread as solved as the topic is something else. I will start a new one with better explanation of the issue


Log in to reply