Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt.conf causes graphics issues with Qt Quick Application on Ubuntu 16.04 #280

Closed
mitchcurtis opened this issue Apr 13, 2018 · 16 comments
Closed

Comments

@mitchcurtis
Copy link

mitchcurtis commented Apr 13, 2018

Originally I thought this was a Qt bug, so a lot of the details are all there:

https://bugreports.qt.io/browse/QTBUG-67429

For more context, the commands I used:

  1. export PATH=/home/mitch/dev/qt5.11-release/qtbase/bin:$PATH
  2. ~/Downloads/linuxdeployqt-continuous-x86_64.AppImage ~/dev/slate-qt5_11_release-Release-copy/app/slate -qmldir=/home/mitch/dev/slate/app/qml
  3. find /home/mitch/dev/slate-qt5_11_release-Release-copy \( -name "moc_*" -or -name "*.o" -or -name "qrc_*" -or -name "Makefile*" -or -name "*.a" -or -name "uic_wrapper.sh" \) -exec rm {} \;

I spent a while removing code, and at some point I indirectly fixed the issue by changing the build directory in Creator. When I then started looking for possible causes for this in the original build directory, I noticed the qt.conf file. Removing it doesn't fix the issue, because then I get

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Aborted (core dumped)

after renaming my Qt build. The platform plugin is there though:

mitch@mitch:~/dev/slate-qt5_11_release-Release-copy/app$ tree -L 3
.
├── AppRun -> slate
├── doc
│   └── libicu55
│   └── copyright
├── lib
│   ├── libicudata.so.55
│   ├── libicui18n.so.55
│   ├── libicuuc.so.55
│   ├── libQt5Core.so.5
│   ├── libQt5DBus.so.5
│   ├── libQt5Gui.so.5
│   ├── libQt5Network.so.5
│   ├── libQt5Qml.so.5
│   ├── libQt5QuickControls2.so.5
│   ├── libQt5Quick.so.5
│   ├── libQt5QuickTemplates2.so.5
│   ├── libQt5Undo.so.5
│   ├── libQt5Widgets.so.5
│   └── libQt5XcbQpa.so.5
├── plugins
│   ├── bearer
│   │   ├── libqconnmanbearer.so
│   │   ├── libqgenericbearer.so
│   │   └── libqnmbearer.so
│   ├── imageformats
│   │   ├── libqgif.so
│   │   ├── libqicns.so
│   │   ├── libqico.so
│   │   ├── libqjp2.so
│   │   ├── libqjpeg.so
│   │   ├── libqtga.so
│   │   ├── libqtiff.so
│   │   ├── libqwbmp.so
│   │   └── libqwebp.so
│   ├── platforminputcontexts
│   │   ├── libcomposeplatforminputcontextplugin.so
│   │   ├── libibusplatforminputcontextplugin.so
│   │   └── libqtvirtualkeyboardplugin.so
│   └── platforms
│   └── libqxcb.so
├── qml
│   ├── PickAWinner
│   │   ├── libpickawinnerplugin.so
│   │   ├── libpickawinnerplugin.so.debug
│   │   ├── qmldir
│   │   ├── SaturationLightnessPicker.qml
│   │   └── SaturationLightnessPicker.qmlc
│   ├── Qt
│   │   └── labs
│   ├── QtGraphicalEffects
│   │   ├── Blend.qml
│   │   ├── BrightnessContrast.qml
│   │   ├── Colorize.qml
│   │   ├── ColorOverlay.qml
│   │   ├── ConicalGradient.qml
│   │   ├── Desaturate.qml
│   │   ├── DirectionalBlur.qml
│   │   ├── Displace.qml
│   │   ├── DropShadow.qml
│   │   ├── FastBlur.qml
│   │   ├── GammaAdjust.qml
│   │   ├── GaussianBlur.qml
│   │   ├── Glow.qml
│   │   ├── HueSaturation.qml
│   │   ├── InnerShadow.qml
│   │   ├── LevelAdjust.qml
│   │   ├── libqtgraphicaleffectsplugin.so
│   │   ├── libqtgraphicaleffectsplugin.so.debug
│   │   ├── LinearGradient.qml
│   │   ├── MaskedBlur.qml
│   │   ├── OpacityMask.qml
│   │   ├── plugins.qmltypes
│   │   ├── private
│   │   ├── qmldir
│   │   ├── RadialBlur.qml
│   │   ├── RadialGradient.qml
│   │   ├── RectangularGlow.qml
│   │   ├── RecursiveBlur.qml
│   │   ├── ThresholdMask.qml
│   │   └── ZoomBlur.qml
│   ├── QtQml
│   │   ├── Models.2
│   │   ├── plugins.qmltypes
│   │   ├── qmldir
│   │   └── StateMachine
│   ├── QtQuick
│   │   ├── Controls
│   │   ├── Controls.2
│   │   ├── Layouts
│   │   ├── PrivateWidgets
│   │   ├── Templates.2
│   │   └── Window.2
│   └── QtQuick.2
│   ├── libqtquick2plugin.so
│   ├── libqtquick2plugin.so.debug
│   ├── plugins.qmltypes
│   └── qmldir
└── slate

