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 Static build Rendering looks bad and unable to read shaders
Forum Updated to NodeBB v4.3 + New Features

Qt Static build Rendering looks bad and unable to read shaders

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 854 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.
  • D Offline
    D Offline
    dillydill123
    wrote on last edited by dillydill123
    #1

    I recently did a Qt 5.9.1 Static build using the configuration

    configure -c++std c++11 -prefix C:\Qt\install -platform win32-msvc2017 -release -opensource -static -static-runtime -no-compile-examples -opengl desktop -nomake examples -nomake tests
    

    The build works fine, and I'm able to create standalone executables for simple applications. However, when I try to load a QML application, the resolution looks bad and my mouse does not map with the GUI correctly. It seems that the application thinks the mouse is higher than it actually is. I had this issue before with my dynamic kits, but I solved it with the following:

    QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
    

    Unfortunately it does work when I try my static build. When I run this program on my other computer with a dedicated GPU, it looks much better, but I still have another error listed below.

    I also receive many errors like these in my program

    ShaderEffect: Failed to read :/QtQuick/Controls/Shaders/blur.vert
    QQuickOpenGLShaderEffect: 'source' does not have a matching property!
    

    The program uses a slider and the knobs on it are black boxes.

    0_1507937666160_qtError.PNG

    The program looks and works fine when I switch to my dynamic kit (I have MSVC2017 64 bit and MinGW 32 bit that both work, also 5.9.1).

    Even weirder is that it seems to be QtQuick.Controls 1 that has the issue. When I switch to QtQuick.Controls 2 (e.g., 2.2), a different slider appears but the black boxes disappear.

    How do I fix these issues? Any clue as to what is happening?

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

      Hi and welcome to devnet,

      You are build Qt with only the desktop OpenGL backend and then you are forcing the software render when running your application. Looks a bit contradictory.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        You are build Qt with only the desktop OpenGL backend and then you are forcing the software render when running your application. Looks a bit contradictory.

        D Offline
        D Offline
        dillydill123
        wrote on last edited by
        #3

        @SGaist

        That is a good point. I use the software render when I use the dynamic kits. Removing that line doesn't make a difference for the static build, unfortunately.

        I've tried using QGuiApplication::setAttribute(Qt::AA_UseDesktopOpenGL); and many of the other attributes before QGuiApplication is created with no success. I think the issue may be with my configuration options when I build. I've been looking online and seeing that maybe I can try using -opengl dynamic when I configure the static build. I'm going to try this in the mean time, because no other solutions have worked. Do you know of any other potential solutions?

        As far as the shaders issue, I've managed a temporary fix by copying the shaders from the source and adding them to a QRC with the prefix specified by the error. It seems that my project thinks they are part of a resource rather than looking for them elsewhere. It's a strange fix but it will work for the time being.

        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