git-svn-id: svn://db.shs.com.ru/libs@468 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -9,18 +9,14 @@ macro(sdk_install _DIR _TARGET _H_FILES _QM_FILES)
|
|||||||
qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_LIB})
|
qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_LIB})
|
||||||
qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_BIN})
|
qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_BIN})
|
||||||
qt_install(TARGETS ${_TARGET} DESTINATION QtBin)
|
qt_install(TARGETS ${_TARGET} DESTINATION QtBin)
|
||||||
if(NOT "x${_QM_FILES}" STREQUAL "x")
|
|
||||||
qt_install(FILES ${_QM_FILES} DESTINATION QtLang)
|
qt_install(FILES ${_QM_FILES} DESTINATION QtLang)
|
||||||
endif()
|
|
||||||
else()
|
else()
|
||||||
if (NOT "x${_H_FILES}" STREQUAL "x")
|
if (NOT "x${_H_FILES}" STREQUAL "x")
|
||||||
install(FILES ${_H_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${_DIR})
|
install(FILES ${_H_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${_DIR})
|
||||||
endif()
|
endif()
|
||||||
qt_install(TARGETS ${_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
qt_install(TARGETS ${_TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
|
||||||
if(NOT "x${_QM_FILES}" STREQUAL "x")
|
|
||||||
qt_install(FILES ${_QM_FILES} DESTINATION QtLang)
|
qt_install(FILES ${_QM_FILES} DESTINATION QtLang)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
#message(STATUS "Install ${_TARGET} to system \"${CMAKE_INSTALL_PREFIX}\"")
|
#message(STATUS "Install ${_TARGET} to system \"${CMAKE_INSTALL_PREFIX}\"")
|
||||||
else()
|
else()
|
||||||
qt_install(TARGETS ${_TARGET} DESTINATION bin)
|
qt_install(TARGETS ${_TARGET} DESTINATION bin)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ macro(qad_install _TARGET _H_FILES _QM_FILES)
|
|||||||
qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_LIB})
|
qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_LIB})
|
||||||
qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_BIN})
|
qt_install(TARGETS ${_TARGET} DESTINATION ${MINGW_BIN})
|
||||||
qt_install(TARGETS ${_TARGET} DESTINATION QtBin)
|
qt_install(TARGETS ${_TARGET} DESTINATION QtBin)
|
||||||
qt_install(FILES ${_QM_FILES} DESTINATION QtLang)
|
qt_install(FILES "${_QM_FILES}" DESTINATION QtLang)
|
||||||
else()
|
else()
|
||||||
if(NOT _H_FILES STREQUAL "")
|
if(NOT _H_FILES STREQUAL "")
|
||||||
install(FILES ${_H_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/qad)
|
install(FILES ${_H_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/qad)
|
||||||
|
|||||||
@@ -296,6 +296,7 @@ macro(qt_wrap)
|
|||||||
qt4_wrap_ui(CUIS${_v} ${UI_LIST})
|
qt4_wrap_ui(CUIS${_v} ${UI_LIST})
|
||||||
qt4_add_resources(CRES${_v} ${RES_LIST})
|
qt4_add_resources(CRES${_v} ${RES_LIST})
|
||||||
if (WAS_QM_ARG)
|
if (WAS_QM_ARG)
|
||||||
|
set(${QM${_v}_VAR} "")
|
||||||
qt4_add_translation(${QM${_v}_VAR} ${TS_LIST})
|
qt4_add_translation(${QM${_v}_VAR} ${TS_LIST})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
@@ -304,6 +305,7 @@ macro(qt_wrap)
|
|||||||
qt5_wrap_ui(CUIS${_v} ${UI_LIST})
|
qt5_wrap_ui(CUIS${_v} ${UI_LIST})
|
||||||
qt5_add_resources(CRES${_v} ${RES_LIST})
|
qt5_add_resources(CRES${_v} ${RES_LIST})
|
||||||
if (WAS_QM_ARG)
|
if (WAS_QM_ARG)
|
||||||
|
set(${QM${_v}_VAR} "")
|
||||||
qt5_add_translation(${QM${_v}_VAR} ${TS_LIST})
|
qt5_add_translation(${QM${_v}_VAR} ${TS_LIST})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
@@ -442,6 +444,7 @@ macro(qt_install)
|
|||||||
set(_IS_FILES 0)
|
set(_IS_FILES 0)
|
||||||
set(_IS_DEST 0)
|
set(_IS_DEST 0)
|
||||||
set(_IS_LANG 0)
|
set(_IS_LANG 0)
|
||||||
|
set(_INVALID 0)
|
||||||
foreach(_i ${ARGN})
|
foreach(_i ${ARGN})
|
||||||
if ("x${_i}" STREQUAL "xQtLang")
|
if ("x${_i}" STREQUAL "xQtLang")
|
||||||
set(_IS_LANG 1)
|
set(_IS_LANG 1)
|
||||||
@@ -460,7 +463,8 @@ macro(qt_install)
|
|||||||
set(_IS_FILES 0)
|
set(_IS_FILES 0)
|
||||||
if (_IS_LANG)
|
if (_IS_LANG)
|
||||||
if (("x${${_i}_Qt${_v}}" STREQUAL "x") OR ("x${_i}" STREQUAL "xDESTINATION"))
|
if (("x${${_i}_Qt${_v}}" STREQUAL "x") OR ("x${_i}" STREQUAL "xDESTINATION"))
|
||||||
return()
|
#return()
|
||||||
|
set(_INVALID 1)
|
||||||
else()
|
else()
|
||||||
set(_INST_LIST ${_INST_LIST} ${${_i}_Qt${_v}})
|
set(_INST_LIST ${_INST_LIST} ${${_i}_Qt${_v}})
|
||||||
endif()
|
endif()
|
||||||
@@ -503,11 +507,13 @@ macro(qt_install)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
if (NOT _INVALID)
|
||||||
if (NOT ("x${_prev_inst}" STREQUAL "x${_INST_LIST}"))
|
if (NOT ("x${_prev_inst}" STREQUAL "x${_INST_LIST}"))
|
||||||
#message("install: ${_INST_LIST}")
|
#message("install: ${_INST_LIST}")
|
||||||
install(${_INST_LIST})
|
install(${_INST_LIST})
|
||||||
set(_prev_inst "${_INST_LIST}")
|
set(_prev_inst "${_INST_LIST}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|||||||
21
qad/touch_widgets/plugin/qad_touch_widgets.cpp
Normal file
21
qad/touch_widgets/plugin/qad_touch_widgets.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include "qad_touch_widgets.h"
|
||||||
|
#include "touchsliderplugin.h"
|
||||||
|
#include "touchbuttframeplugin.h"
|
||||||
|
#include "touchbuttonplugin.h"
|
||||||
|
|
||||||
|
|
||||||
|
QADTouchWidgets::QADTouchWidgets(QObject * parent): QObject(parent) {
|
||||||
|
m_widgets.append(new TouchSliderPlugin(this));
|
||||||
|
m_widgets.append(new TouchButtFramePlugin(this));
|
||||||
|
m_widgets.append(new TouchButtonPlugin(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QList<QDesignerCustomWidgetInterface*> QADTouchWidgets::customWidgets() const {
|
||||||
|
return m_widgets;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if QT_VERSION < 0x050000
|
||||||
|
Q_EXPORT_PLUGIN2(qad_touch_widgets_plugin, QADTouchWidgets)
|
||||||
|
#endif
|
||||||
23
qad/touch_widgets/plugin/qad_touch_widgets.h
Normal file
23
qad/touch_widgets/plugin/qad_touch_widgets.h
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef QAD_TOUCH_WIDGETS_H
|
||||||
|
#define QAD_TOUCH_WIDGETS_H
|
||||||
|
|
||||||
|
#include <QtDesigner/QtDesigner>
|
||||||
|
#include <QtCore/qplugin.h>
|
||||||
|
|
||||||
|
class QADTouchWidgets: public QObject, public QDesignerCustomWidgetCollectionInterface
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
Q_PLUGIN_METADATA(IID "qad.touch_widgets")
|
||||||
|
#endif
|
||||||
|
public:
|
||||||
|
explicit QADTouchWidgets(QObject *parent = 0);
|
||||||
|
virtual QList<QDesignerCustomWidgetInterface * > customWidgets() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QList<QDesignerCustomWidgetInterface * > m_widgets;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QAD_TOUCH_WIDGETS_H
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#include "touch_widgets.h"
|
|
||||||
#include "touchsliderplugin.h"
|
|
||||||
#include "touchbuttframeplugin.h"
|
|
||||||
#include "touchbuttonplugin.h"
|
|
||||||
|
|
||||||
TW::TW(QObject *parent)
|
|
||||||
: QObject(parent)
|
|
||||||
{
|
|
||||||
m_widgets.append(new TouchSliderPlugin(this));
|
|
||||||
m_widgets.append(new TouchButtFramePlugin(this));
|
|
||||||
m_widgets.append(new TouchButtonPlugin(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<QDesignerCustomWidgetInterface*> TW::customWidgets() const
|
|
||||||
{
|
|
||||||
return m_widgets;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
|
||||||
Q_EXPORT_PLUGIN2(twplugin, TW)
|
|
||||||
#endif
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#ifndef TW_H
|
|
||||||
#define TW_H
|
|
||||||
|
|
||||||
#include <QtDesigner/QtDesigner>
|
|
||||||
#include <QtCore/qplugin.h>
|
|
||||||
|
|
||||||
class TW : public QObject, public QDesignerCustomWidgetCollectionInterface
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
Q_PLUGIN_METADATA(IID "qad.touch_widgets")
|
|
||||||
#endif
|
|
||||||
public:
|
|
||||||
explicit TW(QObject *parent = 0);
|
|
||||||
|
|
||||||
virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
QList<QDesignerCustomWidgetInterface*> m_widgets;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -10,6 +10,30 @@
|
|||||||
|
|
||||||
bool __QADTypesRegistrator__::_inited = false;
|
bool __QADTypesRegistrator__::_inited = false;
|
||||||
|
|
||||||
|
__QADTypesRegistrator__::__QADTypesRegistrator__() {
|
||||||
|
if (_inited) return;
|
||||||
|
_inited = true;
|
||||||
|
qRegisterMetaType<QAD::Enumerator>("QAD::Enumerator");
|
||||||
|
qRegisterMetaTypeStreamOperators<QAD::Enumerator>("QAD::Enumerator");
|
||||||
|
qRegisterMetaType<QAD::Enum>("QAD::Enum");
|
||||||
|
qRegisterMetaTypeStreamOperators<QAD::Enum>("QAD::Enum");
|
||||||
|
|
||||||
|
qRegisterMetaType<QAD::File>("QAD::File");
|
||||||
|
qRegisterMetaTypeStreamOperators<QAD::File>("QAD::File");
|
||||||
|
|
||||||
|
qRegisterMetaType<QAD::Dir>("QAD::Dir");
|
||||||
|
qRegisterMetaTypeStreamOperators<QAD::Dir>("QAD::Dir");
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050200
|
||||||
|
QMetaType::registerConverter<QAD::Enum, int>(&QAD::Enum::selectedValue);
|
||||||
|
QMetaType::registerConverter<QAD::Enum, QString>(&QAD::Enum::selectedName);
|
||||||
|
QMetaType::registerConverter<QAD::File, QString>(&QAD::File::toString);
|
||||||
|
QMetaType::registerConverter<QAD::Dir, QString>(&QAD::Dir::toString);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
__QADTypesRegistrator__ __registrator__;
|
||||||
|
|
||||||
|
|
||||||
int QAD::Enum::selectedValue() const {
|
int QAD::Enum::selectedValue() const {
|
||||||
foreach (const Enumerator & e, enum_list)
|
foreach (const Enumerator & e, enum_list)
|
||||||
|
|||||||
@@ -77,32 +77,10 @@ inline QDebug operator <<(QDebug s, const QAD::Dir & v) {s.nospace() << v.dir; r
|
|||||||
|
|
||||||
class __QADTypesRegistrator__ {
|
class __QADTypesRegistrator__ {
|
||||||
public:
|
public:
|
||||||
__QADTypesRegistrator__() {
|
__QADTypesRegistrator__();
|
||||||
if (_inited) return;
|
|
||||||
_inited = true;
|
|
||||||
qRegisterMetaType<QAD::Enumerator>("QAD::Enumerator");
|
|
||||||
qRegisterMetaTypeStreamOperators<QAD::Enumerator>("QAD::Enumerator");
|
|
||||||
qRegisterMetaType<QAD::Enum>("QAD::Enum");
|
|
||||||
qRegisterMetaTypeStreamOperators<QAD::Enum>("QAD::Enum");
|
|
||||||
|
|
||||||
qRegisterMetaType<QAD::File>("QAD::File");
|
|
||||||
qRegisterMetaTypeStreamOperators<QAD::File>("QAD::File");
|
|
||||||
|
|
||||||
qRegisterMetaType<QAD::Dir>("QAD::Dir");
|
|
||||||
qRegisterMetaTypeStreamOperators<QAD::Dir>("QAD::Dir");
|
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050200
|
|
||||||
QMetaType::registerConverter<QAD::Enum, int>(&QAD::Enum::selectedValue);
|
|
||||||
QMetaType::registerConverter<QAD::Enum, QString>(&QAD::Enum::selectedName);
|
|
||||||
QMetaType::registerConverter<QAD::File, QString>(&QAD::File::toString);
|
|
||||||
QMetaType::registerConverter<QAD::Dir, QString>(&QAD::Dir::toString);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
static bool _inited;
|
static bool _inited;
|
||||||
};
|
};
|
||||||
|
|
||||||
static __QADTypesRegistrator__ __registrator__;
|
|
||||||
|
|
||||||
|
|
||||||
inline qreal quantize(qreal x, qreal q = 10.f) {return qRound(x / q) * q;}
|
inline qreal quantize(qreal x, qreal q = 10.f) {return qRound(x / q) * q;}
|
||||||
inline QPointF quantize(QPointF x, qreal q = 10.f) {return QPointF(quantize(x.x(), q), quantize(x.y(), q));}
|
inline QPointF quantize(QPointF x, qreal q = 10.f) {return QPointF(quantize(x.x(), q), quantize(x.y(), q));}
|
||||||
|
|||||||
Reference in New Issue
Block a user