Commit 12eff4a0 authored by jcfr's avatar jcfr

ENH: Add preliminary support for Qt5

Support configuration using either Qt4 or Qt5

Based on preliminary work from Steve Pieper <pieper@bwh.harvard.edu>

* vtkSlicerConfigure: Introduced Slicer_HAVE_QT5 and Slicer_HAVE_WEBKIT_SUPPORT.
  This was needed to workaround limitation of "moc" compiler preventing it
  from expanding macro like "QT_VERSION_CHECK.

* Explicitly set QT_PLUGINS_DIR and QT_BINARY_DIR variables when using Qt5

* Update extension build system to propagate Qt version

Tested with Qt 5.7 and Qt 5.9 on Ubuntu

Remaining tasks:
* Port extension manager
* Update install/packaging rules to support Qt5
* SlicerStyle (based on CommonStyle) is disabled (see Main.cxx). Application crashes on Linux.
* Fix runtime errors:
 * libpng warning: iCCP: known incorrect sRGB profile
 * QPixmap::grabWidget is deprecated, use QWidget::grab() instead
Co-authored-by: default avatarHina Shah <hina.shah@kitware.com>
Co-authored-by: Max Smolens's avatarMax Smolens <max.smolens@kitware.com>

COMP adding qt5 variables for extension testing

COMP Adding Qt5 build and plugin cmake variables

