Multi-Qt building
git-svn-id: svn://db.shs.com.ru/libs@250 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
set(LIBS ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${OPENGL_LIBRARIES} qad_widgets qad_utils)
|
||||
qad_project(graphic "${LIBS}")
|
||||
qad_project(graphic "Gui;Widgets;OpenGL" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}")
|
||||
add_subdirectory(qpicalculator)
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "ui_graphic.h"
|
||||
#include "ui_graphic_conf.h"
|
||||
#if QT_VERSION >= 0x050100
|
||||
# include <QSensorGestureManager>
|
||||
//# include <QSensorGestureManager>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
qad_plugin(graphic "")
|
||||
qad_plugin(graphic "Gui;Widgets;OpenGL" "")
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#ifndef GRAPHICPLUGIN_H
|
||||
#define GRAPHICPLUGIN_H
|
||||
|
||||
#include <QDesignerCustomWidgetInterface>
|
||||
#if QT_VERSION >= 0x050000
|
||||
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
|
||||
#else
|
||||
# include <QDesignerCustomWidgetInterface>
|
||||
#endif
|
||||
|
||||
class GraphicPlugin: public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "graphicplugin.h"
|
||||
#include "qad_graphic.h"
|
||||
#include "graphicplugin.h"
|
||||
|
||||
QADGraphic::QADGraphic(QObject * parent): QObject(parent)
|
||||
{
|
||||
@@ -11,4 +11,7 @@ QList<QDesignerCustomWidgetInterface * > QADGraphic::customWidgets() const {
|
||||
return m_widgets;
|
||||
}
|
||||
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
Q_EXPORT_PLUGIN2(qad_graphic_plugin, QADGraphic)
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,9 @@ class QADGraphic: public QObject, public QDesignerCustomWidgetCollectionInterfac
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
Q_PLUGIN_METADATA(IID "qad.graphic")
|
||||
#endif
|
||||
public:
|
||||
explicit QADGraphic(QObject * parent = 0);
|
||||
virtual QList<QDesignerCustomWidgetInterface * > customWidgets() const;
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
qt_project(qpicalc QPICALC_H QPICALC_H)
|
||||
add_executable(${PROJECT_NAME} WIN32 ${QPICALC_H} ${QPICALC_H})
|
||||
set(LIBS ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} qad_widgets qad_utils qad_graphic)
|
||||
target_link_libraries(${PROJECT_NAME} ${LIBS})
|
||||
project(qpicalc)
|
||||
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
|
||||
find_qt(${QtVersions} Core Gui Widgets)
|
||||
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
||||
qt_add_executable(${PROJECT_NAME} WIN32 out_CPP)
|
||||
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_graphic)
|
||||
message(STATUS "Building ${PROJECT_NAME}")
|
||||
if(LIB)
|
||||
if(WIN32)
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN})
|
||||
qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN})
|
||||
else()
|
||||
if(APPLE)
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin)
|
||||
qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin)
|
||||
else()
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin)
|
||||
qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin)
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"")
|
||||
#message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"")
|
||||
else()
|
||||
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
|
||||
message(STATUS "Install ${PROJECT_NAME} to local \"bin\"")
|
||||
qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin)
|
||||
#message(STATUS "Install ${PROJECT_NAME} to local \"bin\"")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include <QtGui/QApplication>
|
||||
#include <QApplication>
|
||||
#include "mainwindow.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
@@ -5,8 +5,13 @@ MainWindow::MainWindow(QWidget * parent): QMainWindow(parent), Ui::MainWindow()
|
||||
setupUi(this);
|
||||
active_ = false;
|
||||
lineInput->setFocus();
|
||||
#if QT_VERSION >= 0x050000
|
||||
treeGraphics->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
treeGraphics->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
||||
#else
|
||||
treeGraphics->header()->setResizeMode(0, QHeaderView::ResizeToContents);
|
||||
treeGraphics->header()->setResizeMode(1, QHeaderView::ResizeToContents);
|
||||
#endif
|
||||
npal = epal = lineInput->palette();
|
||||
epal.setColor(lineInput->backgroundRole(), QColor(Qt::red).lighter(150));
|
||||
connect(&session, SIGNAL(loading(QPIConfig & )), this, SLOT(loading(QPIConfig & )));
|
||||
|
||||
Reference in New Issue
Block a user