Compare commits
19 Commits
97a0bad71d
...
concurrent
| Author | SHA1 | Date | |
|---|---|---|---|
| a29302e2e6 | |||
| a5e5c289db | |||
| a49aeda257 | |||
| 79db8ea408 | |||
| c359ba34a6 | |||
| 760c57a843 | |||
| 61316462fa | |||
| 4e3baadd70 | |||
| 8324776fb8 | |||
| 65f3cc0698 | |||
| b72ef08892 | |||
| 8363ad29ef | |||
| ab4f2a3d40 | |||
| 754d46a250 | |||
| ba5a30a7dd | |||
| 50efa51975 | |||
| 8bb52f59fe | |||
| 3acec2297b | |||
| d39488397c |
@@ -102,7 +102,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(F ${PIP_FOLDERS})
|
foreach(F ${PIP_FOLDERS})
|
||||||
list(APPEND PIP_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/pip/src_main/${F}")
|
list(APPEND PIP_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/pip/lib/main/${F}")
|
||||||
endforeach(F)
|
endforeach(F)
|
||||||
#message(${PIP_INCLUDES})
|
#message(${PIP_INCLUDES})
|
||||||
if(CMAKE_CROSSCOMPILING OR (DEFINED ANDROID_PLATFORM))
|
if(CMAKE_CROSSCOMPILING OR (DEFINED ANDROID_PLATFORM))
|
||||||
@@ -156,6 +156,7 @@ else()
|
|||||||
add_subdirectory(qad)
|
add_subdirectory(qad)
|
||||||
set(_DIRS piqt piqt_utils qcd_utils)
|
set(_DIRS piqt piqt_utils qcd_utils)
|
||||||
if (Qt5)
|
if (Qt5)
|
||||||
|
list(APPEND _DIRS)
|
||||||
if (QGLVIEW)
|
if (QGLVIEW)
|
||||||
list(APPEND _DIRS qglview)
|
list(APPEND _DIRS qglview)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
2
pip
2
pip
Submodule pip updated: d3ffc19610...5df43a45f2
@@ -23,7 +23,7 @@ list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME})
|
|||||||
set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE)
|
set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE)
|
||||||
include_directories(${PIP_INCLUDES} ${QAD_INCLUDES})
|
include_directories(${PIP_INCLUDES} ${QAD_INCLUDES})
|
||||||
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
|
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
|
||||||
pip_code_model(CCM "../pip/src_main/io_devices/piiodevice.h" "../pip/src_main/io_utils/pipacketextractor.h" OPTIONS "-DPIP_EXPORT" "-Es")
|
pip_code_model(CCM "../pip/lib/main/io_devices/piiodevice.h" "../pip/lib/main/io_utils/pipacketextractor.h" OPTIONS "-DPIP_EXPORT" "-Es")
|
||||||
find_qt(${QtVersions} Core Gui)
|
find_qt(${QtVersions} Core Gui)
|
||||||
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
|
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
|
||||||
qt_add_library(${PROJECT_NAME} ${LIBTYPE} out_CPP CCM)
|
qt_add_library(${PROJECT_NAME} ${LIBTYPE} out_CPP CCM)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
project(piintrospector)
|
project(piintrospector)
|
||||||
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
|
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
|
||||||
set(PII_ROOT "../../pip/src_main/introspection")
|
set(PII_ROOT "../../pip/lib/main/introspection")
|
||||||
pip_code_model(PII_CCM "${PII_ROOT}/piintrospection_server_p.h" "${PII_ROOT}/piintrospection_threads_p.h" OPTIONS "-DPIP_EXPORT" "-Es")
|
pip_code_model(PII_CCM "${PII_ROOT}/piintrospection_server_p.h" "${PII_ROOT}/piintrospection_threads_p.h" OPTIONS "-DPIP_EXPORT" "-Es")
|
||||||
find_qt(${QtVersions} Core Gui)
|
find_qt(${QtVersions} Core Gui)
|
||||||
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
|
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ cmake_minimum_required(VERSION 3.0)
|
|||||||
cmake_policy(SET CMP0017 NEW) # need include() with .cmake
|
cmake_policy(SET CMP0017 NEW) # need include() with .cmake
|
||||||
project(qad)
|
project(qad)
|
||||||
set(_QAD_MAJOR 1)
|
set(_QAD_MAJOR 1)
|
||||||
set(_QAD_MINOR 4)
|
set(_QAD_MINOR 5)
|
||||||
set(_QAD_REVISION 0)
|
set(_QAD_REVISION 0)
|
||||||
set(_QAD_SUFFIX alpha)
|
set(_QAD_SUFFIX )
|
||||||
set(_QAD_COMPANY SHS)
|
set(_QAD_COMPANY SHS)
|
||||||
set(_QAD_DOMAIN org.SHS)
|
set(_QAD_DOMAIN org.SHS)
|
||||||
|
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ LogView::LogView(QWidget * parent): QWidget(parent) {
|
|||||||
ui = new Ui::LogView();
|
ui = new Ui::LogView();
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->textEdit->setContextMenuPolicy(Qt::ActionsContextMenu);
|
ui->textEdit->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||||
actionLogSelectAll = new QAction(QIcon(":/icons/select-all.png"), tr("Select All"));
|
actionLogSelectAll = new QAction(QIcon(":/icons/select-all.png"), tr("Select All"), this);
|
||||||
actionLogCopy = new QAction(QIcon(":/icons/edit-copy.png"), tr("Copy"));
|
actionLogCopy = new QAction(QIcon(":/icons/edit-copy.png"), tr("Copy"), this);
|
||||||
actionLogClear = new QAction(QIcon(":/icons/edit-clear.png"), tr("Clear"));
|
actionLogClear = new QAction(QIcon(":/icons/edit-clear.png"), tr("Clear"), this);
|
||||||
connect(actionLogSelectAll, SIGNAL(triggered(bool)), ui->textEdit, SLOT(selectAll()));
|
connect(actionLogSelectAll, SIGNAL(triggered(bool)), ui->textEdit, SLOT(selectAll()));
|
||||||
connect(actionLogCopy, SIGNAL(triggered(bool)), ui->textEdit, SLOT(copy()));
|
connect(actionLogCopy, SIGNAL(triggered(bool)), ui->textEdit, SLOT(copy()));
|
||||||
connect(actionLogClear, SIGNAL(triggered(bool)), ui->textEdit, SLOT(clear()));
|
connect(actionLogClear, SIGNAL(triggered(bool)), ui->textEdit, SLOT(clear()));
|
||||||
@@ -86,7 +86,13 @@ int LogView::linesLimit() const {
|
|||||||
|
|
||||||
|
|
||||||
void LogView::registerCategory(const QString & label, QString keyword, const QImage & icon, QColor color, bool bold) {
|
void LogView::registerCategory(const QString & label, QString keyword, const QImage & icon, QColor color, bool bold) {
|
||||||
QRegularExpression regexp(keyword, QRegularExpression::PatternOptions(QRegularExpression::CaseInsensitiveOption));
|
QRegularExpression regexp(keyword,
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
|
QRegularExpression::PatternOptions(QRegularExpression::CaseInsensitiveOption)
|
||||||
|
#else
|
||||||
|
Qt::CaseInsensitive
|
||||||
|
#endif
|
||||||
|
);
|
||||||
registerCategory(label, regexp, icon, color, bold);
|
registerCategory(label, regexp, icon, color, bold);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +113,13 @@ void LogView::registerCategory(const QString & label, QRegularExpression regexp,
|
|||||||
|
|
||||||
|
|
||||||
void LogView::removeCategory(QString keyword) {
|
void LogView::removeCategory(QString keyword) {
|
||||||
QRegularExpression regexp(keyword, QRegularExpression::PatternOptions(QRegularExpression::CaseInsensitiveOption));
|
QRegularExpression regexp(keyword,
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
|
QRegularExpression::PatternOptions(QRegularExpression::CaseInsensitiveOption)
|
||||||
|
#else
|
||||||
|
Qt::CaseInsensitive
|
||||||
|
#endif
|
||||||
|
);
|
||||||
removeCategory(regexp);
|
removeCategory(regexp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +129,13 @@ void LogView::removeCategory(QRegularExpression regexp) {
|
|||||||
c.regexp = regexp;
|
c.regexp = regexp;
|
||||||
categories.removeAll(c);
|
categories.removeAll(c);
|
||||||
for (int i = 1; i < ui->comboCategory->count(); ++i) {
|
for (int i = 1; i < ui->comboCategory->count(); ++i) {
|
||||||
if (ui->comboCategory->itemData(i).toRegularExpression().pattern() == regexp.pattern()) {
|
if (ui->comboCategory->itemData(i).
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
|
toRegularExpression()
|
||||||
|
#else
|
||||||
|
toRegExp()
|
||||||
|
#endif
|
||||||
|
.pattern() == regexp.pattern()) {
|
||||||
ui->comboCategory->removeItem(i);
|
ui->comboCategory->removeItem(i);
|
||||||
--i;
|
--i;
|
||||||
}
|
}
|
||||||
@@ -194,7 +212,12 @@ void LogView::newLine() {
|
|||||||
tc.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor);
|
tc.movePosition(QTextCursor::StartOfBlock, QTextCursor::MoveAnchor);
|
||||||
tc.insertImage(icon);
|
tc.insertImage(icon);
|
||||||
}
|
}
|
||||||
QRegularExpression regexp = ui->comboCategory->currentData().toRegularExpression();
|
QRegularExpression regexp =
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
|
ui->comboCategory->currentData().toRegularExpression();
|
||||||
|
#else
|
||||||
|
ui->comboCategory->itemData(ui->comboCategory->currentIndex()).toRegExp();
|
||||||
|
#endif
|
||||||
QString fs = ui->lineEdit->text();
|
QString fs = ui->lineEdit->text();
|
||||||
if (isFilterVisible())
|
if (isFilterVisible())
|
||||||
filterBlock(tc.block(), fs, regexp);
|
filterBlock(tc.block(), fs, regexp);
|
||||||
@@ -254,7 +277,12 @@ void LogView::filter() {
|
|||||||
QRegularExpression regexp;
|
QRegularExpression regexp;
|
||||||
QString fs;
|
QString fs;
|
||||||
if (isFilterVisible()) {
|
if (isFilterVisible()) {
|
||||||
regexp = ui->comboCategory->currentData().toRegularExpression();
|
regexp =
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
|
ui->comboCategory->currentData().toRegularExpression();
|
||||||
|
#else
|
||||||
|
ui->comboCategory->itemData(ui->comboCategory->currentIndex()).toRegExp();
|
||||||
|
#endif
|
||||||
fs = ui->lineEdit->text();
|
fs = ui->lineEdit->text();
|
||||||
}
|
}
|
||||||
QTextBlock bl;
|
QTextBlock bl;
|
||||||
|
|||||||
@@ -24,7 +24,12 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QTextBlockFormat>
|
#include <QTextBlockFormat>
|
||||||
#include <QRegularExpression>
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||||
|
# include <QRegularExpression>
|
||||||
|
#else
|
||||||
|
# include <QRegExp>
|
||||||
|
typedef QRegExp QRegularExpression;
|
||||||
|
#endif
|
||||||
#include "qad_export.h"
|
#include "qad_export.h"
|
||||||
|
|
||||||
class QTextEdit;
|
class QTextEdit;
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
#[[
|
||||||
|
|
||||||
|
Also create imported targets:
|
||||||
|
* QAD::Utils
|
||||||
|
* QAD::Widgets
|
||||||
|
* QAD::Application
|
||||||
|
* QAD::Blockview
|
||||||
|
* QAD::Graphic
|
||||||
|
* QAD::SQLTable
|
||||||
|
* QAD::TouchWidgets
|
||||||
|
* QAD::Doc
|
||||||
|
|
||||||
|
These targets include directories and dependencies
|
||||||
|
|
||||||
|
]]
|
||||||
|
|
||||||
cmake_policy(SET CMP0011 NEW) # don`t affect includer policies
|
cmake_policy(SET CMP0011 NEW) # don`t affect includer policies
|
||||||
cmake_policy(SET CMP0020 NEW) # Automatically link Qt executables to qtmain target on Windows
|
cmake_policy(SET CMP0020 NEW) # Automatically link Qt executables to qtmain target on Windows
|
||||||
if(NOT LIBPROJECT)
|
if(NOT LIBPROJECT)
|
||||||
@@ -41,6 +57,24 @@ find_file(QAD_H_INCLUDE "qad_types.h" HINTS ${PIP_DIR}/include/qad ${_QAD_INCDIR
|
|||||||
#endif()
|
#endif()
|
||||||
set(_SEARCH_DIR ${_QAD_LIBDIR} $ENV{SMSDK_DIR}/lib)
|
set(_SEARCH_DIR ${_QAD_LIBDIR} $ENV{SMSDK_DIR}/lib)
|
||||||
set(_QAD_LIBS utils widgets application blockview graphic sql_table touch_widgets doc)
|
set(_QAD_LIBS utils widgets application blockview graphic sql_table touch_widgets doc)
|
||||||
|
|
||||||
|
set(_ITN_utils "Utils" )
|
||||||
|
set(_ITN_widgets "Widgets" )
|
||||||
|
set(_ITN_application "Application" )
|
||||||
|
set(_ITN_blockview "Blockview" )
|
||||||
|
set(_ITN_graphic "Graphic" )
|
||||||
|
set(_ITN_sql_table "SQLTable" )
|
||||||
|
set(_ITN_touch_widgets "TouchWidgets")
|
||||||
|
set(_ITN_doc "Doc" )
|
||||||
|
|
||||||
|
set(_ITLL_widgets "QAD::Utils")
|
||||||
|
set(_ITLL_application "QAD::Widgets")
|
||||||
|
set(_ITLL_blockview "QAD::Widgets")
|
||||||
|
set(_ITLL_graphic "QAD::Widgets")
|
||||||
|
set(_ITLL_sql_table "QAD::Widgets")
|
||||||
|
set(_ITLL_touch_widgets "")
|
||||||
|
set(_ITLL_doc "")
|
||||||
|
|
||||||
if(LIBPROJECT)
|
if(LIBPROJECT)
|
||||||
set(QAD_INCLUDES ${QAD_DIR})
|
set(QAD_INCLUDES ${QAD_DIR})
|
||||||
endif()
|
endif()
|
||||||
@@ -52,15 +86,41 @@ foreach(_Q ${_QAD_LIBS})
|
|||||||
else()
|
else()
|
||||||
foreach(_v ${_QT_VERSIONS_})
|
foreach(_v ${_QT_VERSIONS_})
|
||||||
find_library(QAD${_v}_${_QU}_LIBRARY qad_${_Q}${_v} HINTS ${_SEARCH_DIR})
|
find_library(QAD${_v}_${_QU}_LIBRARY qad_${_Q}${_v} HINTS ${_SEARCH_DIR})
|
||||||
set(MULTILIB_${_Q}_SUFFIX_Qt${_v} ${_v})
|
set(MULTILIB_qad_${_Q}_SUFFIX_Qt${_v} ${_v})
|
||||||
if(hasParent)
|
if(hasParent)
|
||||||
set(MULTILIB_${_Q}_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
|
set(MULTILIB_qad_${_Q}_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
|
#message(STATUS "MULTILIB_qad_${_Q}_SUFFIX_Qt${_v} = ${_v}")
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
#message(STATUS "Library qad_${_Q}5 (${_QU}) -> ${QAD5_${_QU}_LIBRARY} found in ${_SEARCH_DIR}")
|
#message(STATUS "Library qad_${_Q}5 (${_QU}) -> ${QAD5_${_QU}_LIBRARY} found in ${_SEARCH_DIR}")
|
||||||
list(APPEND QT_MULTILIB_LIST qad_${_Q})
|
list(APPEND QT_MULTILIB_LIST qad_${_Q})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
foreach(_Q ${_QAD_LIBS})
|
||||||
|
string(TOUPPER ${_Q} _QU)
|
||||||
|
set(_target QAD::${_ITN_${_Q}})
|
||||||
|
string(REPLACE ":" "_" _target_str "${_target}")
|
||||||
|
foreach(_v ${_QT_VERSIONS_})
|
||||||
|
if(NOT TARGET ${_target}${_v})
|
||||||
|
set(_link_list)
|
||||||
|
foreach(_l ${_ITLL_${_Q}})
|
||||||
|
list(APPEND _link_list ${_l}${_v})
|
||||||
|
endforeach()
|
||||||
|
add_library(${_target}${_v} UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(${_target}${_v} PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${QAD${_v}_${_QU}_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${QAD_INCLUDES}"
|
||||||
|
INTERFACE_LINK_LIBRARIES "${_link_list}")
|
||||||
|
set(MULTILIB_${_target_str}_SUFFIX_Qt${_v} ${_v})
|
||||||
|
if(hasParent)
|
||||||
|
set(MULTILIB_${_target_str}_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
#message(STATUS "add imported ${_target}${_v}")
|
||||||
|
#message(STATUS "add MULTILIB MULTILIB_${_target_str}_SUFFIX_Qt${_v} ${_v}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
list(APPEND QT_MULTILIB_LIST ${_target})
|
||||||
|
endforeach()
|
||||||
list(APPEND QT_MULTILIB_LIST qglview qglengine_core qglengine_widgets)
|
list(APPEND QT_MULTILIB_LIST qglview qglengine_core qglengine_widgets)
|
||||||
foreach(_v ${_QT_VERSIONS_})
|
foreach(_v ${_QT_VERSIONS_})
|
||||||
find_library(QGLVIEW${_v}_LIBRARY qglview${_v} ${_SEARCH_DIR})
|
find_library(QGLVIEW${_v}_LIBRARY qglview${_v} ${_SEARCH_DIR})
|
||||||
|
|||||||
@@ -536,8 +536,9 @@ endmacro()
|
|||||||
|
|
||||||
|
|
||||||
macro(_qt_multitarget_suffix_ _OUT _IN _v)
|
macro(_qt_multitarget_suffix_ _OUT _IN _v)
|
||||||
if (NOT "x${MULTILIB_${_IN}_SUFFIX_Qt${_v}}" STREQUAL "x")
|
string(REPLACE ":" "_" _in_str "${_IN}")
|
||||||
set(${_OUT} "${MULTILIB_${_IN}_SUFFIX_Qt${_v}}")
|
if (NOT "x${MULTILIB_${_in_str}_SUFFIX_Qt${_v}}" STREQUAL "x")
|
||||||
|
set(${_OUT} "${MULTILIB_${_in_str}_SUFFIX_Qt${_v}}")
|
||||||
else()
|
else()
|
||||||
set(${_OUT} "${MULTILIB_SUFFIX_Qt${_v}}")
|
set(${_OUT} "${MULTILIB_SUFFIX_Qt${_v}}")
|
||||||
endif()
|
endif()
|
||||||
@@ -554,6 +555,7 @@ macro(qt_target_link_libraries _NAME)
|
|||||||
list(FIND QT_MULTILIB_LIST "${_i}" _ind)
|
list(FIND QT_MULTILIB_LIST "${_i}" _ind)
|
||||||
if (_ind GREATER -1)
|
if (_ind GREATER -1)
|
||||||
_qt_multitarget_suffix_(_TS ${_i} ${_v})
|
_qt_multitarget_suffix_(_TS ${_i} ${_v})
|
||||||
|
#message(STATUS "${_i} in MULTILIB_LIST, suffix = ${_TS}")
|
||||||
list(APPEND _ARGS ${_i}${_TS})
|
list(APPEND _ARGS ${_i}${_TS})
|
||||||
else()
|
else()
|
||||||
list(APPEND _ARGS ${_i})
|
list(APPEND _ARGS ${_i})
|
||||||
|
|||||||
@@ -371,7 +371,7 @@ void Graphic::canvasMouseMoveEvent(QMouseEvent * e) {
|
|||||||
|
|
||||||
|
|
||||||
void Graphic::canvasMousePressEvent(QMouseEvent * e) {
|
void Graphic::canvasMousePressEvent(QMouseEvent * e) {
|
||||||
emit graphicMousePressEvent(canvas2real(QPointF(e->pos())), e->buttons());
|
emit graphicMousePressEvent(canvas2real(QPointF(e->pos())), e->button());
|
||||||
if (!navigation) return;
|
if (!navigation) return;
|
||||||
if (gestures && !need_mouse_pan) return;
|
if (gestures && !need_mouse_pan) return;
|
||||||
#ifdef HAS_GL
|
#ifdef HAS_GL
|
||||||
@@ -415,7 +415,7 @@ void Graphic::canvasMousePressEvent(QMouseEvent * e) {
|
|||||||
|
|
||||||
|
|
||||||
void Graphic::canvasMouseReleaseEvent(QMouseEvent * e) {
|
void Graphic::canvasMouseReleaseEvent(QMouseEvent * e) {
|
||||||
emit graphicMouseReleaseEvent(canvas2real(QPointF(e->pos())), e->buttons());
|
emit graphicMouseReleaseEvent(canvas2real(QPointF(e->pos())), e->button());
|
||||||
if (gestures) return;
|
if (gestures) return;
|
||||||
need_mouse_pan = false;
|
need_mouse_pan = false;
|
||||||
if (!navigation) return;
|
if (!navigation) return;
|
||||||
|
|||||||
@@ -234,7 +234,8 @@ public slots:
|
|||||||
void setGraphicColor(const QColor & color) {setGraphicColor(color, curGraphic);}
|
void setGraphicColor(const QColor & color) {setGraphicColor(color, curGraphic);}
|
||||||
void setGridColor(const QColor & color) {grid_pen.setColor(color); if (aupdate) update();}
|
void setGridColor(const QColor & color) {grid_pen.setColor(color); if (aupdate) update();}
|
||||||
void setSelectionColor(const QColor & color) {selpen.setColor(color);}
|
void setSelectionColor(const QColor & color) {selpen.setColor(color);}
|
||||||
void setGraphicStyle(const Qt::PenStyle & style) {graphics[curGraphic].pen.setStyle(style); updateLegend(); if (aupdate) update();}
|
void setGraphicStyle(const Qt::PenStyle & style, int index) {graphics[index].pen.setStyle(style); updateLegend(); if (aupdate) update();}
|
||||||
|
void setGraphicStyle(const Qt::PenStyle & style) {setGraphicStyle(style, curGraphic);}
|
||||||
void setGridStyle(const Qt::PenStyle & style) {grid_pen.setStyle(style); if (aupdate) update();}
|
void setGridStyle(const Qt::PenStyle & style) {grid_pen.setStyle(style); if (aupdate) update();}
|
||||||
void setSelectionStyle(const Qt::PenStyle & style) {selpen.setStyle(style);}
|
void setSelectionStyle(const Qt::PenStyle & style) {selpen.setStyle(style);}
|
||||||
void setGraphicVisible(bool visible, int index) {graphics[index].visible = visible; updateLegendChecks(); if (aupdate) update();}
|
void setGraphicVisible(bool visible, int index) {graphics[index].visible = visible; updateLegendChecks(); if (aupdate) update();}
|
||||||
@@ -379,6 +380,9 @@ protected:
|
|||||||
GraphicConf * conf;
|
GraphicConf * conf;
|
||||||
EvalSpinBox line_x_min, line_x_max, line_y_min, line_y_max;
|
EvalSpinBox line_x_min, line_x_max, line_y_min, line_y_max;
|
||||||
QElapsedTimer tm;
|
QElapsedTimer tm;
|
||||||
|
#ifdef Q_OS_ANDROID
|
||||||
|
QElapsedTimer tm_fscr;
|
||||||
|
#endif
|
||||||
QIcon icon_exp_x, icon_exp_y, icon_exp_sx, icon_exp_sy;
|
QIcon icon_exp_x, icon_exp_y, icon_exp_sx, icon_exp_sy;
|
||||||
QImage icon_pause_b, icon_pause_f;
|
QImage icon_pause_b, icon_pause_f;
|
||||||
Graduation grad_x, grad_y;
|
Graduation grad_x, grad_y;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QtGlobal>
|
#include <QtCore/QtGlobal>
|
||||||
|
|
||||||
#if defined(QAD_STATIC_DEFINE) || defined(Q_CC_GNU) || defined(DOXYGEN)
|
#if defined(QAD_STATIC_DEFINE) || defined(DOXYGEN)
|
||||||
# define QAD_EXPORT
|
# define QAD_EXPORT
|
||||||
#else
|
#else
|
||||||
# ifdef QAD_SHARED_DEFINE
|
# ifdef QAD_SHARED_DEFINE
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "iconedlabel.h"
|
#include "iconedlabel.h"
|
||||||
#include "qad_types.h"
|
#include "qad_types.h"
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
|
#include <QStyle>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
|
|
||||||
|
|
||||||
@@ -8,13 +9,23 @@ IconedLabel::IconedLabel(QWidget * parent): QFrame(parent) {
|
|||||||
label_.setAlignment(Qt::AlignCenter);
|
label_.setAlignment(Qt::AlignCenter);
|
||||||
icon_.setAlignment(Qt::AlignCenter);
|
icon_.setAlignment(Qt::AlignCenter);
|
||||||
icon_.setScaledContents(true);
|
icon_.setScaledContents(true);
|
||||||
|
icon_.setHidden(true);
|
||||||
setIconSize(QSize());
|
setIconSize(QSize());
|
||||||
setDirection(RightToLeft);
|
setDirection(RightToLeft);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString IconedLabel::text() const {
|
||||||
|
return label_.text();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QIcon IconedLabel::icon() const {
|
QIcon IconedLabel::icon() const {
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||||
|
return icon_.pixmap(Qt::ReturnByValue).isNull() ? QIcon() : QIcon(icon_.pixmap(Qt::ReturnByValue));
|
||||||
|
#else
|
||||||
return icon_.pixmap() == 0 ? QIcon() : QIcon(*icon_.pixmap());
|
return icon_.pixmap() == 0 ? QIcon() : QIcon(*icon_.pixmap());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -25,14 +36,36 @@ bool IconedLabel::event(QEvent * e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void IconedLabel::checkSpacing() {
|
||||||
|
label_.setHidden(label_.text().isEmpty());
|
||||||
|
if (!layout()) return;
|
||||||
|
if (label_.isHidden() || icon_.isHidden()) {
|
||||||
|
layout()->setSpacing(0);
|
||||||
|
} else {
|
||||||
|
QStyle * s = style();
|
||||||
|
if (s)
|
||||||
|
layout()->setSpacing(s->layoutSpacing(QSizePolicy::Label, QSizePolicy::Label,
|
||||||
|
dir_ <= Direction::RightToLeft ? Qt::Horizontal : Qt::Vertical));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QSize IconedLabel::realIconSize() const {
|
QSize IconedLabel::realIconSize() const {
|
||||||
return size_.isValid() ? size_ : preferredIconSize(1.f, this);
|
return size_.isValid() ? size_ : preferredIconSize(1.f, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void IconedLabel::setText(const QString & t) {
|
||||||
|
label_.setText(t);
|
||||||
|
checkSpacing();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void IconedLabel::setIcon(const QIcon & i) {
|
void IconedLabel::setIcon(const QIcon & i) {
|
||||||
sicon_ = i;
|
sicon_ = i;
|
||||||
setIconSize(iconSize());
|
setIconSize(iconSize());
|
||||||
|
icon_.setHidden(icon().isNull());
|
||||||
|
checkSpacing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -55,5 +88,6 @@ void IconedLabel::setDirection(IconedLabel::Direction d) {
|
|||||||
lay->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding));
|
lay->addItem(new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding));
|
||||||
lay->setContentsMargins(0, 0, 0, 0);
|
lay->setContentsMargins(0, 0, 0, 0);
|
||||||
setLayout(lay);
|
setLayout(lay);
|
||||||
|
checkSpacing();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,13 +38,16 @@ public:
|
|||||||
|
|
||||||
explicit IconedLabel(QWidget * parent = 0);
|
explicit IconedLabel(QWidget * parent = 0);
|
||||||
|
|
||||||
QString text() const {return label_.text();}
|
QString text() const;
|
||||||
QIcon icon() const;
|
QIcon icon() const;
|
||||||
QSize iconSize() const {return size_;}
|
QSize iconSize() const {return size_;}
|
||||||
Direction direction() const {return dir_;}
|
Direction direction() const {return dir_;}
|
||||||
|
|
||||||
|
QLabel * textLabel() {return &label_;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool event(QEvent * e);
|
virtual bool event(QEvent * e);
|
||||||
|
void checkSpacing();
|
||||||
QSize realIconSize() const;
|
QSize realIconSize() const;
|
||||||
|
|
||||||
QLabel label_, icon_;
|
QLabel label_, icon_;
|
||||||
@@ -53,7 +56,7 @@ protected:
|
|||||||
Direction dir_;
|
Direction dir_;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setText(const QString & t) {label_.setText(t);}
|
void setText(const QString & t);
|
||||||
void setIcon(const QIcon & i);
|
void setIcon(const QIcon & i);
|
||||||
void setIconSize(const QSize & s);
|
void setIconSize(const QSize & s);
|
||||||
void setDirection(Direction d);
|
void setDirection(Direction d);
|
||||||
|
|||||||
@@ -302,6 +302,7 @@ protected:
|
|||||||
uint qHash(const PIString & v, uint seed = 0) {return piHash(v);}
|
uint qHash(const PIString & v, uint seed = 0) {return piHash(v);}
|
||||||
|
|
||||||
|
|
||||||
|
#include "logview.h"
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
@@ -342,6 +343,28 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
return 0;*/
|
return 0;*/
|
||||||
//################################
|
//################################
|
||||||
|
//1245hghgfhfdgshrgnhdsgfhjshdszdgsdgnjedghrbnlcvleabjmbassfdggfhbnsjkgnfdvfdsdfojbwasv213443gr2t4sfth
|
||||||
|
/*LogView lw;
|
||||||
|
lw.setLogFont(QFont("dejavu sans mono", 9));
|
||||||
|
lw.registerCategory("Warning", "Warning", QImage(":/icons/flame.png"), Qt::darkYellow);
|
||||||
|
lw.registerCategory("Error", "Error", QImage(":/icons/dialog-cancel.png"), Qt::darkRed, true);
|
||||||
|
//lw.setLinesLimit(12);
|
||||||
|
lw.show();
|
||||||
|
piForTimes(100)
|
||||||
|
lw.addText(QString("row %1").arg(_i100));
|
||||||
|
lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/scene_tree.h");
|
||||||
|
lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/scene_tree.h");
|
||||||
|
lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/view_editor.h");
|
||||||
|
lw.addText("-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/material_map_editor.h\n"
|
||||||
|
"-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/materials_editor\n"
|
||||||
|
"-- Up-to-date: C:/sdk/MinGW/x32/i686-w64-mingw32/include/qglengine/object_editor.h");
|
||||||
|
lw.addText("[Warning] sdfkjhdfgj");
|
||||||
|
lw.addText("[Error] gbflknwed");
|
||||||
|
QLineEdit * le = new QLineEdit();
|
||||||
|
QObject::connect(le, &QLineEdit::returnPressed, [&](){lw.addText(le->text());});
|
||||||
|
le->show();
|
||||||
|
return a.exec();*/
|
||||||
|
|
||||||
CDPultWindow w;
|
CDPultWindow w;
|
||||||
w.show();
|
w.show();
|
||||||
if (a.arguments().size() > 1)
|
if (a.arguments().size() > 1)
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
if (DESIGNER_PLUGINS)
|
if (DESIGNER_PLUGINS)
|
||||||
|
if (NOT Qt5)
|
||||||
|
message(WARNING "Building ${PROJECT_NAME} available only on Qt5!")
|
||||||
|
else()
|
||||||
project(qglengine_plugin)
|
project(qglengine_plugin)
|
||||||
include_directories("..")
|
include_directories("..")
|
||||||
add_definitions(-DQT_PLUGIN)
|
add_definitions(-DQT_PLUGIN)
|
||||||
add_definitions(-DQT_NO_DEBUG)
|
add_definitions(-DQT_NO_DEBUG)
|
||||||
add_definitions(-DQT_SHARED)
|
add_definitions(-DQT_SHARED)
|
||||||
add_definitions(-DQDESIGNER_EXPORT_WIDGETS)
|
add_definitions(-DQDESIGNER_EXPORT_WIDGETS)
|
||||||
find_qt(${QtVersions} Core Designer Gui Widgets OpenGL)
|
find_qt(Qt5 Core Designer Gui Widgets OpenGL)
|
||||||
qt_sources(SRC)
|
qt_sources(SRC)
|
||||||
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
||||||
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
||||||
qt_target_link_libraries(${PROJECT_NAME} qglengine)
|
qt_target_link_libraries(${PROJECT_NAME} qglengine)
|
||||||
qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer)
|
qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -17,16 +17,19 @@ endif()
|
|||||||
find_package(QAD REQUIRED)
|
find_package(QAD REQUIRED)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
include_directories(${QAD_INCLUDES})
|
include_directories(${QAD_INCLUDES})
|
||||||
find_qt(${QtVersions} Core Gui OpenGL Xml)
|
find_qt(Qt5 Core Gui OpenGL Xml)
|
||||||
qt_sources(SRC)
|
if (NOT Qt5)
|
||||||
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
|
message(WARNING "Building ${PROJECT_NAME} available only on Qt5!")
|
||||||
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
|
||||||
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets ${OPENGL_LIBRARIES})
|
|
||||||
qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
||||||
message(STATUS "Building ${PROJECT_NAME}")
|
|
||||||
if (LIBPROJECT)
|
|
||||||
sdk_install("qad" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}")
|
|
||||||
else()
|
else()
|
||||||
|
qt_sources(SRC)
|
||||||
|
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
|
||||||
|
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
||||||
|
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets ${OPENGL_LIBRARIES})
|
||||||
|
qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
message(STATUS "Building ${PROJECT_NAME}")
|
||||||
|
if (LIBPROJECT)
|
||||||
|
sdk_install("qad" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}")
|
||||||
|
else()
|
||||||
if (LIB)
|
if (LIB)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
qt_install(FILES ${H} DESTINATION ${MINGW_INCLUDE}/qad)
|
qt_install(FILES ${H} DESTINATION ${MINGW_INCLUDE}/qad)
|
||||||
@@ -48,19 +51,20 @@ else()
|
|||||||
qt_install(FILES ${H} DESTINATION include/qad)
|
qt_install(FILES ${H} DESTINATION include/qad)
|
||||||
message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"")
|
message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
foreach(_v ${_QT_VERSIONS_})
|
foreach(_v ${_QT_VERSIONS_})
|
||||||
set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v})
|
set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v})
|
||||||
set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
|
set(MULTILIB_qglview_SUFFIX_Qt${_v} ${_v} PARENT_SCOPE)
|
||||||
endforeach()
|
endforeach()
|
||||||
list(APPEND QT_MULTILIB_LIST qglview)
|
list(APPEND QT_MULTILIB_LIST qglview)
|
||||||
if (NOT DEFINED ANDROID_PLATFORM)
|
if (NOT DEFINED ANDROID_PLATFORM)
|
||||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin")
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin")
|
||||||
add_subdirectory(plugin)
|
add_subdirectory(plugin)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_sources(test_SRC DIR "qglview_test")
|
qt_sources(test_SRC DIR "qglview_test")
|
||||||
qt_wrap(${test_SRC} CPPS test_CPP)
|
qt_wrap(${test_SRC} CPPS test_CPP)
|
||||||
qt_add_executable(qglview_test test_CPP)
|
qt_add_executable(qglview_test test_CPP)
|
||||||
qt_target_link_libraries(qglview_test ${PROJECT_NAME})
|
qt_target_link_libraries(qglview_test ${PROJECT_NAME})
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
if (DESIGNER_PLUGINS)
|
if (DESIGNER_PLUGINS)
|
||||||
|
if (NOT Qt5)
|
||||||
|
message(WARNING "Building ${PROJECT_NAME} available only on Qt5!")
|
||||||
|
else()
|
||||||
project(qglview_plugin)
|
project(qglview_plugin)
|
||||||
include_directories("..")
|
include_directories("..")
|
||||||
add_definitions(-DQT_PLUGIN)
|
add_definitions(-DQT_PLUGIN)
|
||||||
add_definitions(-DQT_NO_DEBUG)
|
add_definitions(-DQT_NO_DEBUG)
|
||||||
add_definitions(-DQT_SHARED)
|
add_definitions(-DQT_SHARED)
|
||||||
add_definitions(-DQDESIGNER_EXPORT_WIDGETS)
|
add_definitions(-DQDESIGNER_EXPORT_WIDGETS)
|
||||||
find_qt(${QtVersions} Core Designer Gui Widgets OpenGL)
|
find_qt(Qt5 Core Designer Gui Widgets OpenGL)
|
||||||
qt_sources(SRC)
|
qt_sources(SRC)
|
||||||
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
|
||||||
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
qt_add_library(${PROJECT_NAME} SHARED out_CPP)
|
||||||
qt_target_link_libraries(${PROJECT_NAME} qglview)
|
qt_target_link_libraries(${PROJECT_NAME} qglview)
|
||||||
qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer)
|
qt_install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION QtPlugins/designer)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user