Difference with QFileDialog between static and dynamic build on Xubuntu
-
I have a class that looks like the following:
class TestSaveDialog : public QWidget { Q_OBJECT QML_ELEMENT public: Q_INVOKABLE void openFile() { QString filename = QFileDialog::getSaveFileName( this, "Save configuration", "/home", "Conf files (*.conf)"); if( !filename.isNull() ) { qDebug() << "selected file path : " << filename.toUtf8(); } } };
I have Qt 6.5.2 built from source as both a static and dynamic library. When I build my application against the dynamic library and call openFile of my class I get a GTK3 type save dialog which is what I would like. When I build against the static library I get the more old school looking GTK2 type save dialog. Any thoughts on how to get the GTK3 type save dialog when building against the static library?
-
I have a class that looks like the following:
class TestSaveDialog : public QWidget { Q_OBJECT QML_ELEMENT public: Q_INVOKABLE void openFile() { QString filename = QFileDialog::getSaveFileName( this, "Save configuration", "/home", "Conf files (*.conf)"); if( !filename.isNull() ) { qDebug() << "selected file path : " << filename.toUtf8(); } } };
I have Qt 6.5.2 built from source as both a static and dynamic library. When I build my application against the dynamic library and call openFile of my class I get a GTK3 type save dialog which is what I would like. When I build against the static library I get the more old school looking GTK2 type save dialog. Any thoughts on how to get the GTK3 type save dialog when building against the static library?
For anyone else encountering this issue, what was required in the CMakeLists.txt was
qt_import_plugins(application-gui INCLUDE Qt::QGtk3ThemePlugin)
as well as making sure the following packages were installed when building the static libraries and making sure to do a completely clean build after installing them.
sudo apt-get install libgtk-3-dev libglib2.0-dev
-