aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-09-12 16:03:03 +0000
committerDavid Robillard <d@drobilla.net>2015-09-12 16:03:03 +0000
commit98703d8c9944016b90f673cf00521125ada5a4c8 (patch)
treed8ccc7382f982d6b062a457c4ca6dd03f2befb2b
parentef6f6a6718b7b1e9a326b75ad6e4069274a4314f (diff)
downloadjalv-98703d8c9944016b90f673cf00521125ada5a4c8.tar.gz
jalv-98703d8c9944016b90f673cf00521125ada5a4c8.tar.bz2
jalv-98703d8c9944016b90f673cf00521125ada5a4c8.zip
Add Qt5 version.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@5726 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--NEWS3
-rw-r--r--src/jalv_qt.cpp (renamed from src/jalv_qt4.cpp)33
-rw-r--r--wscript45
3 files changed, 67 insertions, 14 deletions
diff --git a/NEWS b/NEWS
index ea12df5..76481e1 100644
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,9 @@ jalv (1.4.7) unstable;
* Exit GUI versions on interrupt
* Fix semaphore correctness issues
* Use moc-qt4 if present for systems with multiple Qt versions
+ * Add Qt5 version
- -- David Robillard <d@drobilla.net> Tue, 07 Apr 2015 17:30:32 -0400
+ -- David Robillard <d@drobilla.net> Sat, 12 Sep 2015 12:02:48 -0400
jalv (1.4.6) stable;
diff --git a/src/jalv_qt4.cpp b/src/jalv_qt.cpp
index 38dc3cf..88a024d 100644
--- a/src/jalv_qt4.cpp
+++ b/src/jalv_qt.cpp
@@ -22,7 +22,26 @@
#include "lv2/lv2plug.in/ns/ext/patch/patch.h"
#include "lv2/lv2plug.in/ns/ext/port-props/port-props.h"
-#include <QtGui>
+#include <qglobal.h>
+
+#if QT_VERSION >= 0x050000
+# include <QAction>
+# include <QApplication>
+# include <QDial>
+# include <QGroupBox>
+# include <QLabel>
+# include <QLayout>
+# include <QMainWindow>
+# include <QMenu>
+# include <QMenuBar>
+# include <QScrollArea>
+# include <QStyle>
+# include <QTimer>
+# include <QWidget>
+# include <QWindow>
+#else
+# include <QtGui>
+#endif
#define CONTROL_WIDTH 150
#define DIAL_STEPS 10000
@@ -296,7 +315,11 @@ private:
std::map<float, const char*> scaleMap;
};
-#include "jalv_qt4_meta.hpp"
+#if QT_VERSION >= 0x050000
+# include "jalv_qt5_meta.hpp"
+#else
+# include "jalv_qt4_meta.hpp"
+#endif
extern "C" {
@@ -312,7 +335,11 @@ jalv_init(int* argc, char*** argv, JalvOptions* opts)
const char*
jalv_native_ui_type(Jalv* jalv)
{
+#if QT_VERSION >= 0x050000
+ return "http://lv2plug.in/ns/extensions/ui#Qt5UI";
+#else
return "http://lv2plug.in/ns/extensions/ui#Qt4UI";
+#endif
}
int
@@ -658,7 +685,7 @@ jalv_open_ui(Jalv* jalv)
quit_action->setShortcuts(QKeySequence::Quit);
quit_action->setStatusTip("Quit Jalv");
file_menu->addAction(quit_action);
- jalv->has_ui = TRUE;
+ jalv->has_ui = true;
jalv_load_presets(jalv, add_preset_to_menu, presets_menu);
diff --git a/wscript b/wscript
index 0fbe94a..5b715c0 100644
--- a/wscript
+++ b/wscript
@@ -24,6 +24,10 @@ def options(opt):
opt.add_option('--no-qt', action='store_true', default=False,
dest='no_qt',
help="Do not build Qt GUI")
+ opt.add_option('--no-qt4', action='store_true', dest='no_qt4',
+ help='Do not build support for Qt4')
+ opt.add_option('--no-qt5', action='store_true', dest='no_qt5',
+ help='Do not build support for Qt5')
def configure(conf):
conf.line_just = 52
@@ -53,11 +57,17 @@ def configure(conf):
autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM2',
atleast_version='2.20.0', mandatory=False)
if not Options.options.no_qt:
- autowaf.check_pkg(conf, 'QtGui', uselib_store='QT4',
- atleast_version='4.0.0', mandatory=False)
- if conf.env.HAVE_QT4:
- if not conf.find_program('moc-qt4', var='MOC', mandatory=False):
- conf.find_program('moc')
+ if not Options.options.no_qt4:
+ autowaf.check_pkg(conf, 'QtGui', uselib_store='QT4',
+ atleast_version='4.0.0', mandatory=False)
+ if conf.env.HAVE_QT4:
+ if not conf.find_program('moc-qt4', var='MOC4', mandatory=False):
+ conf.find_program('moc', var='MOC4')
+
+ if not Options.options.no_qt5:
+ autowaf.check_pkg(conf, 'Qt5Widgets', uselib_store='QT5',
+ atleast_version='5.1.0', mandatory=False)
+ conf.find_program('moc', var='MOC5')
conf.check(function_name='jack_port_type_get_buffer_size',
header_name='jack/jack.h',
@@ -84,6 +94,7 @@ def configure(conf):
autowaf.display_msg(conf, "Gtk 3.0 support", bool(conf.env.HAVE_GTK3))
autowaf.display_msg(conf, "Gtkmm 2.0 support", bool(conf.env.HAVE_GTKMM2))
autowaf.display_msg(conf, "Qt 4.0 support", bool(conf.env.HAVE_QT4))
+ autowaf.display_msg(conf, "Qt 5.0 support", bool(conf.env.HAVE_QT5))
print('')
def build(bld):
@@ -130,19 +141,33 @@ def build(bld):
install_path = '${BINDIR}')
autowaf.use_lib(bld, obj, libs + ' GTKMM2')
- # Qt version
+ # Qt4 version
if bld.env.HAVE_QT4:
- obj = bld(rule = '${MOC} ${SRC} > ${TGT}',
- source = 'src/jalv_qt4.cpp',
+ obj = bld(rule = '${MOC4} ${SRC} > ${TGT}',
+ source = 'src/jalv_qt.cpp',
target = 'jalv_qt4_meta.hpp')
obj = bld(features = 'c cxx cxxprogram',
- source = source + ' src/jalv_qt4.cpp',
- target = 'jalv.qt',
+ source = source + ' src/jalv_qt.cpp',
+ target = 'jalv.qt4',
includes = ['.', 'src'],
lib = ['pthread'],
install_path = '${BINDIR}')
autowaf.use_lib(bld, obj, libs + ' QT4')
+ # Qt5 version
+ if bld.env.HAVE_QT5:
+ obj = bld(rule = '${MOC5} ${SRC} > ${TGT}',
+ source = 'src/jalv_qt.cpp',
+ target = 'jalv_qt5_meta.hpp')
+ obj = bld(features = 'c cxx cxxprogram',
+ source = source + ' src/jalv_qt.cpp',
+ target = 'jalv.qt5',
+ includes = ['.', 'src'],
+ lib = ['pthread'],
+ install_path = '${BINDIR}',
+ cxxflags = ['-fPIC'])
+ autowaf.use_lib(bld, obj, libs + ' QT5')
+
# Man pages
bld.install_files('${MANDIR}/man1', bld.path.ant_glob('doc/*.1'))