25 directories, 73 files

Deleting the contents of the qt.conf file doesn't help either.

@mitchcurtis
Copy link
Author

I've never used qt.conf files before, but I just noticed that there's one in my Qt build:

[EffectivePaths]
Prefix=..
[DevicePaths]
Prefix=/home/mitch/dev/qt5.11-release/qtbase
[Paths]
Prefix=/home/mitch/dev/qt5.11-release/qtbase
HostPrefix=/home/mitch/dev/qt5.11-release/qtbase
Sysroot=
SysrootifyPrefix=false
TargetSpec=linux-g++
HostSpec=linux-g++
[EffectiveSourcePaths]
Prefix=/home/mitch/dev/qt5.11/qtbase

@mitchcurtis
Copy link
Author

I got an idea from alamminsalo/orion#48 to check with LD_DEBUG=libs:

Aborted (core dumped)
mitch@mitch:~/dev/slate-qt5_11_release-Release-copy/app$ LD_DEBUG=libs ./slate
28082: find library=libQt5Widgets.so.5 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/tls/x86_64:/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/tls:/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/x86_64:/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/tls/x86_64/libQt5Widgets.so.5
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/tls/libQt5Widgets.so.5
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/x86_64/libQt5Widgets.so.5
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Widgets.so.5
28082:
28082: find library=libQt5Quick.so.5 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Quick.so.5
28082:
28082: find library=libQt5Gui.so.5 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Gui.so.5
28082:
28082: find library=libQt5Qml.so.5 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Qml.so.5
28082:
28082: find library=libQt5Undo.so.5 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Undo.so.5
28082:
28082: find library=libQt5Core.so.5 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Core.so.5
28082:
28082: find library=libstdc++.so.6 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libstdc++.so.6
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
28082:
28082: find library=libm.so.6 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libm.so.6
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libm.so.6
28082:
28082: find library=libgcc_s.so.1 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libgcc_s.so.1
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libgcc_s.so.1
28082:
28082: find library=libc.so.6 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libc.so.6
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libc.so.6
28082:
28082: find library=libpthread.so.0 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libpthread.so.0
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libpthread.so.0
28082:
28082: find library=libQt5Network.so.5 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Network.so.5
28082:
28082: find library=libGL.so.1 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libGL.so.1
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
28082:
28082: find library=libpng12.so.0 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libpng12.so.0
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libpng12.so.0
28082:
28082: find library=libz.so.1 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libz.so.1
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libz.so.1
28082:
28082: find library=libicui18n.so.55 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libicui18n.so.55
28082:
28082: find library=libicuuc.so.55 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libicuuc.so.55
28082:
28082: find library=libdl.so.2 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libdl.so.2
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libdl.so.2
28082:
28082: find library=libglib-2.0.so.0 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libglib-2.0.so.0
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libglib-2.0.so.0
28082:
28082: find library=libexpat.so.1 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libexpat.so.1
28082:
28082: find library=libxcb-dri3.so.0 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0
28082:
28082: find library=libxcb-present.so.0 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libxcb-present.so.0
28082:
28082: find library=libxcb-sync.so.1 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libxcb-sync.so.1
28082:
28082: find library=libxshmfence.so.1 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libxshmfence.so.1
28082:
28082: find library=libglapi.so.0 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libglapi.so.0
28082:
28082: find library=libXext.so.6 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libXext.so.6
28082:
28082: find library=libXdamage.so.1 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libXdamage.so.1
28082:
28082: find library=libXfixes.so.3 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libXfixes.so.3
28082:
28082: find library=libX11-xcb.so.1 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
28082:
28082: find library=libX11.so.6 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libX11.so.6
28082:
28082: find library=libxcb-glx.so.0 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libxcb-glx.so.0
28082:
28082: find library=libxcb-dri2.so.0 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0
28082:
28082: find library=libxcb.so.1 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libxcb.so.1
28082:
28082: find library=libXxf86vm.so.1 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libXxf86vm.so.1
28082:
28082: find library=libdrm.so.2 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libdrm.so.2
28082:
28082: find library=libicudata.so.55 [0]; searching
28082: search path=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib (RUNPATH from file ./slate)
28082: trying file=/home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libicudata.so.55
28082:
28082: find library=libpcre.so.3 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/lib/x86_64-linux-gnu/libpcre.so.3
28082:
28082: find library=libXau.so.6 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libXau.so.6
28082:
28082: find library=libXdmcp.so.6 [0]; searching
28082: search cache=/etc/ld.so.cache
28082: trying file=/usr/lib/x86_64-linux-gnu/libXdmcp.so.6
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libpthread.so.0
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libc.so.6
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libXdmcp.so.6
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libXau.so.6
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libpcre.so.3
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libicudata.so.55
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libm.so.6
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libdrm.so.2
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libdl.so.2
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libxcb.so.1
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libX11.so.6
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libXext.so.6
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libXfixes.so.3
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libXdamage.so.1
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libglapi.so.0
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libxshmfence.so.1
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libxcb-present.so.0
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libexpat.so.1
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libglib-2.0.so.0
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libgcc_s.so.1
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libicuuc.so.55
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libicui18n.so.55
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libz.so.1
28082:
28082:
28082: calling init: /lib/x86_64-linux-gnu/libpng12.so.0
28082:
28082:
28082: calling init: /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Core.so.5
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Network.so.5
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Undo.so.5
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Qml.so.5
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Gui.so.5
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Quick.so.5
28082:
28082:
28082: calling init: /home/mitch/dev/slate-qt5_11_release-Release-copy/app/lib/libQt5Widgets.so.5
28082:
28082:
28082: initialize program: ./slate
28082:
28082:
28082: transferring control: ./slate
28082:
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Aborted (core dumped)

