aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-07-12 13:27:57 -0400
committerDavid Robillard <d@drobilla.net>2024-07-12 13:28:04 -0400
commitfa2b39f0338f6ae42b35ae736abeefec5d2185ab (patch)
tree03fb24ffe1bca324e0a228bfaa22c8ebbd68ef3e /src
parent06ee7893d5f6b97a76769d2ba597e989b4c587e7 (diff)
downloadjalv-fa2b39f0338f6ae42b35ae736abeefec5d2185ab.tar.gz
jalv-fa2b39f0338f6ae42b35ae736abeefec5d2185ab.tar.bz2
jalv-fa2b39f0338f6ae42b35ae736abeefec5d2185ab.zip
Add Qt6 version
Diffstat (limited to 'src')
-rw-r--r--src/jalv_qt.cpp9
-rw-r--r--src/jalv_qt.hpp1
2 files changed, 9 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
diff --git a/src/jalv_qt.hpp b/src/jalv_qt.hpp
index d371098..ea08bbf 100644
--- a/src/jalv_qt.hpp
+++ b/src/jalv_qt.hpp
@@ -8,6 +8,7 @@
#include <QAction>
#include <QGroupBox>
+#include <QObject>
#include <QString>
#include <QtCore>