graph_tool pyside gtk 2.x and gtk 3.x - qt

Environment: openSuSE 12.3 - Gnome
Error:
When I execute my program, i get this:
"Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
Trace/breakpoint trap"
Notice:
It occurs whenever I try to import at the same PySide and graph_tool modules.
To be more specific, whenever I import draw from graph_tool (which is the one that probably uses GTK+ 3.x)
graph_tool: http://graph-tool.skewed.de/
Problem:
I NEED the draw function AND PySide modules
So:
Is there a way to force PySide to use GTK+ 3.x styles instead of 2.x ones?
Or any other option to use both modules harmonically?
Thanks in advance!

Just solved:
from PySide import *
import gtk
import graph_tool.all as gt
By importing gtk itself, it apparently overrides any attempt from PySide submodules to use GTK+ 2.x namespaces.
Must be imported BEFORE graph_tool, apparently.

Related

Error loading apt-installed QtDataVisualization at runtime on ubuntu

I'm running Qt 5.12 on ubuntu 20.04.3. Qt software components are installed with apt. My C++ application uses Qt DataVisualization . I've installed these apt packages for DataVisualization:
libqt5datavisualization5-dev
qml-module-qtdatavisualization
The app compiles OK, but the runtime cannot find the qml module. My qml file contains this import statement as specified by Qt documentation:
import QtDataVisualization 1.15
But at runtime I get the error:
QQmlApplicationEngine failed to load component
qrc:/main.qml:6 module "QtDataVisualization" version 1.15 is not installed
I get a similar runtime error if qml has "import QtDataVisualization 1.14".
Can someone help please? Thanks!
This page indicates that DataVisualization 1.2 should be imported for Qt 5.12 applications - this resolves my issue.

QML QtGraphicalEffects is not Installed

I am trying to build any random QML component, and having this line import QtGraphicalEffects 1.15 will cause an error: 'module "QtGraphicalEffects" is not installed`
I am running on a virtual machine and just created a new virtual environment with Pyside6 and Python using pip install PySide6==6.1.2 to get the latest version. I can find the folder GraphicalEffects with a qtgraphicaleffectsplugin.dll in the Qt5Compat folder of the PySide6 Lib so I do not know why it cannot import this module. The other ones like QtQuick.Controls import fine.
I have also used print("Qt version: " + str(QtCore.qVersion())) to double check Qt version, and I get Qt version: 6.1.2
There seems to be some solutions in other discussion posts, but I have not found one that refers to Python side of things. I am aware Qt 6.0 does not seem to have QtGraphicalEffects, but it's supposed to be in 6.1. I am also not sure if this has to do with the virtual machine because on host I actually have no issue using QtGraphicalEffects
Qt QtGraphicalEffects is available in PySide6 but the module has changed the way of importing to import Qt5Compat.GraphicalEffects as indicated in the docs.

Where do I find the latest version of the QtQuick2 libraries?

I'm new to Qt/QML/Qt Quick.
I have Qt 5.14 and QtCreator installed and am attempting to build a sample application.
Currently I have QtQuick 2.12 installed (which came with the QtCreator installation).
How/where do I get the latest version of the QtQuick2 libraries and make them
accessible to QtCreator?
What is the latest version of QtQuick2?
Change import QtQuick 2.12 to import QtQuick 2.14.
TL; DR;
Before responding you should know the following:
If you have Qt 5.14 then you must have the most up-to-date components of Qt (stable version).
When you create your project Qt Creator will choose the version of the components depending on the configuration you set in the wizard, but you can change it manually: import QtQuick 2.14.
As the last stable version points out is Qt 5.14 that contains all the most up-to-date stable components, if you want to use the components of a developing version such as Qt 5.15 then you must download the source code and compile it which can be complicated if you are a beginner.

How to build shared libraries of qwt - how to prevent qmake from linking to QtCore and QtGui

I have the source code of qwt and while making shared libraries of qwt , I want to prevent qmake from linking to QtCore and QtGui
Looking forward to guidance
You can't. qwt uses Qt, so there's no way to build it as a shared library without linking it to QtCore/QtGui. To import Qt's symbols, it has to be linked to QtCore/QtGui import libraries - that's how qmake sets it up. Otherwise, the linker would have to emit a qwt library with a whole bunch of unresolved symbols, and it simply wouldn't work - it'd crash on the first reference to a Qt symbol, given that said symbol would have an address of zero.
To build it without linking it to Qt it has to be built as a static library. It will be then linked to Qt when the executable is linked.

Qt 5.5: module "QtAudioEngine" is not installed

I'm running the official Qt 5.5 SDK on Ubuntu 15.10 and trying to play 3D sounds in QML:
import QtAudioEngine 1.0
The project file:
qt += multimedia
The import statement results in qrc:///Main.qml:1:1: module "QtAudioEngine" is not installed. I'm a bit confused as I can see that the needed libs are in the SDK. What might be wrong here?
It's a bug in the official Qt SDK : https://bugreports.qt.io/browse/QTBUG-51567

Resources