I dunno if this is the same problem, but just to highlight the relevant part from that:

calling init: /usr/lib/x86_64-linux-gnu/libxcb.so.1

@mitchcurtis mitchcurtis changed the title qt.conf causes graphics issues with Qt Quick Application qt.conf causes graphics issues with Qt Quick Application on Ubuntu 16.04 Apr 13, 2018
@probonopd
Copy link
Owner

I don't understand what the issue is. "The ripple effects are all over" = ?

@mitchcurtis
Copy link
Author

mitchcurtis commented Apr 13, 2018

The ripple effects (of Qt Quick Controls 2's Material Style) are completely misplaced and the wrong size. I know it's a weird symptom of the issue, but it's not the only one: the shader in the colour picker is completely white. It could be something to do with the scenegraph or Qt Graphical Effects. All I know is, it runs fine if I remove the qt.conf. I've never run into this issue until the qt.conf was there.

@probonopd
Copy link
Owner

Do you observe the same if you run it on a system without Qt installed?

@mitchcurtis
Copy link
Author

mitchcurtis commented Apr 13, 2018

I haven't tried that. I assume you mean with no Qt libraries at all, even system ones? Not sure that's an experiment I want to try, given my limited Linux knowledge. :)

I have renamed the Qt build directory though (to ensure that it wasn't still referring to libraries there), and yes, it's the same behaviour.

@probonopd
Copy link
Owner

Yes, I am interested in what happens if you run on a system that has no system Qt. E.g., a live ISO of Xubuntu.

@mitchcurtis
Copy link
Author

Sorry, but that's more work than I'm currently willing to invest into this. I ended up just building statically. Slate is available to be cloned if you want to try to reproduce it.

@mitchcurtis
Copy link
Author

Just to add more info to this, I'm now pretty certain that this type of graphical issue is caused by the Qt XCB integration plugin not being imported properly:

https://bugreports.qt.io/browse/QBS-1409

Maybe the qt.conf file is perhaps not pointing to the correct place or something? I dunno. For reference, this was the qt.conf file, taken from here:

# Generated by linuxdeployqt
# https://github.com/probonopd/linuxdeployqt/
[Paths]
Prefix = ./
Plugins = plugins
Imports = qml
Qml2Imports = qml

mitchcurtis added a commit to mitchcurtis/slate that referenced this issue Nov 2, 2018
After switching to Qbs (and building statically to avoid [1]),
we ran into [2]. We now have a workaround for that,
so we can finally release on Linux again.

Closes #71.

[1] probonopd/linuxdeployqt#280
[2] https://bugreports.qt.io/browse/QBS-1409
@probonopd
Copy link
Owner

@mitchcurtis thanks for the pointer. What do you mean by "Qt XCB integration plugin not being imported properly"? I assumed that either it gets loaded (then the application runs) or doesn't get loaded (in which case the app refuses to run). Am I wrong?

@mitchcurtis
Copy link
Author

mitchcurtis commented Nov 2, 2018

In the case of the linked bug report, the plugin was imported:

#include <QtPlugin>
Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)

