diff options
author | David Robillard <d@drobilla.net> | 2024-07-12 13:27:57 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-07-12 13:28:04 -0400 |
commit | fa2b39f0338f6ae42b35ae736abeefec5d2185ab (patch) | |
tree | 03fb24ffe1bca324e0a228bfaa22c8ebbd68ef3e /src/jalv_qt.cpp | |
parent | 06ee7893d5f6b97a76769d2ba597e989b4c587e7 (diff) | |
download | jalv-fa2b39f0338f6ae42b35ae736abeefec5d2185ab.tar.gz jalv-fa2b39f0338f6ae42b35ae736abeefec5d2185ab.tar.bz2 jalv-fa2b39f0338f6ae42b35ae736abeefec5d2185ab.zip |
Add Qt6 version
Diffstat (limited to 'src/jalv_qt.cpp')
-rw-r--r-- | src/jalv_qt.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/jalv_qt.cpp b/src/jalv_qt.cpp index 20f9de6..54af169 100644 --- a/src/jalv_qt.cpp +++ b/src/jalv_qt.cpp @@ -25,6 +25,7 @@ #include <QLayoutItem> #include <QList> #include <QMainWindow> +#include <QMargins> #include <QMenu> #include <QMenuBar> #include <QObject> @@ -40,6 +41,7 @@ #include <QVBoxLayout> #include <QWidget> #include <QtCore> +#include <QtGlobal> #include <algorithm> #include <cmath> @@ -200,7 +202,8 @@ FlowLayout::minimumSize() const size = size.expandedTo(item->minimumSize()); } - return size + QSize(2 * margin(), 2 * margin()); + const auto m = contentsMargins(); + return size + QSize{m.left() + m.right(), m.top() + m.bottom()}; } int @@ -285,7 +288,11 @@ jalv_frontend_init(int* argc, char*** argv, JalvOptions*) const char* jalv_frontend_ui_type(void) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) return "http://lv2plug.in/ns/extensions/ui#Qt5UI"; +#else + return "http://lv2plug.in/ns/extensions/ui#Qt6UI"; +#endif } void |