From ef81ffc4d946f4860ceb4b2fa141018315d1bfbc Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 18 Sep 2014 19:39:53 +0200 Subject: [PATCH] Qt5 build fixes --HG-- branch : qt5 --- code/CMakeLists.txt | 2 + code/CMakeModules/nel.cmake | 4 +- .../3rdparty/qtpropertybrowser/CMakeLists.txt | 93 +- .../qtbuttonpropertybrowser.cpp | 14 +- .../qtpropertybrowser/qteditorfactory.cpp | 40 +- .../qtgroupboxpropertybrowser.cpp | 12 +- .../qtpropertybrowser/qtpropertybrowser.cpp | 6 +- .../qtpropertybrowser/qtpropertybrowser.h | 4 +- .../qtpropertybrowserutils.cpp | 58 +- .../qtpropertybrowserutils_p.h | 8 +- .../qtpropertybrowser/qtpropertymanager.cpp | 24 +- .../qttreepropertybrowser.cpp | 26 +- .../qtpropertybrowser/qtvariantproperty.cpp | 936 ++++++++---------- .../qtpropertybrowser/qtvariantproperty.h | 97 +- code/studio/src/CMakeLists.txt | 54 +- .../src/extension_system/plugin_spec.cpp | 2 +- code/studio/src/main.cpp | 10 +- 17 files changed, 665 insertions(+), 725 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 85a2ad670..8d7d6daf3 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -144,7 +144,9 @@ ENDIF(WITH_QT) IF(WITH_QT5) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR) + FIND_PACKAGE(Qt5Core) FIND_PACKAGE(Qt5Widgets) + FIND_PACKAGE(Qt5LinguistTools) ENDIF(WITH_QT5) IF(WITH_NEL) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 0c13f8cb9..95c0f6460 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -229,9 +229,9 @@ Remove the CMakeCache.txt file and try again from another folder, e.g.: ENDMACRO(CHECK_OUT_OF_SOURCE) MACRO(NL_SETUP_DEFAULT_OPTIONS) - IF(WITH_QT) + IF(WITH_QT OR WITH_QT5) OPTION(WITH_STUDIO "Build Core Studio" OFF ) - ENDIF(WITH_QT) + ENDIF(WITH_QT OR WITH_QT5) ### # Features diff --git a/code/studio/src/3rdparty/qtpropertybrowser/CMakeLists.txt b/code/studio/src/3rdparty/qtpropertybrowser/CMakeLists.txt index fa834dabf..a6fab443d 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/CMakeLists.txt +++ b/code/studio/src/3rdparty/qtpropertybrowser/CMakeLists.txt @@ -1,5 +1,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QT_INCLUDES}) -INCLUDE(${QT_USE_FILE}) + +IF(WITH_QT) + INCLUDE(${QT_USE_FILE}) +ENDIF(WITH_QT) FILE(GLOB SRC *.cpp *.h) @@ -16,34 +19,42 @@ SET(QT_PROPERTY_EDITOR_RCS qtpropertybrowser.qrc) SET(QT_USE_QTGUI TRUE) -QT4_ADD_RESOURCES(QT_PROPERTY_EDITOR_RC_SRCS ${QT_PROPERTY_EDITOR_RCS}) -QT4_WRAP_CPP(QT_PROPERTY_EDITOR_MOC_SRC ${QT_PROPERTY_EDITOR_HDR}) +IF(WITH_QT5) + SET(CMAKE_AUTOMOC ON) + QT5_ADD_RESOURCES(QT_PROPERTY_EDITOR_RC_SRCS ${QT_PROPERTY_EDITOR_RCS}) + #QT5_WRAP_CPP(QT_PROPERTY_EDITOR_MOC_SRC ${QT_PROPERTY_EDITOR_HDR}) +ELSE(WITH_QT5) + QT4_ADD_RESOURCES(QT_PROPERTY_EDITOR_RC_SRCS ${QT_PROPERTY_EDITOR_RCS}) + QT4_WRAP_CPP(QT_PROPERTY_EDITOR_MOC_SRC ${QT_PROPERTY_EDITOR_HDR}) +ENDIF(WITH_QT5) SOURCE_GROUP(QtResources FILES ${QT_PROPERTY_EDITOR_RCS}) SOURCE_GROUP(QtGeneratedMocSrc FILES ${QT_PROPERTY_EDITOR_MOC_SRC}) SOURCE_GROUP("Qt Property Editor Source" FILES ${SRC}) -qt4_generate_moc(qtpropertymanager.cpp ${CMAKE_CURRENT_BINARY_DIR}/qtpropertymanager.moc) -qt4_generate_moc(qteditorfactory.cpp ${CMAKE_CURRENT_BINARY_DIR}/qteditorfactory.moc) -qt4_generate_moc(qttreepropertybrowser.cpp ${CMAKE_CURRENT_BINARY_DIR}/qttreepropertybrowser.moc) - -# Need to remove these so that they are not linked as they are inline included. -LIST(REMOVE_ITEM QT_PROPERTY_EDITOR_MOC_SRC ${CMAKE_CURRENT_BINARY_DIR}/moc_qtbuttonpropertybrowser.cxx - ${CMAKE_CURRENT_BINARY_DIR}/moc_qteditorfactory.cxx - ${CMAKE_CURRENT_BINARY_DIR}/moc_qtgroupboxpropertybrowser.cxx - ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertybrowser.cxx - ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertymanager.cxx - ${CMAKE_CURRENT_BINARY_DIR}/moc_qttreepropertybrowser.cxx - ${CMAKE_CURRENT_BINARY_DIR}/moc_qtvariantproperty.cxx) - -# We need to add new depencencies on removed files because we need them to be still generated -SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtbuttonpropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtbuttonpropertybrowser.cxx) -SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qteditorfactory.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qteditorfactory.cxx) -SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtgroupboxpropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtgroupboxpropertybrowser.cxx) -SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtpropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertybrowser.cxx) -SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtpropertymanager.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertymanager.cxx) -SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qttreepropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qttreepropertybrowser.cxx) -SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtvariantproperty.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtvariantproperty.cxx) +IF(WITH_QT) + qt4_generate_moc(qtpropertymanager.cpp ${CMAKE_CURRENT_BINARY_DIR}/qtpropertymanager.moc) + qt4_generate_moc(qteditorfactory.cpp ${CMAKE_CURRENT_BINARY_DIR}/qteditorfactory.moc) + qt4_generate_moc(qttreepropertybrowser.cpp ${CMAKE_CURRENT_BINARY_DIR}/qttreepropertybrowser.moc) + + # Need to remove these so that they are not linked as they are inline included. + LIST(REMOVE_ITEM QT_PROPERTY_EDITOR_MOC_SRC ${CMAKE_CURRENT_BINARY_DIR}/moc_qtbuttonpropertybrowser.cxx + ${CMAKE_CURRENT_BINARY_DIR}/moc_qteditorfactory.cxx + ${CMAKE_CURRENT_BINARY_DIR}/moc_qtgroupboxpropertybrowser.cxx + ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertybrowser.cxx + ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertymanager.cxx + ${CMAKE_CURRENT_BINARY_DIR}/moc_qttreepropertybrowser.cxx + ${CMAKE_CURRENT_BINARY_DIR}/moc_qtvariantproperty.cxx) + + # We need to add new depencencies on removed files because we need them to be still generated + SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtbuttonpropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtbuttonpropertybrowser.cxx) + SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qteditorfactory.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qteditorfactory.cxx) + SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtgroupboxpropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtgroupboxpropertybrowser.cxx) + SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtpropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertybrowser.cxx) + SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtpropertymanager.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertymanager.cxx) + SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qttreepropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qttreepropertybrowser.cxx) + SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtvariantproperty.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtvariantproperty.cxx) +ENDIF(WITH_QT) #set( # qtpropertyeditor_HEADERS_ONLY_MOC @@ -77,14 +88,32 @@ SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtvariantproperty.cpp APPEND PRO # ${qtpropertyeditor_HEADERS_ONLY_MOC} #) -ADD_LIBRARY(qt_property_browser SHARED ${SRC} - ${QT_PROPERTY_EDITOR_MOC_SRC} - ${QT_PROPERTY_EDITOR_RC_SRCS} - ${CMAKE_CURRENT_BINARY_DIR}/qtpropertymanager.moc - ${CMAKE_CURRENT_BINARY_DIR}/qttreepropertybrowser.moc - ${CMAKE_CURRENT_BINARY_DIR}/qteditorfactory.moc) - -TARGET_LINK_LIBRARIES(qt_property_browser ${QT_LIBRARIES}) +INCLUDE_DIRECTORIES(${QT_INCLUDES}) + +IF(WITH_QT5) + ADD_LIBRARY(qt_property_browser SHARED + ${SRC} + ${QT_PROPERTY_EDITOR_MOC_SRC} + ${QT_PROPERTY_EDITOR_RC_SRCS}) +ELSE(WITH_QT5) + ADD_LIBRARY(qt_property_browser SHARED + ${SRC} + ${QT_PROPERTY_EDITOR_MOC_SRC} + ${QT_PROPERTY_EDITOR_RC_SRCS}) +ENDIF(WITH_QT5) + +IF(WITH_QT) + ADD_LIBRARY(qt_property_browser SHARED + ${CMAKE_CURRENT_BINARY_DIR}/qtpropertymanager.moc + ${CMAKE_CURRENT_BINARY_DIR}/qttreepropertybrowser.moc + ${CMAKE_CURRENT_BINARY_DIR}/qteditorfactory.moc) +ENDIF(WITH_QT) + +IF(WITH_QT5) + TARGET_LINK_LIBRARIES(qt_property_browser Qt5::Widgets) +ELSE(WITH_QT5) + TARGET_LINK_LIBRARIES(qt_property_browser ${QT_LIBRARIES}) +ENDIF(WITH_QT5) ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_DLL) diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.cpp index d5ebd4fc2..89af5d89c 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.cpp +++ b/code/studio/src/3rdparty/qtpropertybrowser/qtbuttonpropertybrowser.cpp @@ -86,13 +86,13 @@ ****************************************************************************/ #include "qtbuttonpropertybrowser.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #if QT_VERSION >= 0x040400 QT_BEGIN_NAMESPACE diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qteditorfactory.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qteditorfactory.cpp index 2c45b77be..295f32a5b 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qteditorfactory.cpp +++ b/code/studio/src/3rdparty/qtpropertybrowser/qteditorfactory.cpp @@ -87,29 +87,29 @@ #include "qteditorfactory.h" #include "qtpropertybrowserutils_p.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #if defined(Q_CC_MSVC) # pragma warning(disable: 4786) /* MS VS 6: truncating debug info after 255 characters */ diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.cpp index d789c8695..21087df10 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.cpp +++ b/code/studio/src/3rdparty/qtpropertybrowser/qtgroupboxpropertybrowser.cpp @@ -86,12 +86,12 @@ ****************************************************************************/ #include "qtgroupboxpropertybrowser.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #if QT_VERSION >= 0x040400 QT_BEGIN_NAMESPACE diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.cpp index 9b7d98b09..269a055d1 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.cpp +++ b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.cpp @@ -86,9 +86,9 @@ ****************************************************************************/ #include "qtpropertybrowser.h" -#include -#include -#include +#include +#include +#include #if defined(Q_CC_MSVC) # pragma warning(disable: 4786) /* MS VS 6: truncating debug info after 255 characters */ diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.h b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.h index 5b63d3917..48ee819d4 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.h +++ b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowser.h @@ -88,8 +88,8 @@ #ifndef QTPROPERTYBROWSER_H #define QTPROPERTYBROWSER_H -#include -#include +#include +#include #if QT_VERSION >= 0x040400 QT_BEGIN_NAMESPACE diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils.cpp index 9b482a569..ad0161f01 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils.cpp +++ b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils.cpp @@ -86,14 +86,14 @@ ****************************************************************************/ #include "qtpropertybrowserutils_p.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #if QT_VERSION >= 0x040400 QT_BEGIN_NAMESPACE @@ -102,43 +102,43 @@ QT_BEGIN_NAMESPACE QtCursorDatabase::QtCursorDatabase() { appendCursor(Qt::ArrowCursor, QApplication::translate("QtCursorDatabase", "Arrow", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-arrow.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-arrow.png"))); appendCursor(Qt::UpArrowCursor, QApplication::translate("QtCursorDatabase", "Up Arrow", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-uparrow.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-uparrow.png"))); appendCursor(Qt::CrossCursor, QApplication::translate("QtCursorDatabase", "Cross", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-cross.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-cross.png"))); appendCursor(Qt::WaitCursor, QApplication::translate("QtCursorDatabase", "Wait", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-wait.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-wait.png"))); appendCursor(Qt::IBeamCursor, QApplication::translate("QtCursorDatabase", "IBeam", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-ibeam.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-ibeam.png"))); appendCursor(Qt::SizeVerCursor, QApplication::translate("QtCursorDatabase", "Size Vertical", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizev.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizev.png"))); appendCursor(Qt::SizeHorCursor, QApplication::translate("QtCursorDatabase", "Size Horizontal", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizeh.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizeh.png"))); appendCursor(Qt::SizeFDiagCursor, QApplication::translate("QtCursorDatabase", "Size Backslash", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizef.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizef.png"))); appendCursor(Qt::SizeBDiagCursor, QApplication::translate("QtCursorDatabase", "Size Slash", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizeb.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizeb.png"))); appendCursor(Qt::SizeAllCursor, QApplication::translate("QtCursorDatabase", "Size All", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizeall.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-sizeall.png"))); appendCursor(Qt::BlankCursor, QApplication::translate("QtCursorDatabase", "Blank", 0, - QApplication::UnicodeUTF8), QIcon()); + -1), QIcon()); appendCursor(Qt::SplitVCursor, QApplication::translate("QtCursorDatabase", "Split Vertical", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-vsplit.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-vsplit.png"))); appendCursor(Qt::SplitHCursor, QApplication::translate("QtCursorDatabase", "Split Horizontal", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-hsplit.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-hsplit.png"))); appendCursor(Qt::PointingHandCursor, QApplication::translate("QtCursorDatabase", "Pointing Hand", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-hand.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-hand.png"))); appendCursor(Qt::ForbiddenCursor, QApplication::translate("QtCursorDatabase", "Forbidden", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-forbidden.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-forbidden.png"))); appendCursor(Qt::OpenHandCursor, QApplication::translate("QtCursorDatabase", "Open Hand", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-openhand.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-openhand.png"))); appendCursor(Qt::ClosedHandCursor, QApplication::translate("QtCursorDatabase", "Closed Hand", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-closedhand.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-closedhand.png"))); appendCursor(Qt::WhatsThisCursor, QApplication::translate("QtCursorDatabase", "What's This", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-whatsthis.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-whatsthis.png"))); appendCursor(Qt::BusyCursor, QApplication::translate("QtCursorDatabase", "Busy", 0, - QApplication::UnicodeUTF8), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-busy.png"))); + -1), QIcon(QLatin1String(":/trolltech/qtpropertybrowser/images/cursor-busy.png"))); } void QtCursorDatabase::appendCursor(Qt::CursorShape shape, const QString &name, const QIcon &icon) @@ -222,7 +222,7 @@ QIcon QtPropertyBrowserUtils::brushValueIcon(const QBrush &b) QString QtPropertyBrowserUtils::colorValueText(const QColor &c) { - return QApplication::translate("QtPropertyBrowserUtils", "[%1, %2, %3] (%4)", 0, QApplication::UnicodeUTF8) + return QApplication::translate("QtPropertyBrowserUtils", "[%1, %2, %3] (%4)", 0, -1) .arg(QString::number(c.red())) .arg(QString::number(c.green())) .arg(QString::number(c.blue())) @@ -252,7 +252,7 @@ QIcon QtPropertyBrowserUtils::fontValueIcon(const QFont &f) QString QtPropertyBrowserUtils::fontValueText(const QFont &f) { - return QApplication::translate("QtPropertyBrowserUtils", "[%1, %2]", 0, QApplication::UnicodeUTF8) + return QApplication::translate("QtPropertyBrowserUtils", "[%1, %2]", 0, -1) .arg(f.family()) .arg(f.pointSize()); } diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils_p.h b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils_p.h index 66156c5d4..ae6ac8934 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils_p.h +++ b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertybrowserutils_p.h @@ -99,10 +99,10 @@ #ifndef QTPROPERTYBROWSERUTILS_H #define QTPROPERTYBROWSERUTILS_H -#include -#include -#include -#include +#include +#include +#include +#include #if QT_VERSION >= 0x040400 QT_BEGIN_NAMESPACE diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertymanager.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertymanager.cpp index fe8ea92c9..5071a7d50 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qtpropertymanager.cpp +++ b/code/studio/src/3rdparty/qtpropertybrowser/qtpropertymanager.cpp @@ -87,18 +87,18 @@ #include "qtpropertymanager.h" #include "qtpropertybrowserutils_p.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.cpp index eb9b37515..f99fc9f8a 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.cpp +++ b/code/studio/src/3rdparty/qtpropertybrowser/qttreepropertybrowser.cpp @@ -86,17 +86,17 @@ ****************************************************************************/ #include "qttreepropertybrowser.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if QT_VERSION >= 0x040400 QT_BEGIN_NAMESPACE @@ -491,8 +491,8 @@ void QtTreePropertyBrowserPrivate::init(QWidget *parent) m_treeWidget->setColumnCount(2); QStringList labels; - labels.append(QApplication::translate("QtTreePropertyBrowser", "Property", 0, QApplication::UnicodeUTF8)); - labels.append(QApplication::translate("QtTreePropertyBrowser", "Value", 0, QApplication::UnicodeUTF8)); + labels.append(QApplication::translate("QtTreePropertyBrowser", "Property", 0, -1)); + labels.append(QApplication::translate("QtTreePropertyBrowser", "Value", 0, -1)); m_treeWidget->setHeaderLabels(labels); m_treeWidget->setAlternatingRowColors(true); m_treeWidget->setEditTriggers(QAbstractItemView::EditKeyPressed); diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.cpp b/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.cpp index 820e6e2f1..5f3373c6a 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.cpp +++ b/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.cpp @@ -1,62 +1,18 @@ /**************************************************************************** ** -** This file is part of a Qt Solutions component. -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Solutions Commercial License Agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** Please note Third Party Software included with Qt Solutions may impose -** additional restrictions and it is the user's responsibility to ensure -** that they have met the licensing requirements of the GPL, LGPL, or Qt -** Solutions Commercial license and the relevant license of the Third -** Party Software they are using. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -****************************************************************************/ - -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -66,10 +22,9 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU @@ -79,8 +34,7 @@ ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -88,18 +42,16 @@ #include "qtvariantproperty.h" #include "qtpropertymanager.h" #include "qteditorfactory.h" -#include -#include -#include -#include +#include +#include +#include +#include #if defined(Q_CC_MSVC) # pragma warning(disable: 4786) /* MS VS 6: truncating debug info after 255 characters */ #endif -#if QT_VERSION >= 0x040400 QT_BEGIN_NAMESPACE -#endif class QtEnumPropertyType { @@ -115,17 +67,13 @@ class QtGroupPropertyType { }; -#if QT_VERSION >= 0x040400 QT_END_NAMESPACE -#endif Q_DECLARE_METATYPE(QtEnumPropertyType) Q_DECLARE_METATYPE(QtFlagPropertyType) Q_DECLARE_METATYPE(QtGroupPropertyType) -#if QT_VERSION >= 0x040400 QT_BEGIN_NAMESPACE -#endif /*! Returns the type id for an enum property. @@ -192,7 +140,6 @@ static QtProperty *wrappedProperty(QtProperty *property) class QtVariantPropertyPrivate { - QtVariantProperty *q_ptr; public: QtVariantPropertyPrivate(QtVariantPropertyManager *m) : manager(m) {} @@ -201,6 +148,9 @@ public: /*! \class QtVariantProperty + \internal + \inmodule QtDesigner + \since 4.4 \brief The QtVariantProperty class is a convenience class handling QVariant based properties. @@ -214,21 +164,11 @@ public: For example, instead of writing: - \code - QtVariantPropertyManager *variantPropertyManager; - QtProperty *property; - - variantPropertyManager->setValue(property, 10); - \endcode + \snippet doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp 0 you can write: - \code - QtVariantPropertyManager *variantPropertyManager; - QtVariantProperty *property; - - property->setValue(10); - \endcode + \snippet doc/src/snippets/code/tools_shared_qtpropertybrowser_qtvariantproperty.cpp 1 QtVariantProperty instances can only be created by the QtVariantPropertyManager class. @@ -247,9 +187,8 @@ public: \sa QtVariantPropertyManager */ QtVariantProperty::QtVariantProperty(QtVariantPropertyManager *manager) - : QtProperty(manager), d_ptr(new QtVariantPropertyPrivate(manager)) + : QtProperty(manager), d_ptr(new QtVariantPropertyPrivate(manager)) { - } /*! @@ -259,7 +198,6 @@ QtVariantProperty::QtVariantProperty(QtVariantPropertyManager *manager) */ QtVariantProperty::~QtVariantProperty() { - delete d_ptr; } /*! @@ -610,7 +548,7 @@ void QtVariantPropertyManagerPrivate::slotValueChanged(QtProperty *property, con void QtVariantPropertyManagerPrivate::slotValueChanged(QtProperty *property, const QKeySequence &val) { QVariant v; - qVariantSetValue(v, val); + v.setValue(val); valueChanged(property, v); } @@ -697,7 +635,7 @@ void QtVariantPropertyManagerPrivate::slotEnumIconsChanged(QtProperty *property, { if (QtVariantProperty *varProp = m_internalToProperty.value(property, 0)) { QVariant v; - qVariantSetValue(v, enumIcons); + v.setValue(enumIcons); emit q_ptr->attributeChanged(varProp, m_enumIconsAttribute, v); } } @@ -727,6 +665,9 @@ void QtVariantPropertyManagerPrivate::slotFlagNamesChanged(QtProperty *property, /*! \class QtVariantPropertyManager + \internal + \inmodule QtDesigner + \since 4.4 \brief The QtVariantPropertyManager class provides and manages QVariant based properties. @@ -757,77 +698,77 @@ void QtVariantPropertyManagerPrivate::slotFlagNamesChanged(QtProperty *property, \table \header - \o Property Type - \o Property Type Id + \li Property Type + \li Property Type Id \row - \o int - \o QVariant::Int + \li int + \li QVariant::Int \row - \o double - \o QVariant::Double + \li double + \li QVariant::Double \row - \o bool - \o QVariant::Bool + \li bool + \li QVariant::Bool \row - \o QString - \o QVariant::String + \li QString + \li QVariant::String \row - \o QDate - \o QVariant::Date + \li QDate + \li QVariant::Date \row - \o QTime - \o QVariant::Time + \li QTime + \li QVariant::Time \row - \o QDateTime - \o QVariant::DateTime + \li QDateTime + \li QVariant::DateTime \row - \o QKeySequence - \o QVariant::KeySequence + \li QKeySequence + \li QVariant::KeySequence \row - \o QChar - \o QVariant::Char + \li QChar + \li QVariant::Char \row - \o QLocale - \o QVariant::Locale + \li QLocale + \li QVariant::Locale \row - \o QPoint - \o QVariant::Point + \li QPoint + \li QVariant::Point \row - \o QPointF - \o QVariant::PointF + \li QPointF + \li QVariant::PointF \row - \o QSize - \o QVariant::Size + \li QSize + \li QVariant::Size \row - \o QSizeF - \o QVariant::SizeF + \li QSizeF + \li QVariant::SizeF \row - \o QRect - \o QVariant::Rect + \li QRect + \li QVariant::Rect \row - \o QRectF - \o QVariant::RectF + \li QRectF + \li QVariant::RectF \row - \o QColor - \o QVariant::Color + \li QColor + \li QVariant::Color \row - \o QSizePolicy - \o QVariant::SizePolicy + \li QSizePolicy + \li QVariant::SizePolicy \row - \o QFont - \o QVariant::Font + \li QFont + \li QVariant::Font \row - \o QCursor - \o QVariant::Cursor + \li QCursor + \li QVariant::Cursor \row - \o enum - \o enumTypeId() + \li enum + \li enumTypeId() \row - \o flag - \o flagTypeId() + \li flag + \li flagTypeId() \row - \o group - \o groupTypeId() + \li group + \li groupTypeId() \endtable Each property type can provide additional attributes, @@ -836,97 +777,97 @@ void QtVariantPropertyManagerPrivate::slotFlagNamesChanged(QtProperty *property, \table \header - \o Property Type - \o Attribute Name - \o Attribute Type + \li Property Type + \li Attribute Name + \li Attribute Type \row - \o \c int - \o minimum - \o QVariant::Int + \li \c int + \li minimum + \li QVariant::Int \row - \o - \o maximum - \o QVariant::Int + \li + \li maximum + \li QVariant::Int \row - \o - \o singleStep - \o QVariant::Int + \li + \li singleStep + \li QVariant::Int \row - \o \c double - \o minimum - \o QVariant::Double + \li \c double + \li minimum + \li QVariant::Double \row - \o - \o maximum - \o QVariant::Double + \li + \li maximum + \li QVariant::Double \row - \o - \o singleStep - \o QVariant::Double + \li + \li singleStep + \li QVariant::Double \row - \o - \o decimals - \o QVariant::Int + \li + \li decimals + \li QVariant::Int \row - \o QString - \o regExp - \o QVariant::RegExp + \li QString + \li regExp + \li QVariant::RegExp \row - \o QDate - \o minimum - \o QVariant::Date + \li QDate + \li minimum + \li QVariant::Date \row - \o - \o maximum - \o QVariant::Date + \li + \li maximum + \li QVariant::Date \row - \o QPointF - \o decimals - \o QVariant::Int + \li QPointF + \li decimals + \li QVariant::Int \row - \o QSize - \o minimum - \o QVariant::Size + \li QSize + \li minimum + \li QVariant::Size \row - \o - \o maximum - \o QVariant::Size + \li + \li maximum + \li QVariant::Size \row - \o QSizeF - \o minimum - \o QVariant::SizeF + \li QSizeF + \li minimum + \li QVariant::SizeF \row - \o - \o maximum - \o QVariant::SizeF + \li + \li maximum + \li QVariant::SizeF \row - \o - \o decimals - \o QVariant::Int + \li + \li decimals + \li QVariant::Int \row - \o QRect - \o constraint - \o QVariant::Rect + \li QRect + \li constraint + \li QVariant::Rect \row - \o QRectF - \o constraint - \o QVariant::RectF + \li QRectF + \li constraint + \li QVariant::RectF \row - \o - \o decimals - \o QVariant::Int + \li + \li decimals + \li QVariant::Int \row - \o \c enum - \o enumNames - \o QVariant::StringList + \li \c enum + \li enumNames + \li QVariant::StringList \row - \o - \o enumIcons - \o iconMapTypeId() + \li + \li enumIcons + \li iconMapTypeId() \row - \o \c flag - \o flagNames - \o QVariant::StringList + \li \c flag + \li flagNames + \li QVariant::StringList \endtable The attributes for a given property type can be retrieved using @@ -968,9 +909,8 @@ void QtVariantPropertyManagerPrivate::slotFlagNamesChanged(QtProperty *property, Creates a manager with the given \a parent. */ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) - : QtAbstractPropertyManager(parent) + : QtAbstractPropertyManager(parent), d_ptr(new QtVariantPropertyManagerPrivate) { - d_ptr = new QtVariantPropertyManagerPrivate; d_ptr->q_ptr = this; d_ptr->m_creatingProperty = false; @@ -985,12 +925,12 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) d_ptr->m_typeToAttributeToAttributeType[QVariant::Int][d_ptr->m_maximumAttribute] = QVariant::Int; d_ptr->m_typeToAttributeToAttributeType[QVariant::Int][d_ptr->m_singleStepAttribute] = QVariant::Int; d_ptr->m_typeToValueType[QVariant::Int] = QVariant::Int; - connect(intPropertyManager, SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(intPropertyManager, SIGNAL(rangeChanged(QtProperty *, int, int)), - this, SLOT(slotRangeChanged(QtProperty *, int, int))); - connect(intPropertyManager, SIGNAL(singleStepChanged(QtProperty *, int)), - this, SLOT(slotSingleStepChanged(QtProperty *, int))); + connect(intPropertyManager, SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(intPropertyManager, SIGNAL(rangeChanged(QtProperty*,int,int)), + this, SLOT(slotRangeChanged(QtProperty*,int,int))); + connect(intPropertyManager, SIGNAL(singleStepChanged(QtProperty*,int)), + this, SLOT(slotSingleStepChanged(QtProperty*,int))); // DoublePropertyManager QtDoublePropertyManager *doublePropertyManager = new QtDoublePropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Double] = doublePropertyManager; @@ -1003,30 +943,30 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) d_ptr->m_typeToAttributeToAttributeType[QVariant::Double][d_ptr->m_decimalsAttribute] = QVariant::Int; d_ptr->m_typeToValueType[QVariant::Double] = QVariant::Double; - connect(doublePropertyManager, SIGNAL(valueChanged(QtProperty *, double)), - this, SLOT(slotValueChanged(QtProperty *, double))); - connect(doublePropertyManager, SIGNAL(rangeChanged(QtProperty *, double, double)), - this, SLOT(slotRangeChanged(QtProperty *, double, double))); - connect(doublePropertyManager, SIGNAL(singleStepChanged(QtProperty *, double)), - this, SLOT(slotSingleStepChanged(QtProperty *, double))); - connect(doublePropertyManager, SIGNAL(decimalsChanged(QtProperty *, int)), - this, SLOT(slotDecimalsChanged(QtProperty *, int))); + connect(doublePropertyManager, SIGNAL(valueChanged(QtProperty*,double)), + this, SLOT(slotValueChanged(QtProperty*,double))); + connect(doublePropertyManager, SIGNAL(rangeChanged(QtProperty*,double,double)), + this, SLOT(slotRangeChanged(QtProperty*,double,double))); + connect(doublePropertyManager, SIGNAL(singleStepChanged(QtProperty*,double)), + this, SLOT(slotSingleStepChanged(QtProperty*,double))); + connect(doublePropertyManager, SIGNAL(decimalsChanged(QtProperty*,int)), + this, SLOT(slotDecimalsChanged(QtProperty*,int))); // BoolPropertyManager QtBoolPropertyManager *boolPropertyManager = new QtBoolPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Bool] = boolPropertyManager; d_ptr->m_typeToValueType[QVariant::Bool] = QVariant::Bool; - connect(boolPropertyManager, SIGNAL(valueChanged(QtProperty *, bool)), - this, SLOT(slotValueChanged(QtProperty *, bool))); + connect(boolPropertyManager, SIGNAL(valueChanged(QtProperty*,bool)), + this, SLOT(slotValueChanged(QtProperty*,bool))); // StringPropertyManager QtStringPropertyManager *stringPropertyManager = new QtStringPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::String] = stringPropertyManager; d_ptr->m_typeToValueType[QVariant::String] = QVariant::String; d_ptr->m_typeToAttributeToAttributeType[QVariant::String][d_ptr->m_regExpAttribute] = QVariant::RegExp; - connect(stringPropertyManager, SIGNAL(valueChanged(QtProperty *, const QString &)), - this, SLOT(slotValueChanged(QtProperty *, const QString &))); - connect(stringPropertyManager, SIGNAL(regExpChanged(QtProperty *, const QRegExp &)), - this, SLOT(slotRegExpChanged(QtProperty *, const QRegExp &))); + connect(stringPropertyManager, SIGNAL(valueChanged(QtProperty*,QString)), + this, SLOT(slotValueChanged(QtProperty*,QString))); + connect(stringPropertyManager, SIGNAL(regExpChanged(QtProperty*,QRegExp)), + this, SLOT(slotRegExpChanged(QtProperty*,QRegExp))); // DatePropertyManager QtDatePropertyManager *datePropertyManager = new QtDatePropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Date] = datePropertyManager; @@ -1035,74 +975,74 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) QVariant::Date; d_ptr->m_typeToAttributeToAttributeType[QVariant::Date][d_ptr->m_maximumAttribute] = QVariant::Date; - connect(datePropertyManager, SIGNAL(valueChanged(QtProperty *, const QDate &)), - this, SLOT(slotValueChanged(QtProperty *, const QDate &))); - connect(datePropertyManager, SIGNAL(rangeChanged(QtProperty *, const QDate &, const QDate &)), - this, SLOT(slotRangeChanged(QtProperty *, const QDate &, const QDate &))); + connect(datePropertyManager, SIGNAL(valueChanged(QtProperty*,QDate)), + this, SLOT(slotValueChanged(QtProperty*,QDate))); + connect(datePropertyManager, SIGNAL(rangeChanged(QtProperty*,QDate,QDate)), + this, SLOT(slotRangeChanged(QtProperty*,QDate,QDate))); // TimePropertyManager QtTimePropertyManager *timePropertyManager = new QtTimePropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Time] = timePropertyManager; d_ptr->m_typeToValueType[QVariant::Time] = QVariant::Time; - connect(timePropertyManager, SIGNAL(valueChanged(QtProperty *, const QTime &)), - this, SLOT(slotValueChanged(QtProperty *, const QTime &))); + connect(timePropertyManager, SIGNAL(valueChanged(QtProperty*,QTime)), + this, SLOT(slotValueChanged(QtProperty*,QTime))); // DateTimePropertyManager QtDateTimePropertyManager *dateTimePropertyManager = new QtDateTimePropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::DateTime] = dateTimePropertyManager; d_ptr->m_typeToValueType[QVariant::DateTime] = QVariant::DateTime; - connect(dateTimePropertyManager, SIGNAL(valueChanged(QtProperty *, const QDateTime &)), - this, SLOT(slotValueChanged(QtProperty *, const QDateTime &))); + connect(dateTimePropertyManager, SIGNAL(valueChanged(QtProperty*,QDateTime)), + this, SLOT(slotValueChanged(QtProperty*,QDateTime))); // KeySequencePropertyManager QtKeySequencePropertyManager *keySequencePropertyManager = new QtKeySequencePropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::KeySequence] = keySequencePropertyManager; d_ptr->m_typeToValueType[QVariant::KeySequence] = QVariant::KeySequence; - connect(keySequencePropertyManager, SIGNAL(valueChanged(QtProperty *, const QKeySequence &)), - this, SLOT(slotValueChanged(QtProperty *, const QKeySequence &))); + connect(keySequencePropertyManager, SIGNAL(valueChanged(QtProperty*,QKeySequence)), + this, SLOT(slotValueChanged(QtProperty*,QKeySequence))); // CharPropertyManager QtCharPropertyManager *charPropertyManager = new QtCharPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Char] = charPropertyManager; d_ptr->m_typeToValueType[QVariant::Char] = QVariant::Char; - connect(charPropertyManager, SIGNAL(valueChanged(QtProperty *, const QChar &)), - this, SLOT(slotValueChanged(QtProperty *, const QChar &))); + connect(charPropertyManager, SIGNAL(valueChanged(QtProperty*,QChar)), + this, SLOT(slotValueChanged(QtProperty*,QChar))); // LocalePropertyManager QtLocalePropertyManager *localePropertyManager = new QtLocalePropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Locale] = localePropertyManager; d_ptr->m_typeToValueType[QVariant::Locale] = QVariant::Locale; - connect(localePropertyManager, SIGNAL(valueChanged(QtProperty *, const QLocale &)), - this, SLOT(slotValueChanged(QtProperty *, const QLocale &))); - connect(localePropertyManager->subEnumPropertyManager(), SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(localePropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(localePropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + connect(localePropertyManager, SIGNAL(valueChanged(QtProperty*,QLocale)), + this, SLOT(slotValueChanged(QtProperty*,QLocale))); + connect(localePropertyManager->subEnumPropertyManager(), SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(localePropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(localePropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // PointPropertyManager QtPointPropertyManager *pointPropertyManager = new QtPointPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Point] = pointPropertyManager; d_ptr->m_typeToValueType[QVariant::Point] = QVariant::Point; - connect(pointPropertyManager, SIGNAL(valueChanged(QtProperty *, const QPoint &)), - this, SLOT(slotValueChanged(QtProperty *, const QPoint &))); - connect(pointPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(pointPropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(pointPropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + connect(pointPropertyManager, SIGNAL(valueChanged(QtProperty*,QPoint)), + this, SLOT(slotValueChanged(QtProperty*,QPoint))); + connect(pointPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(pointPropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(pointPropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // PointFPropertyManager QtPointFPropertyManager *pointFPropertyManager = new QtPointFPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::PointF] = pointFPropertyManager; d_ptr->m_typeToValueType[QVariant::PointF] = QVariant::PointF; d_ptr->m_typeToAttributeToAttributeType[QVariant::PointF][d_ptr->m_decimalsAttribute] = QVariant::Int; - connect(pointFPropertyManager, SIGNAL(valueChanged(QtProperty *, const QPointF &)), - this, SLOT(slotValueChanged(QtProperty *, const QPointF &))); - connect(pointFPropertyManager, SIGNAL(decimalsChanged(QtProperty *, int)), - this, SLOT(slotDecimalsChanged(QtProperty *, int))); - connect(pointFPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty *, double)), - this, SLOT(slotValueChanged(QtProperty *, double))); - connect(pointFPropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(pointFPropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + connect(pointFPropertyManager, SIGNAL(valueChanged(QtProperty*,QPointF)), + this, SLOT(slotValueChanged(QtProperty*,QPointF))); + connect(pointFPropertyManager, SIGNAL(decimalsChanged(QtProperty*,int)), + this, SLOT(slotDecimalsChanged(QtProperty*,int))); + connect(pointFPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty*,double)), + this, SLOT(slotValueChanged(QtProperty*,double))); + connect(pointFPropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(pointFPropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // SizePropertyManager QtSizePropertyManager *sizePropertyManager = new QtSizePropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Size] = sizePropertyManager; @@ -1111,18 +1051,18 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) QVariant::Size; d_ptr->m_typeToAttributeToAttributeType[QVariant::Size][d_ptr->m_maximumAttribute] = QVariant::Size; - connect(sizePropertyManager, SIGNAL(valueChanged(QtProperty *, const QSize &)), - this, SLOT(slotValueChanged(QtProperty *, const QSize &))); - connect(sizePropertyManager, SIGNAL(rangeChanged(QtProperty *, const QSize &, const QSize &)), - this, SLOT(slotRangeChanged(QtProperty *, const QSize &, const QSize &))); - connect(sizePropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(sizePropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty *, int, int)), - this, SLOT(slotRangeChanged(QtProperty *, int, int))); - connect(sizePropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(sizePropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + connect(sizePropertyManager, SIGNAL(valueChanged(QtProperty*,QSize)), + this, SLOT(slotValueChanged(QtProperty*,QSize))); + connect(sizePropertyManager, SIGNAL(rangeChanged(QtProperty*,QSize,QSize)), + this, SLOT(slotRangeChanged(QtProperty*,QSize,QSize))); + connect(sizePropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(sizePropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty*,int,int)), + this, SLOT(slotRangeChanged(QtProperty*,int,int))); + connect(sizePropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(sizePropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // SizeFPropertyManager QtSizeFPropertyManager *sizeFPropertyManager = new QtSizeFPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::SizeF] = sizeFPropertyManager; @@ -1133,38 +1073,38 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) QVariant::SizeF; d_ptr->m_typeToAttributeToAttributeType[QVariant::SizeF][d_ptr->m_decimalsAttribute] = QVariant::Int; - connect(sizeFPropertyManager, SIGNAL(valueChanged(QtProperty *, const QSizeF &)), - this, SLOT(slotValueChanged(QtProperty *, const QSizeF &))); - connect(sizeFPropertyManager, SIGNAL(rangeChanged(QtProperty *, const QSizeF &, const QSizeF &)), - this, SLOT(slotRangeChanged(QtProperty *, const QSizeF &, const QSizeF &))); - connect(sizeFPropertyManager, SIGNAL(decimalsChanged(QtProperty *, int)), - this, SLOT(slotDecimalsChanged(QtProperty *, int))); - connect(sizeFPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty *, double)), - this, SLOT(slotValueChanged(QtProperty *, double))); - connect(sizeFPropertyManager->subDoublePropertyManager(), SIGNAL(rangeChanged(QtProperty *, double, double)), - this, SLOT(slotRangeChanged(QtProperty *, double, double))); - connect(sizeFPropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(sizeFPropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + connect(sizeFPropertyManager, SIGNAL(valueChanged(QtProperty*,QSizeF)), + this, SLOT(slotValueChanged(QtProperty*,QSizeF))); + connect(sizeFPropertyManager, SIGNAL(rangeChanged(QtProperty*,QSizeF,QSizeF)), + this, SLOT(slotRangeChanged(QtProperty*,QSizeF,QSizeF))); + connect(sizeFPropertyManager, SIGNAL(decimalsChanged(QtProperty*,int)), + this, SLOT(slotDecimalsChanged(QtProperty*,int))); + connect(sizeFPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty*,double)), + this, SLOT(slotValueChanged(QtProperty*,double))); + connect(sizeFPropertyManager->subDoublePropertyManager(), SIGNAL(rangeChanged(QtProperty*,double,double)), + this, SLOT(slotRangeChanged(QtProperty*,double,double))); + connect(sizeFPropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(sizeFPropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // RectPropertyManager QtRectPropertyManager *rectPropertyManager = new QtRectPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Rect] = rectPropertyManager; d_ptr->m_typeToValueType[QVariant::Rect] = QVariant::Rect; d_ptr->m_typeToAttributeToAttributeType[QVariant::Rect][d_ptr->m_constraintAttribute] = QVariant::Rect; - connect(rectPropertyManager, SIGNAL(valueChanged(QtProperty *, const QRect &)), - this, SLOT(slotValueChanged(QtProperty *, const QRect &))); - connect(rectPropertyManager, SIGNAL(constraintChanged(QtProperty *, const QRect &)), - this, SLOT(slotConstraintChanged(QtProperty *, const QRect &))); - connect(rectPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(rectPropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty *, int, int)), - this, SLOT(slotRangeChanged(QtProperty *, int, int))); - connect(rectPropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(rectPropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + connect(rectPropertyManager, SIGNAL(valueChanged(QtProperty*,QRect)), + this, SLOT(slotValueChanged(QtProperty*,QRect))); + connect(rectPropertyManager, SIGNAL(constraintChanged(QtProperty*,QRect)), + this, SLOT(slotConstraintChanged(QtProperty*,QRect))); + connect(rectPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(rectPropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty*,int,int)), + this, SLOT(slotRangeChanged(QtProperty*,int,int))); + connect(rectPropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(rectPropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // RectFPropertyManager QtRectFPropertyManager *rectFPropertyManager = new QtRectFPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::RectF] = rectFPropertyManager; @@ -1173,32 +1113,32 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) QVariant::RectF; d_ptr->m_typeToAttributeToAttributeType[QVariant::RectF][d_ptr->m_decimalsAttribute] = QVariant::Int; - connect(rectFPropertyManager, SIGNAL(valueChanged(QtProperty *, const QRectF &)), - this, SLOT(slotValueChanged(QtProperty *, const QRectF &))); - connect(rectFPropertyManager, SIGNAL(constraintChanged(QtProperty *, const QRectF &)), - this, SLOT(slotConstraintChanged(QtProperty *, const QRectF &))); - connect(rectFPropertyManager, SIGNAL(decimalsChanged(QtProperty *, int)), - this, SLOT(slotDecimalsChanged(QtProperty *, int))); - connect(rectFPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty *, double)), - this, SLOT(slotValueChanged(QtProperty *, double))); - connect(rectFPropertyManager->subDoublePropertyManager(), SIGNAL(rangeChanged(QtProperty *, double, double)), - this, SLOT(slotRangeChanged(QtProperty *, double, double))); - connect(rectFPropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(rectFPropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + connect(rectFPropertyManager, SIGNAL(valueChanged(QtProperty*,QRectF)), + this, SLOT(slotValueChanged(QtProperty*,QRectF))); + connect(rectFPropertyManager, SIGNAL(constraintChanged(QtProperty*,QRectF)), + this, SLOT(slotConstraintChanged(QtProperty*,QRectF))); + connect(rectFPropertyManager, SIGNAL(decimalsChanged(QtProperty*,int)), + this, SLOT(slotDecimalsChanged(QtProperty*,int))); + connect(rectFPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty*,double)), + this, SLOT(slotValueChanged(QtProperty*,double))); + connect(rectFPropertyManager->subDoublePropertyManager(), SIGNAL(rangeChanged(QtProperty*,double,double)), + this, SLOT(slotRangeChanged(QtProperty*,double,double))); + connect(rectFPropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(rectFPropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // ColorPropertyManager QtColorPropertyManager *colorPropertyManager = new QtColorPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Color] = colorPropertyManager; d_ptr->m_typeToValueType[QVariant::Color] = QVariant::Color; - connect(colorPropertyManager, SIGNAL(valueChanged(QtProperty *, const QColor &)), - this, SLOT(slotValueChanged(QtProperty *, const QColor &))); - connect(colorPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(colorPropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(colorPropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + connect(colorPropertyManager, SIGNAL(valueChanged(QtProperty*,QColor)), + this, SLOT(slotValueChanged(QtProperty*,QColor))); + connect(colorPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(colorPropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(colorPropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // EnumPropertyManager int enumId = enumTypeId(); QtEnumPropertyManager *enumPropertyManager = new QtEnumPropertyManager(this); @@ -1208,58 +1148,58 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) QVariant::StringList; d_ptr->m_typeToAttributeToAttributeType[enumId][d_ptr->m_enumIconsAttribute] = iconMapTypeId(); - connect(enumPropertyManager, SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(enumPropertyManager, SIGNAL(enumNamesChanged(QtProperty *, const QStringList &)), - this, SLOT(slotEnumNamesChanged(QtProperty *, const QStringList &))); - connect(enumPropertyManager, SIGNAL(enumIconsChanged(QtProperty *, const QMap &)), - this, SLOT(slotEnumIconsChanged(QtProperty *, const QMap &))); + connect(enumPropertyManager, SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(enumPropertyManager, SIGNAL(enumNamesChanged(QtProperty*,QStringList)), + this, SLOT(slotEnumNamesChanged(QtProperty*,QStringList))); + connect(enumPropertyManager, SIGNAL(enumIconsChanged(QtProperty*,QMap)), + this, SLOT(slotEnumIconsChanged(QtProperty*,QMap))); // SizePolicyPropertyManager QtSizePolicyPropertyManager *sizePolicyPropertyManager = new QtSizePolicyPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::SizePolicy] = sizePolicyPropertyManager; d_ptr->m_typeToValueType[QVariant::SizePolicy] = QVariant::SizePolicy; - connect(sizePolicyPropertyManager, SIGNAL(valueChanged(QtProperty *, const QSizePolicy &)), - this, SLOT(slotValueChanged(QtProperty *, const QSizePolicy &))); - connect(sizePolicyPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(sizePolicyPropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty *, int, int)), - this, SLOT(slotRangeChanged(QtProperty *, int, int))); - connect(sizePolicyPropertyManager->subEnumPropertyManager(), SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); + connect(sizePolicyPropertyManager, SIGNAL(valueChanged(QtProperty*,QSizePolicy)), + this, SLOT(slotValueChanged(QtProperty*,QSizePolicy))); + connect(sizePolicyPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(sizePolicyPropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty*,int,int)), + this, SLOT(slotRangeChanged(QtProperty*,int,int))); + connect(sizePolicyPropertyManager->subEnumPropertyManager(), SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); connect(sizePolicyPropertyManager->subEnumPropertyManager(), - SIGNAL(enumNamesChanged(QtProperty *, const QStringList &)), - this, SLOT(slotEnumNamesChanged(QtProperty *, const QStringList &))); - connect(sizePolicyPropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(sizePolicyPropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + SIGNAL(enumNamesChanged(QtProperty*,QStringList)), + this, SLOT(slotEnumNamesChanged(QtProperty*,QStringList))); + connect(sizePolicyPropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(sizePolicyPropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // FontPropertyManager QtFontPropertyManager *fontPropertyManager = new QtFontPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Font] = fontPropertyManager; d_ptr->m_typeToValueType[QVariant::Font] = QVariant::Font; - connect(fontPropertyManager, SIGNAL(valueChanged(QtProperty *, const QFont &)), - this, SLOT(slotValueChanged(QtProperty *, const QFont &))); - connect(fontPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(fontPropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty *, int, int)), - this, SLOT(slotRangeChanged(QtProperty *, int, int))); - connect(fontPropertyManager->subEnumPropertyManager(), SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); + connect(fontPropertyManager, SIGNAL(valueChanged(QtProperty*,QFont)), + this, SLOT(slotValueChanged(QtProperty*,QFont))); + connect(fontPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(fontPropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty*,int,int)), + this, SLOT(slotRangeChanged(QtProperty*,int,int))); + connect(fontPropertyManager->subEnumPropertyManager(), SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); connect(fontPropertyManager->subEnumPropertyManager(), - SIGNAL(enumNamesChanged(QtProperty *, const QStringList &)), - this, SLOT(slotEnumNamesChanged(QtProperty *, const QStringList &))); - connect(fontPropertyManager->subBoolPropertyManager(), SIGNAL(valueChanged(QtProperty *, bool)), - this, SLOT(slotValueChanged(QtProperty *, bool))); - connect(fontPropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(fontPropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + SIGNAL(enumNamesChanged(QtProperty*,QStringList)), + this, SLOT(slotEnumNamesChanged(QtProperty*,QStringList))); + connect(fontPropertyManager->subBoolPropertyManager(), SIGNAL(valueChanged(QtProperty*,bool)), + this, SLOT(slotValueChanged(QtProperty*,bool))); + connect(fontPropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(fontPropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // CursorPropertyManager QtCursorPropertyManager *cursorPropertyManager = new QtCursorPropertyManager(this); d_ptr->m_typeToPropertyManager[QVariant::Cursor] = cursorPropertyManager; d_ptr->m_typeToValueType[QVariant::Cursor] = QVariant::Cursor; - connect(cursorPropertyManager, SIGNAL(valueChanged(QtProperty *, const QCursor &)), - this, SLOT(slotValueChanged(QtProperty *, const QCursor &))); + connect(cursorPropertyManager, SIGNAL(valueChanged(QtProperty*,QCursor)), + this, SLOT(slotValueChanged(QtProperty*,QCursor))); // FlagPropertyManager int flagId = flagTypeId(); QtFlagPropertyManager *flagPropertyManager = new QtFlagPropertyManager(this); @@ -1267,16 +1207,16 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) d_ptr->m_typeToValueType[flagId] = QVariant::Int; d_ptr->m_typeToAttributeToAttributeType[flagId][d_ptr->m_flagNamesAttribute] = QVariant::StringList; - connect(flagPropertyManager, SIGNAL(valueChanged(QtProperty *, int)), - this, SLOT(slotValueChanged(QtProperty *, int))); - connect(flagPropertyManager, SIGNAL(flagNamesChanged(QtProperty *, const QStringList &)), - this, SLOT(slotFlagNamesChanged(QtProperty *, const QStringList &))); - connect(flagPropertyManager->subBoolPropertyManager(), SIGNAL(valueChanged(QtProperty *, bool)), - this, SLOT(slotValueChanged(QtProperty *, bool))); - connect(flagPropertyManager, SIGNAL(propertyInserted(QtProperty *, QtProperty *, QtProperty *)), - this, SLOT(slotPropertyInserted(QtProperty *, QtProperty *, QtProperty *))); - connect(flagPropertyManager, SIGNAL(propertyRemoved(QtProperty *, QtProperty *)), - this, SLOT(slotPropertyRemoved(QtProperty *, QtProperty *))); + connect(flagPropertyManager, SIGNAL(valueChanged(QtProperty*,int)), + this, SLOT(slotValueChanged(QtProperty*,int))); + connect(flagPropertyManager, SIGNAL(flagNamesChanged(QtProperty*,QStringList)), + this, SLOT(slotFlagNamesChanged(QtProperty*,QStringList))); + connect(flagPropertyManager->subBoolPropertyManager(), SIGNAL(valueChanged(QtProperty*,bool)), + this, SLOT(slotValueChanged(QtProperty*,bool))); + connect(flagPropertyManager, SIGNAL(propertyInserted(QtProperty*,QtProperty*,QtProperty*)), + this, SLOT(slotPropertyInserted(QtProperty*,QtProperty*,QtProperty*))); + connect(flagPropertyManager, SIGNAL(propertyRemoved(QtProperty*,QtProperty*)), + this, SLOT(slotPropertyRemoved(QtProperty*,QtProperty*))); // FlagPropertyManager int groupId = groupTypeId(); QtGroupPropertyManager *groupPropertyManager = new QtGroupPropertyManager(this); @@ -1290,7 +1230,6 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent) QtVariantPropertyManager::~QtVariantPropertyManager() { clear(); - delete d_ptr; } /*! @@ -1384,7 +1323,7 @@ QVariant QtVariantPropertyManager::value(const QtProperty *property) const } else if (QtDateTimePropertyManager *dateTimeManager = qobject_cast(manager)) { return dateTimeManager->value(internProp); } else if (QtKeySequencePropertyManager *keySequenceManager = qobject_cast(manager)) { - return keySequenceManager->value(internProp); + return QVariant::fromValue(keySequenceManager->value(internProp)); } else if (QtCharPropertyManager *charManager = qobject_cast(manager)) { return charManager->value(internProp); } else if (QtLocalePropertyManager *localeManager = qobject_cast(manager)) { @@ -1548,7 +1487,7 @@ QVariant QtVariantPropertyManager::attributeValue(const QtProperty *property, co return enumManager->enumNames(internProp); if (attribute == d_ptr->m_enumIconsAttribute) { QVariant v; - qVariantSetValue(v, enumManager->enumIcons(internProp)); + v.setValue(enumManager->enumIcons(internProp)); return v; } return QVariant(); @@ -1628,73 +1567,73 @@ void QtVariantPropertyManager::setValue(QtProperty *property, const QVariant &va QtAbstractPropertyManager *manager = internProp->propertyManager(); if (QtIntPropertyManager *intManager = qobject_cast(manager)) { - intManager->setValue(internProp, qVariantValue(val)); + intManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtDoublePropertyManager *doubleManager = qobject_cast(manager)) { - doubleManager->setValue(internProp, qVariantValue(val)); + doubleManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtBoolPropertyManager *boolManager = qobject_cast(manager)) { - boolManager->setValue(internProp, qVariantValue(val)); + boolManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtStringPropertyManager *stringManager = qobject_cast(manager)) { - stringManager->setValue(internProp, qVariantValue(val)); + stringManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtDatePropertyManager *dateManager = qobject_cast(manager)) { - dateManager->setValue(internProp, qVariantValue(val)); + dateManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtTimePropertyManager *timeManager = qobject_cast(manager)) { - timeManager->setValue(internProp, qVariantValue(val)); + timeManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtDateTimePropertyManager *dateTimeManager = qobject_cast(manager)) { - dateTimeManager->setValue(internProp, qVariantValue(val)); + dateTimeManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtKeySequencePropertyManager *keySequenceManager = qobject_cast(manager)) { - keySequenceManager->setValue(internProp, qVariantValue(val)); + keySequenceManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtCharPropertyManager *charManager = qobject_cast(manager)) { - charManager->setValue(internProp, qVariantValue(val)); + charManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtLocalePropertyManager *localeManager = qobject_cast(manager)) { - localeManager->setValue(internProp, qVariantValue(val)); + localeManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtPointPropertyManager *pointManager = qobject_cast(manager)) { - pointManager->setValue(internProp, qVariantValue(val)); + pointManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtPointFPropertyManager *pointFManager = qobject_cast(manager)) { - pointFManager->setValue(internProp, qVariantValue(val)); + pointFManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtSizePropertyManager *sizeManager = qobject_cast(manager)) { - sizeManager->setValue(internProp, qVariantValue(val)); + sizeManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtSizeFPropertyManager *sizeFManager = qobject_cast(manager)) { - sizeFManager->setValue(internProp, qVariantValue(val)); + sizeFManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtRectPropertyManager *rectManager = qobject_cast(manager)) { - rectManager->setValue(internProp, qVariantValue(val)); + rectManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtRectFPropertyManager *rectFManager = qobject_cast(manager)) { - rectFManager->setValue(internProp, qVariantValue(val)); + rectFManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtColorPropertyManager *colorManager = qobject_cast(manager)) { - colorManager->setValue(internProp, qVariantValue(val)); + colorManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtEnumPropertyManager *enumManager = qobject_cast(manager)) { - enumManager->setValue(internProp, qVariantValue(val)); + enumManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtSizePolicyPropertyManager *sizePolicyManager = qobject_cast(manager)) { - sizePolicyManager->setValue(internProp, qVariantValue(val)); + sizePolicyManager->setValue(internProp, qvariant_cast(val)); return; } else if (QtFontPropertyManager *fontManager = qobject_cast(manager)) { - fontManager->setValue(internProp, qVariantValue(val)); + fontManager->setValue(internProp, qvariant_cast(val)); return; #ifndef QT_NO_CURSOR } else if (QtCursorPropertyManager *cursorManager = qobject_cast(manager)) { - cursorManager->setValue(internProp, qVariantValue(val)); + cursorManager->setValue(internProp, qvariant_cast(val)); return; #endif } else if (QtFlagPropertyManager *flagManager = qobject_cast(manager)) { - flagManager->setValue(internProp, qVariantValue(val)); + flagManager->setValue(internProp, qvariant_cast(val)); return; } } @@ -1732,75 +1671,75 @@ void QtVariantPropertyManager::setAttribute(QtProperty *property, QtAbstractPropertyManager *manager = internProp->propertyManager(); if (QtIntPropertyManager *intManager = qobject_cast(manager)) { if (attribute == d_ptr->m_maximumAttribute) - intManager->setMaximum(internProp, qVariantValue(value)); + intManager->setMaximum(internProp, qvariant_cast(value)); else if (attribute == d_ptr->m_minimumAttribute) - intManager->setMinimum(internProp, qVariantValue(value)); + intManager->setMinimum(internProp, qvariant_cast(value)); else if (attribute == d_ptr->m_singleStepAttribute) - intManager->setSingleStep(internProp, qVariantValue(value)); + intManager->setSingleStep(internProp, qvariant_cast(value)); return; } else if (QtDoublePropertyManager *doubleManager = qobject_cast(manager)) { if (attribute == d_ptr->m_maximumAttribute) - doubleManager->setMaximum(internProp, qVariantValue(value)); + doubleManager->setMaximum(internProp, qvariant_cast(value)); if (attribute == d_ptr->m_minimumAttribute) - doubleManager->setMinimum(internProp, qVariantValue(value)); + doubleManager->setMinimum(internProp, qvariant_cast(value)); if (attribute == d_ptr->m_singleStepAttribute) - doubleManager->setSingleStep(internProp, qVariantValue(value)); + doubleManager->setSingleStep(internProp, qvariant_cast(value)); if (attribute == d_ptr->m_decimalsAttribute) - doubleManager->setDecimals(internProp, qVariantValue(value)); + doubleManager->setDecimals(internProp, qvariant_cast(value)); return; } else if (QtStringPropertyManager *stringManager = qobject_cast(manager)) { if (attribute == d_ptr->m_regExpAttribute) - stringManager->setRegExp(internProp, qVariantValue(value)); + stringManager->setRegExp(internProp, qvariant_cast(value)); return; } else if (QtDatePropertyManager *dateManager = qobject_cast(manager)) { if (attribute == d_ptr->m_maximumAttribute) - dateManager->setMaximum(internProp, qVariantValue(value)); + dateManager->setMaximum(internProp, qvariant_cast(value)); if (attribute == d_ptr->m_minimumAttribute) - dateManager->setMinimum(internProp, qVariantValue(value)); + dateManager->setMinimum(internProp, qvariant_cast(value)); return; } else if (QtPointFPropertyManager *pointFManager = qobject_cast(manager)) { if (attribute == d_ptr->m_decimalsAttribute) - pointFManager->setDecimals(internProp, qVariantValue(value)); + pointFManager->setDecimals(internProp, qvariant_cast(value)); return; } else if (QtSizePropertyManager *sizeManager = qobject_cast(manager)) { if (attribute == d_ptr->m_maximumAttribute) - sizeManager->setMaximum(internProp, qVariantValue(value)); + sizeManager->setMaximum(internProp, qvariant_cast(value)); if (attribute == d_ptr->m_minimumAttribute) - sizeManager->setMinimum(internProp, qVariantValue(value)); + sizeManager->setMinimum(internProp, qvariant_cast(value)); return; } else if (QtSizeFPropertyManager *sizeFManager = qobject_cast(manager)) { if (attribute == d_ptr->m_maximumAttribute) - sizeFManager->setMaximum(internProp, qVariantValue(value)); + sizeFManager->setMaximum(internProp, qvariant_cast(value)); if (attribute == d_ptr->m_minimumAttribute) - sizeFManager->setMinimum(internProp, qVariantValue(value)); + sizeFManager->setMinimum(internProp, qvariant_cast(value)); if (attribute == d_ptr->m_decimalsAttribute) - sizeFManager->setDecimals(internProp, qVariantValue(value)); + sizeFManager->setDecimals(internProp, qvariant_cast(value)); return; } else if (QtRectPropertyManager *rectManager = qobject_cast(manager)) { if (attribute == d_ptr->m_constraintAttribute) - rectManager->setConstraint(internProp, qVariantValue(value)); + rectManager->setConstraint(internProp, qvariant_cast(value)); return; } else if (QtRectFPropertyManager *rectFManager = qobject_cast(manager)) { if (attribute == d_ptr->m_constraintAttribute) - rectFManager->setConstraint(internProp, qVariantValue(value)); + rectFManager->setConstraint(internProp, qvariant_cast(value)); if (attribute == d_ptr->m_decimalsAttribute) - rectFManager->setDecimals(internProp, qVariantValue(value)); + rectFManager->setDecimals(internProp, qvariant_cast(value)); return; } else if (QtEnumPropertyManager *enumManager = qobject_cast(manager)) { if (attribute == d_ptr->m_enumNamesAttribute) - enumManager->setEnumNames(internProp, qVariantValue(value)); + enumManager->setEnumNames(internProp, qvariant_cast(value)); if (attribute == d_ptr->m_enumIconsAttribute) - enumManager->setEnumIcons(internProp, qVariantValue(value)); + enumManager->setEnumIcons(internProp, qvariant_cast(value)); return; } else if (QtFlagPropertyManager *flagManager = qobject_cast(manager)) { if (attribute == d_ptr->m_flagNamesAttribute) - flagManager->setFlagNames(internProp, qVariantValue(value)); + flagManager->setFlagNames(internProp, qvariant_cast(value)); return; } } /*! - \reimp + \internal */ bool QtVariantPropertyManager::hasValue(const QtProperty *property) const { @@ -1810,7 +1749,7 @@ bool QtVariantPropertyManager::hasValue(const QtProperty *property) const } /*! - \reimp + \internal */ QString QtVariantPropertyManager::valueText(const QtProperty *property) const { @@ -1819,7 +1758,7 @@ QString QtVariantPropertyManager::valueText(const QtProperty *property) const } /*! - \reimp + \internal */ QIcon QtVariantPropertyManager::valueIcon(const QtProperty *property) const { @@ -1828,7 +1767,7 @@ QIcon QtVariantPropertyManager::valueIcon(const QtProperty *property) const } /*! - \reimp + \internal */ void QtVariantPropertyManager::initializeProperty(QtProperty *property) { @@ -1859,7 +1798,7 @@ void QtVariantPropertyManager::initializeProperty(QtProperty *property) } /*! - \reimp + \internal */ void QtVariantPropertyManager::uninitializeProperty(QtProperty *property) { @@ -1882,7 +1821,7 @@ void QtVariantPropertyManager::uninitializeProperty(QtProperty *property) } /*! - \reimp + \internal */ QtProperty *QtVariantPropertyManager::createProperty() { @@ -1923,6 +1862,9 @@ public: /*! \class QtVariantEditorFactory + \internal + \inmodule QtDesigner + \since 4.4 \brief The QtVariantEditorFactory class provides widgets for properties created by QtVariantPropertyManager objects. @@ -1932,41 +1874,41 @@ public: \table \header - \o Property Type - \o Widget + \li Property Type + \li Widget \row - \o \c int - \o QSpinBox + \li \c int + \li QSpinBox \row - \o \c double - \o QDoubleSpinBox + \li \c double + \li QDoubleSpinBox \row - \o \c bool - \o QCheckBox + \li \c bool + \li QCheckBox \row - \o QString - \o QLineEdit + \li QString + \li QLineEdit \row - \o QDate - \o QDateEdit + \li QDate + \li QDateEdit \row - \o QTime - \o QTimeEdit + \li QTime + \li QTimeEdit \row - \o QDateTime - \o QDateTimeEdit + \li QDateTime + \li QDateTimeEdit \row - \o QKeySequence - \o customized editor + \li QKeySequence + \li customized editor \row - \o QChar - \o customized editor + \li QChar + \li customized editor \row - \o \c enum - \o QComboBox + \li \c enum + \li QComboBox \row - \o QCursor - \o QComboBox + \li QCursor + \li QComboBox \endtable Note that QtVariantPropertyManager supports several additional property @@ -1982,9 +1924,8 @@ public: Creates a factory with the given \a parent. */ QtVariantEditorFactory::QtVariantEditorFactory(QObject *parent) - : QtAbstractEditorFactory(parent) + : QtAbstractEditorFactory(parent), d_ptr(new QtVariantEditorFactoryPrivate()) { - d_ptr = new QtVariantEditorFactoryPrivate(); d_ptr->q_ptr = this; d_ptr->m_spinBoxFactory = new QtSpinBoxFactory(this); @@ -2046,7 +1987,6 @@ QtVariantEditorFactory::QtVariantEditorFactory(QObject *parent) */ QtVariantEditorFactory::~QtVariantEditorFactory() { - delete d_ptr; } /*! @@ -2056,87 +1996,87 @@ QtVariantEditorFactory::~QtVariantEditorFactory() */ void QtVariantEditorFactory::connectPropertyManager(QtVariantPropertyManager *manager) { - QList intPropertyManagers = qFindChildren(manager); + QList intPropertyManagers = manager->findChildren(); QListIterator itInt(intPropertyManagers); while (itInt.hasNext()) d_ptr->m_spinBoxFactory->addPropertyManager(itInt.next()); - QList doublePropertyManagers = qFindChildren(manager); + QList doublePropertyManagers = manager->findChildren(); QListIterator itDouble(doublePropertyManagers); while (itDouble.hasNext()) d_ptr->m_doubleSpinBoxFactory->addPropertyManager(itDouble.next()); - QList boolPropertyManagers = qFindChildren(manager); + QList boolPropertyManagers = manager->findChildren(); QListIterator itBool(boolPropertyManagers); while (itBool.hasNext()) d_ptr->m_checkBoxFactory->addPropertyManager(itBool.next()); - QList stringPropertyManagers = qFindChildren(manager); + QList stringPropertyManagers = manager->findChildren(); QListIterator itString(stringPropertyManagers); while (itString.hasNext()) d_ptr->m_lineEditFactory->addPropertyManager(itString.next()); - QList datePropertyManagers = qFindChildren(manager); + QList datePropertyManagers = manager->findChildren(); QListIterator itDate(datePropertyManagers); while (itDate.hasNext()) d_ptr->m_dateEditFactory->addPropertyManager(itDate.next()); - QList timePropertyManagers = qFindChildren(manager); + QList timePropertyManagers = manager->findChildren(); QListIterator itTime(timePropertyManagers); while (itTime.hasNext()) d_ptr->m_timeEditFactory->addPropertyManager(itTime.next()); - QList dateTimePropertyManagers = qFindChildren(manager); + QList dateTimePropertyManagers = manager->findChildren(); QListIterator itDateTime(dateTimePropertyManagers); while (itDateTime.hasNext()) d_ptr->m_dateTimeEditFactory->addPropertyManager(itDateTime.next()); - QList keySequencePropertyManagers = qFindChildren(manager); + QList keySequencePropertyManagers = manager->findChildren(); QListIterator itKeySequence(keySequencePropertyManagers); while (itKeySequence.hasNext()) d_ptr->m_keySequenceEditorFactory->addPropertyManager(itKeySequence.next()); - QList charPropertyManagers = qFindChildren(manager); + QList charPropertyManagers = manager->findChildren(); QListIterator itChar(charPropertyManagers); while (itChar.hasNext()) d_ptr->m_charEditorFactory->addPropertyManager(itChar.next()); - QList localePropertyManagers = qFindChildren(manager); + QList localePropertyManagers = manager->findChildren(); QListIterator itLocale(localePropertyManagers); while (itLocale.hasNext()) d_ptr->m_comboBoxFactory->addPropertyManager(itLocale.next()->subEnumPropertyManager()); - QList pointPropertyManagers = qFindChildren(manager); + QList pointPropertyManagers = manager->findChildren(); QListIterator itPoint(pointPropertyManagers); while (itPoint.hasNext()) d_ptr->m_spinBoxFactory->addPropertyManager(itPoint.next()->subIntPropertyManager()); - QList pointFPropertyManagers = qFindChildren(manager); + QList pointFPropertyManagers = manager->findChildren(); QListIterator itPointF(pointFPropertyManagers); while (itPointF.hasNext()) d_ptr->m_doubleSpinBoxFactory->addPropertyManager(itPointF.next()->subDoublePropertyManager()); - QList sizePropertyManagers = qFindChildren(manager); + QList sizePropertyManagers = manager->findChildren(); QListIterator itSize(sizePropertyManagers); while (itSize.hasNext()) d_ptr->m_spinBoxFactory->addPropertyManager(itSize.next()->subIntPropertyManager()); - QList sizeFPropertyManagers = qFindChildren(manager); + QList sizeFPropertyManagers = manager->findChildren(); QListIterator itSizeF(sizeFPropertyManagers); while (itSizeF.hasNext()) d_ptr->m_doubleSpinBoxFactory->addPropertyManager(itSizeF.next()->subDoublePropertyManager()); - QList rectPropertyManagers = qFindChildren(manager); + QList rectPropertyManagers = manager->findChildren(); QListIterator itRect(rectPropertyManagers); while (itRect.hasNext()) d_ptr->m_spinBoxFactory->addPropertyManager(itRect.next()->subIntPropertyManager()); - QList rectFPropertyManagers = qFindChildren(manager); + QList rectFPropertyManagers = manager->findChildren(); QListIterator itRectF(rectFPropertyManagers); while (itRectF.hasNext()) d_ptr->m_doubleSpinBoxFactory->addPropertyManager(itRectF.next()->subDoublePropertyManager()); - QList colorPropertyManagers = qFindChildren(manager); + QList colorPropertyManagers = manager->findChildren(); QListIterator itColor(colorPropertyManagers); while (itColor.hasNext()) { QtColorPropertyManager *manager = itColor.next(); @@ -2144,12 +2084,12 @@ void QtVariantEditorFactory::connectPropertyManager(QtVariantPropertyManager *ma d_ptr->m_spinBoxFactory->addPropertyManager(manager->subIntPropertyManager()); } - QList enumPropertyManagers = qFindChildren(manager); + QList enumPropertyManagers = manager->findChildren(); QListIterator itEnum(enumPropertyManagers); while (itEnum.hasNext()) d_ptr->m_comboBoxFactory->addPropertyManager(itEnum.next()); - QList sizePolicyPropertyManagers = qFindChildren(manager); + QList sizePolicyPropertyManagers = manager->findChildren(); QListIterator itSizePolicy(sizePolicyPropertyManagers); while (itSizePolicy.hasNext()) { QtSizePolicyPropertyManager *manager = itSizePolicy.next(); @@ -2157,7 +2097,7 @@ void QtVariantEditorFactory::connectPropertyManager(QtVariantPropertyManager *ma d_ptr->m_comboBoxFactory->addPropertyManager(manager->subEnumPropertyManager()); } - QList fontPropertyManagers = qFindChildren(manager); + QList fontPropertyManagers = manager->findChildren(); QListIterator itFont(fontPropertyManagers); while (itFont.hasNext()) { QtFontPropertyManager *manager = itFont.next(); @@ -2167,12 +2107,12 @@ void QtVariantEditorFactory::connectPropertyManager(QtVariantPropertyManager *ma d_ptr->m_checkBoxFactory->addPropertyManager(manager->subBoolPropertyManager()); } - QList cursorPropertyManagers = qFindChildren(manager); + QList cursorPropertyManagers = manager->findChildren(); QListIterator itCursor(cursorPropertyManagers); while (itCursor.hasNext()) d_ptr->m_cursorEditorFactory->addPropertyManager(itCursor.next()); - QList flagPropertyManagers = qFindChildren(manager); + QList flagPropertyManagers = manager->findChildren(); QListIterator itFlag(flagPropertyManagers); while (itFlag.hasNext()) d_ptr->m_checkBoxFactory->addPropertyManager(itFlag.next()->subBoolPropertyManager()); @@ -2200,87 +2140,87 @@ QWidget *QtVariantEditorFactory::createEditor(QtVariantPropertyManager *manager, */ void QtVariantEditorFactory::disconnectPropertyManager(QtVariantPropertyManager *manager) { - QList intPropertyManagers = qFindChildren(manager); + QList intPropertyManagers = manager->findChildren(); QListIterator itInt(intPropertyManagers); while (itInt.hasNext()) d_ptr->m_spinBoxFactory->removePropertyManager(itInt.next()); - QList doublePropertyManagers = qFindChildren(manager); + QList doublePropertyManagers = manager->findChildren(); QListIterator itDouble(doublePropertyManagers); while (itDouble.hasNext()) d_ptr->m_doubleSpinBoxFactory->removePropertyManager(itDouble.next()); - QList boolPropertyManagers = qFindChildren(manager); + QList boolPropertyManagers = manager->findChildren(); QListIterator itBool(boolPropertyManagers); while (itBool.hasNext()) d_ptr->m_checkBoxFactory->removePropertyManager(itBool.next()); - QList stringPropertyManagers = qFindChildren(manager); + QList stringPropertyManagers = manager->findChildren(); QListIterator itString(stringPropertyManagers); while (itString.hasNext()) d_ptr->m_lineEditFactory->removePropertyManager(itString.next()); - QList datePropertyManagers = qFindChildren(manager); + QList datePropertyManagers = manager->findChildren(); QListIterator itDate(datePropertyManagers); while (itDate.hasNext()) d_ptr->m_dateEditFactory->removePropertyManager(itDate.next()); - QList timePropertyManagers = qFindChildren(manager); + QList timePropertyManagers = manager->findChildren(); QListIterator itTime(timePropertyManagers); while (itTime.hasNext()) d_ptr->m_timeEditFactory->removePropertyManager(itTime.next()); - QList dateTimePropertyManagers = qFindChildren(manager); + QList dateTimePropertyManagers = manager->findChildren(); QListIterator itDateTime(dateTimePropertyManagers); while (itDateTime.hasNext()) d_ptr->m_dateTimeEditFactory->removePropertyManager(itDateTime.next()); - QList keySequencePropertyManagers = qFindChildren(manager); + QList keySequencePropertyManagers = manager->findChildren(); QListIterator itKeySequence(keySequencePropertyManagers); while (itKeySequence.hasNext()) d_ptr->m_keySequenceEditorFactory->removePropertyManager(itKeySequence.next()); - QList charPropertyManagers = qFindChildren(manager); + QList charPropertyManagers = manager->findChildren(); QListIterator itChar(charPropertyManagers); while (itChar.hasNext()) d_ptr->m_charEditorFactory->removePropertyManager(itChar.next()); - QList localePropertyManagers = qFindChildren(manager); + QList localePropertyManagers = manager->findChildren(); QListIterator itLocale(localePropertyManagers); while (itLocale.hasNext()) d_ptr->m_comboBoxFactory->removePropertyManager(itLocale.next()->subEnumPropertyManager()); - QList pointPropertyManagers = qFindChildren(manager); + QList pointPropertyManagers = manager->findChildren(); QListIterator itPoint(pointPropertyManagers); while (itPoint.hasNext()) d_ptr->m_spinBoxFactory->removePropertyManager(itPoint.next()->subIntPropertyManager()); - QList pointFPropertyManagers = qFindChildren(manager); + QList pointFPropertyManagers = manager->findChildren(); QListIterator itPointF(pointFPropertyManagers); while (itPointF.hasNext()) d_ptr->m_doubleSpinBoxFactory->removePropertyManager(itPointF.next()->subDoublePropertyManager()); - QList sizePropertyManagers = qFindChildren(manager); + QList sizePropertyManagers = manager->findChildren(); QListIterator itSize(sizePropertyManagers); while (itSize.hasNext()) d_ptr->m_spinBoxFactory->removePropertyManager(itSize.next()->subIntPropertyManager()); - QList sizeFPropertyManagers = qFindChildren(manager); + QList sizeFPropertyManagers = manager->findChildren(); QListIterator itSizeF(sizeFPropertyManagers); while (itSizeF.hasNext()) d_ptr->m_doubleSpinBoxFactory->removePropertyManager(itSizeF.next()->subDoublePropertyManager()); - QList rectPropertyManagers = qFindChildren(manager); + QList rectPropertyManagers = manager->findChildren(); QListIterator itRect(rectPropertyManagers); while (itRect.hasNext()) d_ptr->m_spinBoxFactory->removePropertyManager(itRect.next()->subIntPropertyManager()); - QList rectFPropertyManagers = qFindChildren(manager); + QList rectFPropertyManagers = manager->findChildren(); QListIterator itRectF(rectFPropertyManagers); while (itRectF.hasNext()) d_ptr->m_doubleSpinBoxFactory->removePropertyManager(itRectF.next()->subDoublePropertyManager()); - QList colorPropertyManagers = qFindChildren(manager); + QList colorPropertyManagers = manager->findChildren(); QListIterator itColor(colorPropertyManagers); while (itColor.hasNext()) { QtColorPropertyManager *manager = itColor.next(); @@ -2288,12 +2228,12 @@ void QtVariantEditorFactory::disconnectPropertyManager(QtVariantPropertyManager d_ptr->m_spinBoxFactory->removePropertyManager(manager->subIntPropertyManager()); } - QList enumPropertyManagers = qFindChildren(manager); + QList enumPropertyManagers = manager->findChildren(); QListIterator itEnum(enumPropertyManagers); while (itEnum.hasNext()) d_ptr->m_comboBoxFactory->removePropertyManager(itEnum.next()); - QList sizePolicyPropertyManagers = qFindChildren(manager); + QList sizePolicyPropertyManagers = manager->findChildren(); QListIterator itSizePolicy(sizePolicyPropertyManagers); while (itSizePolicy.hasNext()) { QtSizePolicyPropertyManager *manager = itSizePolicy.next(); @@ -2301,7 +2241,7 @@ void QtVariantEditorFactory::disconnectPropertyManager(QtVariantPropertyManager d_ptr->m_comboBoxFactory->removePropertyManager(manager->subEnumPropertyManager()); } - QList fontPropertyManagers = qFindChildren(manager); + QList fontPropertyManagers = manager->findChildren(); QListIterator itFont(fontPropertyManagers); while (itFont.hasNext()) { QtFontPropertyManager *manager = itFont.next(); @@ -2311,19 +2251,17 @@ void QtVariantEditorFactory::disconnectPropertyManager(QtVariantPropertyManager d_ptr->m_checkBoxFactory->removePropertyManager(manager->subBoolPropertyManager()); } - QList cursorPropertyManagers = qFindChildren(manager); + QList cursorPropertyManagers = manager->findChildren(); QListIterator itCursor(cursorPropertyManagers); while (itCursor.hasNext()) d_ptr->m_cursorEditorFactory->removePropertyManager(itCursor.next()); - QList flagPropertyManagers = qFindChildren(manager); + QList flagPropertyManagers = manager->findChildren(); QListIterator itFlag(flagPropertyManagers); while (itFlag.hasNext()) d_ptr->m_checkBoxFactory->removePropertyManager(itFlag.next()->subBoolPropertyManager()); } -#if QT_VERSION >= 0x040400 QT_END_NAMESPACE -#endif -#include "moc_qtvariantproperty.cxx" +#include "moc_qtvariantproperty.cpp" diff --git a/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.h b/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.h index 9f20d3dd4..23ee87323 100644 --- a/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.h +++ b/code/studio/src/3rdparty/qtpropertybrowser/qtvariantproperty.h @@ -1,62 +1,18 @@ /**************************************************************************** ** -** This file is part of a Qt Solutions component. -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Solutions Commercial License Agreement provided -** with the Software or, alternatively, in accordance with the terms -** contained in a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** Please note Third Party Software included with Qt Solutions may impose -** additional restrictions and it is the user's responsibility to ensure -** that they have met the licensing requirements of the GPL, LGPL, or Qt -** Solutions Commercial license and the relevant license of the Third -** Party Software they are using. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -****************************************************************************/ - -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal ** ** This file is part of the tools applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -66,10 +22,9 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU @@ -79,8 +34,7 @@ ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. +** ** $QT_END_LICENSE$ ** ****************************************************************************/ @@ -89,19 +43,16 @@ #define QTVARIANTPROPERTY_H #include "qtpropertybrowser.h" -#include -#include +#include +#include -#if QT_VERSION >= 0x040400 QT_BEGIN_NAMESPACE -#endif typedef QMap QtIconMap; class QtVariantPropertyManager; -class QtVariantPropertyPrivate; -class QT_QTPROPERTYBROWSER_EXPORT QtVariantProperty : public QtProperty +class QtVariantProperty : public QtProperty { public: ~QtVariantProperty(); @@ -116,12 +67,10 @@ protected: QtVariantProperty(QtVariantPropertyManager *manager); private: friend class QtVariantPropertyManager; - QtVariantPropertyPrivate *d_ptr; + QScopedPointer d_ptr; }; -class QtVariantPropertyManagerPrivate; - -class QT_QTPROPERTYBROWSER_EXPORT QtVariantPropertyManager : public QtAbstractPropertyManager +class QtVariantPropertyManager : public QtAbstractPropertyManager { Q_OBJECT public: @@ -162,7 +111,7 @@ protected: virtual void uninitializeProperty(QtProperty *property); virtual QtProperty *createProperty(); private: - QtVariantPropertyManagerPrivate *d_ptr; + QScopedPointer d_ptr; Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, int)) Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *, int, int)) Q_PRIVATE_SLOT(d_func(), void slotSingleStepChanged(QtProperty *, int)) @@ -204,9 +153,7 @@ private: Q_DISABLE_COPY(QtVariantPropertyManager) }; -class QtVariantEditorFactoryPrivate; - -class QT_QTPROPERTYBROWSER_EXPORT QtVariantEditorFactory : public QtAbstractEditorFactory +class QtVariantEditorFactory : public QtAbstractEditorFactory { Q_OBJECT public: @@ -218,14 +165,12 @@ protected: QWidget *parent); void disconnectPropertyManager(QtVariantPropertyManager *manager); private: - QtVariantEditorFactoryPrivate *d_ptr; + QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QtVariantEditorFactory) Q_DISABLE_COPY(QtVariantEditorFactory) }; -#if QT_VERSION >= 0x040400 QT_END_NAMESPACE -#endif Q_DECLARE_METATYPE(QIcon) Q_DECLARE_METATYPE(QtIconMap) diff --git a/code/studio/src/CMakeLists.txt b/code/studio/src/CMakeLists.txt index 9bc071bf2..8f922eeba 100644 --- a/code/studio/src/CMakeLists.txt +++ b/code/studio/src/CMakeLists.txt @@ -1,7 +1,9 @@ -ADD_SUBDIRECTORY(3rdparty) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${QT_INCLUDES}) -INCLUDE( ${QT_USE_FILE} ) + +IF(WITH_QT) + INCLUDE(${QT_USE_FILE}) +ENDIF(WITH_QT) CONFIGURE_FILE(translations/translations.qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc COPYONLY) @@ -31,30 +33,54 @@ IF(WIN32) SET(STUDIO_RC studio.rc) ENDIF(WIN32) -QT4_ADD_TRANSLATION(STUDIO_QM ${STUDIO_TS}) -QT4_ADD_RESOURCES( STUDIO_RC_SRCS ${STUDIO_RCS}) -QT4_WRAP_CPP( STUDIO_MOC_SRCS ${STUDIO_HDR} ) -QT4_WRAP_UI( STUDIO_PLUGIN_UI_HDRS ${STUDIO_PLUGIN_UIS}) +IF(WITH_QT5) + SET(CMAKE_AUTOMOC ON) + QT5_ADD_TRANSLATION(STUDIO_QM ${STUDIO_TS}) + QT5_ADD_RESOURCES( STUDIO_RC_SRCS ${STUDIO_RCS}) + QT5_WRAP_CPP( STUDIO_MOC_SRCS ${STUDIO_HDR} ) + QT5_WRAP_UI( STUDIO_PLUGIN_UI_HDRS ${STUDIO_PLUGIN_UIS}) +ELSE(WITH_QT5) + QT4_ADD_TRANSLATION(STUDIO_QM ${STUDIO_TS}) + QT4_ADD_RESOURCES( STUDIO_RC_SRCS ${STUDIO_RCS}) + QT4_WRAP_CPP( STUDIO_MOC_SRCS ${STUDIO_HDR} ) + QT4_WRAP_UI( STUDIO_PLUGIN_UI_HDRS ${STUDIO_PLUGIN_UIS}) +ENDIF(WITH_QT5) SOURCE_GROUP(QtResources FILES ${STUDIO_RCS} ${STUDIO_PLUGIN_UIS} ) SOURCE_GROUP(QtGeneratedMocQrcSrc FILES ${STUDIO_MOC_SRCS} ${STUDIO_RC_SRCS}) +IF(WITH_QT5) +ADD_EXECUTABLE(studio WIN32 MACOSX_BUNDLE + ${STUDIO_SRC} + ${STUDIO_RC_SRCS} + ${STUDIO_RC} + ${STUDIO_PLUGIN_UIS}) +ELSE(WITH_QT5) ADD_EXECUTABLE(studio WIN32 MACOSX_BUNDLE - ${STUDIO_SRC} - ${STUDIO_MOC_SRCS} - ${STUDIO_RC_SRCS} - ${STUDIO_RC} - ${STUDIO_PLUGIN_UIS} ) + ${STUDIO_SRC} + ${STUDIO_MOC_SRCS} + ${STUDIO_RC_SRCS} + ${STUDIO_RC} + ${STUDIO_PLUGIN_UIS}) +ENDIF(WITH_QT5) TARGET_LINK_LIBRARIES(studio - nelmisc + nelmisc) + +IF(WITH_QT5) + TARGET_LINK_LIBRARIES(studio + Qt5::Widgets) +ELSE(WITH_QT5) + TARGET_LINK_LIBRARIES(studio ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY}) +ENDIF(WITH_QT5) -ADD_DEFINITIONS(-DQT_NO_KEYWORDS ${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${QT_DEFINITIONS}) NL_DEFAULT_PROPS(studio "Tools: Studio") NL_ADD_RUNTIME_FLAGS(studio) -ADD_SUBDIRECTORY(plugins) +ADD_SUBDIRECTORY(3rdparty) +#ADD_SUBDIRECTORY(plugins) INSTALL(TARGETS studio RUNTIME DESTINATION ${NL_BIN_PREFIX} COMPONENT runtime BUNDLE DESTINATION /Applications) diff --git a/code/studio/src/extension_system/plugin_spec.cpp b/code/studio/src/extension_system/plugin_spec.cpp index 97a08ea64..8f23db976 100644 --- a/code/studio/src/extension_system/plugin_spec.cpp +++ b/code/studio/src/extension_system/plugin_spec.cpp @@ -427,7 +427,7 @@ void PluginSpec::kill() bool b = loader->unload(); if( !b ) { - nlinfo( "Plugin %s couldn't be unloaded.", this->m_name.toAscii().data() ); + nlinfo( "Plugin %s couldn't be unloaded.", this->m_name.toLocal8Bit().data() ); } //delete m_plugin; diff --git a/code/studio/src/main.cpp b/code/studio/src/main.cpp index e758037c0..2a3bf7740 100644 --- a/code/studio/src/main.cpp +++ b/code/studio/src/main.cpp @@ -35,11 +35,11 @@ #include #include #include -#include -#include +#include +#include //#include -#include -#include +#include +#include #include "settings_dialog.h" #include "splash_screen.h" @@ -137,7 +137,7 @@ int main(int argc, char **argv) nlinfo("Welcome to NeL Object Viewer Qt!"); } - QApplication::setGraphicsSystem("raster"); + #ifdef NL_OS_WINDOWS QApplication app(__argc, __argv); #else // NL_OS_WINDOWS