Merge pull request 'master' (#49) from master into release
All checks were successful
SHS Gitea/libs/pipeline/head This commit looks good

This commit was merged in pull request #49.
This commit is contained in:
2020-06-28 01:16:49 +03:00
10 changed files with 146 additions and 77 deletions

View File

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

Submodule pip updated: 5de62b1c83...2dfbbf80b7

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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