Multi-Qt building

git-svn-id: svn://db.shs.com.ru/libs@250 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
2017-08-03 08:09:44 +00:00
parent 96935ebb4a
commit 0834c45c90
78 changed files with 410 additions and 249 deletions

View File

@@ -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()

View File

@@ -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();
}

View File

@@ -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 & )));