but it wasn't being loaded I think? So "imported" might have been the wrong choice of word... whatever this does in Qbs is what was missing:

mitchcurtis/slate@3cd3dbf

In both cases (Qbs and linuxdeployqt), the application runs for some reason, but refuses to display certain items that use shaders, it seems.

@mitchcurtis
Copy link
Author

From the documentation, it seems like the Depends type is for linking, so I guess it wasn't being linked to.

http://doc.qt.io/qt-5/qtplugin.html#Q_IMPORT_PLUGIN says:

Static plugins must also be included by the linker when your application is built. For Qt's predefined plugins, you can use the QTPLUGIN to add the required plugins to your build. For example:

Looking at the code, it just creates an instance of the plugin.

So that seems to suggest that it was the linking that was missing, but I'm not sure why it results in the graphical issues and not some error.

@probonopd
Copy link
Owner

My Qt skills are nowhere good enough to make sense of this. We need a Qt expert here.

@realnc
Copy link

realnc commented Jan 16, 2019

It seems when you deploy, the target system uses the platform's Qt libs, not the ones you bundled with the binary. You need to build your app with an rpath that points to the lib subdirectory in the executable's directory. You can use $ORIGIN for this:

QMAKE_RPATHDIR += $ORIGIN/lib

Libraries will now be loaded from the lib subdirectory of wherever directory the slate executable is in, so that means it's completely relocatable.

@mitchcurtis
Copy link
Author

mitchcurtis commented Jan 16, 2019

It seems when you deploy, the target system uses the platform's Qt libs, not the ones you bundled with the binary. You need to build your app with an rpath that points to the lib subdirectory in the executable's directory. You can use $ORIGIN for this:

QMAKE_RPATHDIR += $ORIGIN/lib

Libraries will now be loaded from the lib subdirectory of wherever directory the slate executable is in, so that means it's completely relocatable.

Awesome, thanks @realnc! I'll have to give that a try sometime. I guess that would be rpaths with Qbs:

https://doc.qt.io/qbs/qml-qbsmodules-cpp.html#rpaths-prop

I'll close this on the assumption that that fixes it, and will reopen if it doesn't.

@probonopd
Copy link
Owner

linuxdeployqt should automatically set the rpath for you; please open an issue there if it doesn't.

sagar0710 added a commit to sagar0710/pixeditor that referenced this issue Jul 2, 2023
After switching to Qbs (and building statically to avoid [1]),
we ran into [2]. We now have a workaround for that,
so we can finally release on Linux again.

Closes #71.

[1] probonopd/linuxdeployqt#280
[2] https://bugreports.qt.io/browse/QBS-1409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants