Important: Please read the Qt Code of Conduct -

Can QtCreator be built with Qt5 configured -no-opengl ?

  • I have a code base that uses the 'slot' and 'signal' keywords as variables rather extensively - AND - I need to run Qt Creator on this code base on a headless server using OpenNX to connect to it. I also need to run this on CentOS 6.6, which now appears to be supported as indicated by this article: Qt is coming to Red Hat Enterprise Linux!

    From the preceding, it appears that my "best option" (painful though it has turned out to be) is to build from source so that I can patch the code handling the 'slot' and 'signal' keywords to correctness. If I could use the Linux executables I would in a heartbeat, but unless those keywords are now truly disabled by defining QT_NO_KEYWORDS, I still must build from source.

    I have built (around mid January 2014) QtCreator 3.0.0 from source with Qt 5.2.0 also built from source, running on CentOS 6.6. This "works" with an ugly wrapper around it to kill all the Qt stuff that tries to start OpenGL with no real hardware screens, so at least it doesn't die. See my comments on QTBUG-31354 to see what I did to get that going.

    In order to truly kill the "slot" and "signal" keywords I had to do some source code editing because all of the places in the code that implement those keywords were not made conditional on the QT_NO_KEYWORDS environment variable the way they should have been.

    Now I wanted to bring that forward, building Qt Creator 3.6.0 with Qt5 5.5.1 under it. I looked at the Qt Creator build instructions at Building Qt Creator from Git, and those don't give any indication that building Qt with -no-opengl on the configure would be a problem. Indeed, Qt 5.5.1 built with no complaint with that configure option.

    My problems started with trying to configure a Qt Creator 3.6.0 build when using that build of Qt 5.5.1. I immediately got:

    Project ERROR: Unknown module(s) in QT: quick

    I did a Google search and turned up this topic: Project ERROR: Unknown module(s) in QT: quick, where the first reply states that 'The module name for QtQuick1 is "declarative", not "quick".' So I thought I would try the name change and see if I could build. I came up with a set of sed scripts that look like:

    sed -i -e "/QT /s/quickwidgets/widgets/" build/qt-creator-opensource-src-3.6.0/src/plugins/qmlprofiler/
    sed -i -e "/QT /s/quickwidgets/widgets/" build/qt-creator-opensource-src-3.6.0/src/plugins/qmldesigner/
    sed -i -e "/QT /s/quickwidgets/widgets/" build/qt-creator-opensource-src-3.6.0/src/plugins/qmldesigner/
    sed -i -e "/QT /s/quick-private/declarative-private/" build/qt-creator-opensource-src-3.6.0/src/plugins/qmldesigner/
    sed -i -e "/QT /s/quickwidgets/widgets/" build/qt-creator-opensource-src-3.6.0/src/plugins/welcome/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/src/plugins/qtsupport/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/src/plugins/qmlprofiler/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/src/plugins/projectexplorer/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/src/plugins/qmldesigner/components/stateseditor/stateseditor.pri
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.pri
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/src/libs/timeline/
    sed -i -e "/QT /s/quick/declarative/g" build/qt-creator-opensource-src-3.6.0/src/tools/qml2puppet/qml2puppet/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/share/qtcreator/templates/wizards/projects/qmake/qtcanvas3dapplication/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrolsapplication/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/share/qtcreator/templates/wizards/qtquick2-extension/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/share/qtcreator/qml/qmlpuppet/qml2puppet/qml2puppet.pri
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/tests/manual/qml/testprojects/uisplit/basiclayouts/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/tests/manual/debugger/qquick2/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/tests/auto/timeline/shared/shared.pri
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/doc/examples/transitions/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/doc/examples/accelbubble/
    sed -i -e "/QT /s/quick/declarative/" build/qt-creator-opensource-src-3.6.0/doc/examples/uiforms/

    This got me a lot farther, but I still had problems with hostosinfo.cpp trying to check for the presence of OpenGL using what is now a non-existent class constructor definition of QOpenGLContext(). So I did a patch file for that based on QT_NO_OPENGL being defined or not.

    That got me further, but now in the timeline lib I get non-existent header files named QSGNode and QSGTransformNode, those being expected from my previous Qt 5.5.1 build.

    Is there something else in the way of a global build or qmake variable definition that I could do to get Qt Creator to build with Qt5 that has no OpenGL?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    IIRC, the declarative module is not built by default so you should only need to build the declarative module and install it in order to use it.

  • Hi SGaist,
    Thank you for your reply. As far as I can tell, I already have the Qt 5.5.1 declarative module built and installed. My install is located at /usr/local/qt/5.5.1 , and the lib subdirectory contains:

    -rw-rw-r--. 1 akahlich     773 Jan  2 17:46 /usr/local/qt/5.5.1/lib/
    -rw-rw-r--. 1 akahlich    1079 Jan  2 17:46 /usr/local/qt/5.5.1/lib/libQt5Declarative.prl
    lrwxrwxrwx. 1 akahlich      26 Jan  2 17:46 /usr/local/qt/5.5.1/lib/ ->
    lrwxrwxrwx. 1 akahlich      26 Jan  2 17:46 /usr/local/qt/5.5.1/lib/ ->
    lrwxrwxrwx. 1 akahlich      26 Jan  2 17:46 /usr/local/qt/5.5.1/lib/ ->
    -rwxr-xr-x. 1 akahlich 3591424 Jan  2 17:46 /usr/local/qt/5.5.1/lib/

    Similarly, the /usr/local/qt/5.5.1/include folder contains a QtDeclarative folder.

    As far as I can tell, I am already using the declarative module - unless there is a way it should be built so that it is called QtQuick (and not QtQuick1 nor QtQuick2). If it can be built so that it is called QtQuick, then there would be no need for all of the sed commands I wrote to patch all occurrences of quick to declarative.

    At this point I think I am beyond that, but I was running into other direct references to Qt 5.5.1 OpenGL modules that don't exist in my build because I used -no-opengl for my Qt configure command prior to building and installing it.

    What I am looking for is any macro or property value I should set to truly disable the Qt Creator configuration and/or build from expecting any Qt 5.5.1 OpenGL classes or functions.

  • Lifetime Qt Champion

    AFAIK, there's no such switch currently in Qt Creator

Log in to reply