From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@26251 3bd1e089-480b-0410-8dfb-8563597acbee
parent d4b5c756
...@@ -120,7 +120,9 @@ int SlicerAppMain(int argc, char* argv[]) ...@@ -120,7 +120,9 @@ int SlicerAppMain(int argc, char* argv[])
QCoreApplication::setApplicationVersion(Slicer_VERSION_FULL); QCoreApplication::setApplicationVersion(Slicer_VERSION_FULL);
//vtkObject::SetGlobalWarningDisplay(false); //vtkObject::SetGlobalWarningDisplay(false);
QApplication::setDesktopSettingsAware(false); QApplication::setDesktopSettingsAware(false);
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
QApplication::setStyle(new qSlicerStyle()); QApplication::setStyle(new qSlicerStyle());
#endif
qSlicerApplication app(argc, argv); qSlicerApplication app(argc, argv);
if (app.returnCode() != -1) if (app.returnCode() != -1)
......
...@@ -21,7 +21,6 @@ set(${KIT}_SRCS ...@@ -21,7 +21,6 @@ set(${KIT}_SRCS
# Headers that should run through moc # Headers that should run through moc
set(${KIT}_MOC_SRCS set(${KIT}_MOC_SRCS
qSlicerQTCLIAbstractPlugin.h
qSlicerQTCLIPlugins.h qSlicerQTCLIPlugins.h
qSlicerCLIProgressBarPlugin.h qSlicerCLIProgressBarPlugin.h
) )
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
qSlicerCLIProgressBarPlugin::qSlicerCLIProgressBarPlugin(QObject* parent) qSlicerCLIProgressBarPlugin::qSlicerCLIProgressBarPlugin(QObject* parent)
: qSlicerQTCLIAbstractPlugin(parent) : QObject(parent)
{ {
} }
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
#include "qSlicerQTCLIAbstractPlugin.h" #include "qSlicerQTCLIAbstractPlugin.h"
class Q_SLICER_BASE_QTCLI_PLUGINS_EXPORT qSlicerCLIProgressBarPlugin class Q_SLICER_BASE_QTCLI_PLUGINS_EXPORT qSlicerCLIProgressBarPlugin
: public qSlicerQTCLIAbstractPlugin : public QObject,
public qSlicerQTCLIAbstractPlugin
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
#include "qSlicerQTCLIAbstractPlugin.h" #include "qSlicerQTCLIAbstractPlugin.h"
qSlicerQTCLIAbstractPlugin::qSlicerQTCLIAbstractPlugin(QObject* parent) qSlicerQTCLIAbstractPlugin::qSlicerQTCLIAbstractPlugin()
: QObject(parent)
{ {
} }
......
...@@ -22,21 +22,26 @@ ...@@ -22,21 +22,26 @@
#define __qSlicerQTCLIAbstractPlugin_h #define __qSlicerQTCLIAbstractPlugin_h
// QT includes // QT includes
#include <QtGlobal>
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#include <QDesignerCustomWidgetInterface> #include <QDesignerCustomWidgetInterface>
#include <QObject> #else
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
#endif
// QTCLI includes // QTCLI includes
#include "qSlicerBaseQTCLIPluginsExport.h" #include "qSlicerBaseQTCLIPluginsExport.h"
class Q_SLICER_BASE_QTCLI_PLUGINS_EXPORT qSlicerQTCLIAbstractPlugin class Q_SLICER_BASE_QTCLI_PLUGINS_EXPORT qSlicerQTCLIAbstractPlugin
: public QObject : public QDesignerCustomWidgetInterface
, public QDesignerCustomWidgetInterface
{ {
Q_OBJECT #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface")
#endif
Q_INTERFACES(QDesignerCustomWidgetInterface); Q_INTERFACES(QDesignerCustomWidgetInterface);
public: public:
qSlicerQTCLIAbstractPlugin(QObject* parent = 0); qSlicerQTCLIAbstractPlugin();
// Don't reimplement this method. // Don't reimplement this method.
QString group() const; QString group() const;
// You can reimplement these methods // You can reimplement these methods
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
#include "qSlicerQTCLIPlugins.h" #include "qSlicerQTCLIPlugins.h"
#include <QtPlugin> #include <QtGlobal>
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#include <QtPlugin>
Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerQTCLIPlugins); Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerQTCLIPlugins);
#endif
...@@ -21,8 +21,14 @@ ...@@ -21,8 +21,14 @@
#ifndef __qSlicerQTCLIPlugins_h #ifndef __qSlicerQTCLIPlugins_h
#define __qSlicerQTCLIPlugins_h #define __qSlicerQTCLIPlugins_h
// QT includes #include "vtkSlicerConfigure.h" // For Slicer_HAVE_QT5
// Qt includes
#ifdef Slicer_HAVE_QT5
#include <QtUiPlugin/QDesignerCustomWidgetCollectionInterface>
#else
#include <QDesignerCustomWidgetCollectionInterface> #include <QDesignerCustomWidgetCollectionInterface>
#endif
// QtCLI includes // QtCLI includes
#include "qSlicerCLIProgressBarPlugin.h" #include "qSlicerCLIProgressBarPlugin.h"
...@@ -33,6 +39,9 @@ class Q_SLICER_BASE_QTCLI_PLUGINS_EXPORT qSlicerQTCLIPlugins ...@@ -33,6 +39,9 @@ class Q_SLICER_BASE_QTCLI_PLUGINS_EXPORT qSlicerQTCLIPlugins
, public QDesignerCustomWidgetCollectionInterface , public QDesignerCustomWidgetCollectionInterface
{ {
Q_OBJECT Q_OBJECT
#ifdef Slicer_HAVE_QT5
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface")
#endif
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface); Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);
public: public:
......
...@@ -206,8 +206,8 @@ bool qSlicerCLILoadableModuleFactoryItem::updateLogo(qSlicerCLILoadableModuleFac ...@@ -206,8 +206,8 @@ bool qSlicerCLILoadableModuleFactoryItem::updateLogo(qSlicerCLILoadableModuleFac
int pixelSize = 0; int pixelSize = 0;
unsigned long bufferLength = 0; unsigned long bufferLength = 0;
void * resolvedGetModuleLogoSymbol = item->symbolAddress("GetModuleLogo"); SymbolAddressType resolvedGetModuleLogoSymbol = item->symbolAddress("GetModuleLogo");
void * resolvedModuleLogoImageSymbol = item->symbolAddress("ModuleLogoImage"); SymbolAddressType resolvedModuleLogoImageSymbol = item->symbolAddress("ModuleLogoImage");
if(resolvedGetModuleLogoSymbol) if(resolvedGetModuleLogoSymbol)
{ {
...@@ -223,10 +223,10 @@ bool qSlicerCLILoadableModuleFactoryItem::updateLogo(qSlicerCLILoadableModuleFac ...@@ -223,10 +223,10 @@ bool qSlicerCLILoadableModuleFactoryItem::updateLogo(qSlicerCLILoadableModuleFac
QStringList expectedSymbols; QStringList expectedSymbols;
expectedSymbols << "ModuleLogoWidth" << "ModuleLogoHeight" expectedSymbols << "ModuleLogoWidth" << "ModuleLogoHeight"
<< "ModuleLogoPixelSize" << "ModuleLogoLength"; << "ModuleLogoPixelSize" << "ModuleLogoLength";
QList<void*> resolvedSymbols; QList<SymbolAddressType> resolvedSymbols;
foreach(const QString& symbol, expectedSymbols) foreach(const QString& symbol, expectedSymbols)
{ {
void * resolvedSymbol = item->symbolAddress(symbol); SymbolAddressType resolvedSymbol = item->symbolAddress(symbol);
if (resolvedSymbol) if (resolvedSymbol)
{ {
resolvedSymbols << resolvedSymbol; resolvedSymbols << resolvedSymbol;
......
...@@ -34,30 +34,32 @@ if(BUILD_TESTING) ...@@ -34,30 +34,32 @@ if(BUILD_TESTING)
EXTRA_INCLUDE vtkMRMLDebugLeaksMacro.h EXTRA_INCLUDE vtkMRMLDebugLeaksMacro.h
) )
QT4_GENERATE_MOCS( set(KIT_TEST_GENERATE_MOC_SRCS
qSlicerSslTest.cxx qSlicerSslTest.cxx
) )
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT) if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
QT4_GENERATE_MOCS( list(APPEND KIT_TEST_GENERATE_MOC_SRCS
qSlicerExtensionsManagerModelTest.cxx qSlicerExtensionsManagerModelTest.cxx
qSlicerPersistentCookieJarTest.cxx qSlicerPersistentCookieJarTest.cxx
) )
endif() endif()
if(Slicer_USE_PYTHONQT) if(Slicer_USE_PYTHONQT)
QT4_GENERATE_MOCS( list(APPEND KIT_TEST_GENERATE_MOC_SRCS
qSlicerCorePythonManagerWithoutApplicationTest.cxx qSlicerCorePythonManagerWithoutApplicationTest.cxx
) )
endif() endif()
QT4_ADD_RESOURCES(Tests Resources/${KIT}Testing.qrc)
set(KIT_TEST_TARGET_LIBRARIES ${KIT}) set(KIT_TEST_TARGET_LIBRARIES ${KIT})
if(CTK_QT_VERSION VERSION_GREATER "4") if(CTK_QT_VERSION VERSION_LESS "5")
list(APPEND KIT_TEST_TARGET_LIBRARIES Qt5::Test) QT4_GENERATE_MOCS(${KIT_TEST_GENERATE_MOC_SRCS})
else() QT4_ADD_RESOURCES(Tests Resources/${KIT}Testing.qrc)
list(APPEND KIT_TEST_TARGET_LIBRARIES Qt4::QtTest) list(APPEND KIT_TEST_TARGET_LIBRARIES Qt4::QtTest)
else()
QT5_GENERATE_MOCS(${KIT_TEST_GENERATE_MOC_SRCS})
QT5_ADD_RESOURCES(Tests Resources/${KIT}Testing.qrc)
list(APPEND KIT_TEST_TARGET_LIBRARIES Qt5::Test)
endif() endif()
if(Slicer_USE_PYTHONQT) if(Slicer_USE_PYTHONQT)
......
...@@ -23,7 +23,9 @@ private slots: ...@@ -23,7 +23,9 @@ private slots:
void testHttpsConnection_data(); void testHttpsConnection_data();
}; };
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
Q_DECLARE_METATYPE(QNetworkReply::NetworkError) Q_DECLARE_METATYPE(QNetworkReply::NetworkError)
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void qSlicerSslTester::testSupportsSsl() void qSlicerSslTester::testSupportsSsl()
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
// Qt includes // Qt includes
#include <QDebug> #include <QDebug>
#include <QDesktopServices>
#include <QDir> #include <QDir>
#include <QLocale> #include <QLocale>
#include <QMessageBox> #include <QMessageBox>
...@@ -33,6 +32,12 @@ ...@@ -33,6 +32,12 @@
#include <QSettings> #include <QSettings>
#include <QTranslator> #include <QTranslator>
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#include <QDesktopServices>
#else
#include <QStandardPaths>
#endif
// For: // For:
// - Slicer_QTLOADABLEMODULES_LIB_DIR // - Slicer_QTLOADABLEMODULES_LIB_DIR
// - Slicer_CLIMODULES_BIN_DIR // - Slicer_CLIMODULES_BIN_DIR
...@@ -1026,7 +1031,14 @@ QString qSlicerCoreApplication::defaultScenePath() const ...@@ -1026,7 +1031,14 @@ QString qSlicerCoreApplication::defaultScenePath() const
{ {
QSettings* appSettings = this->userSettings(); QSettings* appSettings = this->userSettings();
Q_ASSERT(appSettings); Q_ASSERT(appSettings);
QString defaultScenePath = appSettings->value("DefaultScenePath", QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).toString(); #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
QString defaultScenePath = appSettings->value(
"DefaultScenePath", QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).toString();
#else
QString defaultScenePath = appSettings->value(
"DefaultScenePath", QStandardPaths::DocumentsLocation).toString();
#endif
return defaultScenePath; return defaultScenePath;
} }
......
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
#include <QTemporaryFile> #include <QTemporaryFile>
#include <QTextStream> #include <QTextStream>
#include <QUrl> #include <QUrl>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
#include <QUrlQuery>
#endif
// CTK includes // CTK includes
#include <ctkScopedCurrentDir.h> #include <ctkScopedCurrentDir.h>
...@@ -76,10 +79,18 @@ struct UpdateDownloadInformation ...@@ -76,10 +79,18 @@ struct UpdateDownloadInformation
class QStandardItemModelWithRole : public QStandardItemModel class QStandardItemModelWithRole : public QStandardItemModel
{ {
public: public:
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
void setRoleNames(const QHash<int,QByteArray> &roleNames) void setRoleNames(const QHash<int,QByteArray> &roleNames)
{ {
this->QStandardItemModel::setRoleNames(roleNames); this->QStandardItemModel::setRoleNames(roleNames);
} }
#else
QHash<int, QByteArray> roleNames() const
{
return this->CustomRoleNames;
}
QHash<int,QByteArray> CustomRoleNames;
#endif
}; };
} // end of anonymous namespace } // end of anonymous namespace
...@@ -281,7 +292,15 @@ void qSlicerExtensionsManagerModelPrivate::init() ...@@ -281,7 +292,15 @@ void qSlicerExtensionsManagerModelPrivate::init()
roleNames[Qt::UserRole + 1 + columnIdx] = columnName.toLatin1(); roleNames[Qt::UserRole + 1 + columnIdx] = columnName.toLatin1();
++columnIdx; ++columnIdx;
} }
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
//
// See QStandardItemModelWithRole::roleNames() for Qt5 implementation
//
this->Model.setRoleNames(roleNames); this->Model.setRoleNames(roleNames);
#else
this->Model.CustomRoleNames = roleNames;
#endif
QObject::connect(q, SIGNAL(slicerRequirementsChanged(QString,QString,QString)), QObject::connect(q, SIGNAL(slicerRequirementsChanged(QString,QString,QString)),
q, SLOT(identifyIncompatibleExtensions())); q, SLOT(identifyIncompatibleExtensions()));
...@@ -1123,8 +1142,15 @@ qSlicerExtensionsManagerModelPrivate::downloadExtension( ...@@ -1123,8 +1142,15 @@ qSlicerExtensionsManagerModelPrivate::downloadExtension(
this->debug(QString("Downloading extension [ itemId: %1]").arg(itemId)); this->debug(QString("Downloading extension [ itemId: %1]").arg(itemId));
QUrl downloadUrl(q->serverUrl()); QUrl downloadUrl(q->serverUrl());
downloadUrl.setPath(downloadUrl.path() + "/download"); downloadUrl.setPath(downloadUrl.path() + "/download");
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
downloadUrl.setQueryItems( downloadUrl.setQueryItems(
QList<QPair<QString, QString> >() << QPair<QString, QString>("items", itemId)); QList<QPair<QString, QString> >() << QPair<QString, QString>("items", itemId));
#else
QUrlQuery urlQuery;
urlQuery.setQueryItems(
QList<QPair<QString, QString> >() << QPair<QString, QString>("items", itemId));
downloadUrl.setQuery(urlQuery);
#endif
QNetworkReply* const reply = QNetworkReply* const reply =
this->NetworkManager.get(QNetworkRequest(downloadUrl)); this->NetworkManager.get(QNetworkRequest(downloadUrl));
...@@ -1170,7 +1196,11 @@ void qSlicerExtensionsManagerModel::onInstallDownloadFinished( ...@@ -1170,7 +1196,11 @@ void qSlicerExtensionsManagerModel::onInstallDownloadFinished(
QNetworkReply* const reply = task->reply(); QNetworkReply* const reply = task->reply();
QUrl downloadUrl = reply->url(); QUrl downloadUrl = reply->url();
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
Q_ASSERT(downloadUrl.hasQueryItem("items")); Q_ASSERT(downloadUrl.hasQueryItem("items"));
#else
Q_ASSERT(QUrlQuery(downloadUrl).hasQueryItem("items"));
#endif
emit this->downloadFinished(reply); emit this->downloadFinished(reply);
...@@ -1580,7 +1610,11 @@ void qSlicerExtensionsManagerModel::onUpdateDownloadFinished( ...@@ -1580,7 +1610,11 @@ void qSlicerExtensionsManagerModel::onUpdateDownloadFinished(
// Get network reply // Get network reply
QNetworkReply* const reply = task->reply(); QNetworkReply* const reply = task->reply();
QUrl downloadUrl = reply->url(); QUrl downloadUrl = reply->url();
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
Q_ASSERT(downloadUrl.hasQueryItem("items")); Q_ASSERT(downloadUrl.hasQueryItem("items"));
#else
Q_ASSERT(QUrlQuery(downloadUrl).hasQueryItem("items"));
#endif
// Notify observers of event // Notify observers of event
emit this->downloadFinished(reply); emit this->downloadFinished(reply);
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <QDir> #include <QDir>
#include <QFileInfo> #include <QFileInfo>
#include <QFileInfo> #include <QFileInfo>
#include <QNetworkCookie>
#include <QSettings> #include <QSettings>
#include <QStringList> #include <QStringList>
......
...@@ -31,7 +31,6 @@ set(${KIT}_SRCS ...@@ -31,7 +31,6 @@ set(${KIT}_SRCS
set(${KIT}_MOC_SRCS set(${KIT}_MOC_SRCS
qSlicerQTGUIPlugins.h qSlicerQTGUIPlugins.h
qSlicerQTGUIAbstractPlugin.h
qSlicerDirectoryListViewPlugin.h qSlicerDirectoryListViewPlugin.h
qSlicerModulePanelPlugin.h qSlicerModulePanelPlugin.h
qSlicerModulesListViewPlugin.h qSlicerModulesListViewPlugin.h
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "qSlicerDirectoryListView.h" #include "qSlicerDirectoryListView.h"
qSlicerDirectoryListViewPlugin::qSlicerDirectoryListViewPlugin(QObject* parent) qSlicerDirectoryListViewPlugin::qSlicerDirectoryListViewPlugin(QObject* parent)
: qSlicerQTGUIAbstractPlugin(parent) : QObject(parent)
{ {
} }
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
#include "qSlicerQTGUIAbstractPlugin.h" #include "qSlicerQTGUIAbstractPlugin.h"
class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerDirectoryListViewPlugin class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerDirectoryListViewPlugin
: public qSlicerQTGUIAbstractPlugin : public QObject,
public qSlicerQTGUIAbstractPlugin
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "qSlicerModulePanel.h" #include "qSlicerModulePanel.h"
qSlicerModulePanelPlugin::qSlicerModulePanelPlugin(QObject* parent) qSlicerModulePanelPlugin::qSlicerModulePanelPlugin(QObject* parent)
: qSlicerQTGUIAbstractPlugin(parent) : QObject(parent)
{ {
} }
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
#include "qSlicerQTGUIAbstractPlugin.h" #include "qSlicerQTGUIAbstractPlugin.h"
class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerModulePanelPlugin class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerModulePanelPlugin
: public qSlicerQTGUIAbstractPlugin : public QObject,
public qSlicerQTGUIAbstractPlugin
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "qSlicerModulesListView.h" #include "qSlicerModulesListView.h"
qSlicerModulesListViewPlugin::qSlicerModulesListViewPlugin(QObject* parent) qSlicerModulesListViewPlugin::qSlicerModulesListViewPlugin(QObject* parent)
: qSlicerQTGUIAbstractPlugin(parent) : QObject(parent)
{ {
} }
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
#include "qSlicerQTGUIAbstractPlugin.h" #include "qSlicerQTGUIAbstractPlugin.h"
class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerModulesListViewPlugin class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerModulesListViewPlugin
: public qSlicerQTGUIAbstractPlugin : public QObject,
public qSlicerQTGUIAbstractPlugin
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "qSlicerMouseModeToolBar.h" #include "qSlicerMouseModeToolBar.h"
qSlicerMouseModeToolBarPlugin::qSlicerMouseModeToolBarPlugin(QObject* parent) qSlicerMouseModeToolBarPlugin::qSlicerMouseModeToolBarPlugin(QObject* parent)
: qSlicerQTGUIAbstractPlugin(parent) : QObject(parent)
{ {
} }
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
#include "qSlicerQTGUIAbstractPlugin.h" #include "qSlicerQTGUIAbstractPlugin.h"
class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerMouseModeToolBarPlugin class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerMouseModeToolBarPlugin
: public qSlicerQTGUIAbstractPlugin : public QObject,
public qSlicerQTGUIAbstractPlugin
{ {
Q_OBJECT Q_OBJECT
public: public:
......
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
#include "qSlicerQTGUIAbstractPlugin.h" #include "qSlicerQTGUIAbstractPlugin.h"
qSlicerQTGUIAbstractPlugin::qSlicerQTGUIAbstractPlugin(QObject* parent) qSlicerQTGUIAbstractPlugin::qSlicerQTGUIAbstractPlugin()
: QObject(parent)
{ {
} }
......
...@@ -22,21 +22,26 @@ ...@@ -22,21 +22,26 @@
#define __qSlicerQTGUIAbstractPlugin_h #define __qSlicerQTGUIAbstractPlugin_h
// QT includes // QT includes
#include <QtGlobal>
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#include <QDesignerCustomWidgetInterface> #include <QDesignerCustomWidgetInterface>
#include <QObject> #else
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
#endif
// QTGUI includes // QTGUI includes
#include "qSlicerBaseQTGUIDesignerPluginsExport.h" #include "qSlicerBaseQTGUIDesignerPluginsExport.h"
class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerQTGUIAbstractPlugin class Q_SLICER_DESIGNER_PLUGINS_EXPORT qSlicerQTGUIAbstractPlugin
: public QObject : public QDesignerCustomWidgetInterface
, public QDesignerCustomWidgetInterface