Compare commits
11 Commits
0f13cf5196
...
b1852ab1fa
| Author | SHA1 | Date | |
|---|---|---|---|
| b1852ab1fa | |||
| b4e77d136a | |||
| ebebcd11ce | |||
| 32da3d029d | |||
| 681a79a672 | |||
| 88bcc7f2e9 | |||
| 04d9cf6edf | |||
| 66dc481d6e | |||
| f8e361190b | |||
| 745376adfb | |||
| 13d4e6cb75 |
@@ -135,7 +135,7 @@ JavaScriptWrapImports: true
|
|||||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
LambdaBodyIndentation: Signature
|
LambdaBodyIndentation: Signature
|
||||||
MacroBlockBegin: "PRIVATE_DEFINITION_START|STATIC_INITIALIZER_BEGIN"
|
MacroBlockBegin: "PRIVATE_DEFINITION_START|STATIC_INITIALIZER_BEGIN"
|
||||||
MacroBlockEnd: "PRIVATE_DEFINITION_END|STATIC_INITIALIZER_END"
|
MacroBlockEnd: "PRIVATE_DEFINITION_END|PRIVATE_DEFINITION_END_NO_INITIALIZE|STATIC_INITIALIZER_END"
|
||||||
MaxEmptyLinesToKeep: 2
|
MaxEmptyLinesToKeep: 2
|
||||||
NamespaceIndentation: None
|
NamespaceIndentation: None
|
||||||
ObjCBinPackProtocolList: Auto
|
ObjCBinPackProtocolList: Auto
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ cmake_policy(SET CMP0072 NEW) # FindOpenGL prefers GLVND by default
|
|||||||
project(QAD)
|
project(QAD)
|
||||||
set(QAD_MAJOR 2)
|
set(QAD_MAJOR 2)
|
||||||
set(QAD_MINOR 32)
|
set(QAD_MINOR 32)
|
||||||
set(QAD_REVISION 1)
|
set(QAD_REVISION 2)
|
||||||
set(QAD_SUFFIX )
|
set(QAD_SUFFIX )
|
||||||
set(QAD_COMPANY SHS)
|
set(QAD_COMPANY SHS)
|
||||||
set(QAD_DOMAIN org.SHS)
|
set(QAD_DOMAIN org.SHS)
|
||||||
|
|||||||
@@ -342,6 +342,7 @@ void Graphic::procGesture(QGesture * g) {
|
|||||||
QPointF dp = -pg->delta();
|
QPointF dp = -pg->delta();
|
||||||
dp.rx() /= getScaleX();
|
dp.rx() /= getScaleX();
|
||||||
dp.ry() /= getScaleY();
|
dp.ry() /= getScaleY();
|
||||||
|
dp.ry() = -dp.y();
|
||||||
selrect.translate(dp);
|
selrect.translate(dp);
|
||||||
totalUpdate();
|
totalUpdate();
|
||||||
} break;
|
} break;
|
||||||
@@ -357,11 +358,7 @@ void Graphic::procGesture(QGesture * g) {
|
|||||||
} break;
|
} break;
|
||||||
case Qt::TapAndHoldGesture: {
|
case Qt::TapAndHoldGesture: {
|
||||||
QTapAndHoldGesture * pg = (QTapAndHoldGesture *)g;
|
QTapAndHoldGesture * pg = (QTapAndHoldGesture *)g;
|
||||||
if (pg->state() == Qt::GestureStarted)
|
if (pg->state() == Qt::GestureStarted) QMetaObject::invokeMethod(this, [this]() { showMenu(); }, Qt::QueuedConnection);
|
||||||
QMetaObject::invokeMethod(
|
|
||||||
this,
|
|
||||||
[this]() { showMenu(); },
|
|
||||||
Qt::QueuedConnection);
|
|
||||||
} break;
|
} break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
@@ -2318,12 +2315,29 @@ void Graphic::on_graphic_buttonAutofit_clicked() {
|
|||||||
|
|
||||||
void Graphic::on_graphic_buttonConfigure_clicked() {
|
void Graphic::on_graphic_buttonConfigure_clicked() {
|
||||||
conf->graphicItems.clear();
|
conf->graphicItems.clear();
|
||||||
for (int i = 0; i < graphics.size(); i++) {
|
int all_checks[2] = {-1, -1};
|
||||||
GraphicConf::GraphicItem item;
|
auto addAllChecks = [](int & out, bool is_vis) {
|
||||||
item.icon = graphics[i].icon;
|
if (out < 0)
|
||||||
item.name = graphics[i].name;
|
out = is_vis ? Qt::Checked : Qt::Unchecked;
|
||||||
conf->graphicItems.append(item);
|
else {
|
||||||
|
if (is_vis && out == Qt::Unchecked) out = Qt::PartiallyChecked;
|
||||||
|
if (!is_vis && out == Qt::Checked) out = Qt::PartiallyChecked;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
for (const auto & g: graphics) {
|
||||||
|
GraphicConf::GraphicItem item;
|
||||||
|
item.icon = g.icon;
|
||||||
|
item.name = g.name;
|
||||||
|
conf->graphicItems.append(item);
|
||||||
|
addAllChecks(all_checks[0], g.lines);
|
||||||
|
addAllChecks(all_checks[1], g.points);
|
||||||
|
}
|
||||||
|
conf->ui->checkLinesAll->blockSignals(true);
|
||||||
|
conf->ui->checkPointsAll->blockSignals(true);
|
||||||
|
conf->ui->checkLinesAll->setCheckState((Qt::CheckState)all_checks[0]);
|
||||||
|
conf->ui->checkPointsAll->setCheckState((Qt::CheckState)all_checks[1]);
|
||||||
|
conf->ui->checkLinesAll->blockSignals(false);
|
||||||
|
conf->ui->checkPointsAll->blockSignals(false);
|
||||||
conf->ui->colorGrid->setColor(grid_pen.color());
|
conf->ui->colorGrid->setColor(grid_pen.color());
|
||||||
conf->ui->comboStyleGrid->setCurrentIndex((int)grid_pen.style());
|
conf->ui->comboStyleGrid->setCurrentIndex((int)grid_pen.style());
|
||||||
conf->ui->spinWidthGrid->setValue(grid_pen.widthF());
|
conf->ui->spinWidthGrid->setValue(grid_pen.widthF());
|
||||||
|
|||||||
@@ -1,4 +1,16 @@
|
|||||||
if (HAS_GL)
|
if (HAS_GL)
|
||||||
|
set(HAS_QtDataVisualization ON)
|
||||||
|
foreach(_v ${_QT_VERSIONS_})
|
||||||
|
if (Qt${_v}Core_FOUND)
|
||||||
|
find_package(Qt${_v} COMPONENTS DataVisualization QUIET)
|
||||||
|
if (NOT Qt${_v}DataVisualization_FOUND)
|
||||||
|
message(STATUS "Qt${_v} DataVisualization NOT FOUND -> skip build QAD::graphic3d")
|
||||||
|
set(HAS_QtDataVisualization OFF)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
if (HAS_QtDataVisualization)
|
||||||
qad_library(graphic3d "Gui;Widgets;DataVisualization" "")
|
qad_library(graphic3d "Gui;Widgets;DataVisualization" "")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ void GraphicAnalysis::updateGraphic(int index) {
|
|||||||
void GraphicAnalysis::updateAllGraphic() {
|
void GraphicAnalysis::updateAllGraphic() {
|
||||||
for (int i = 0; i < graphicsCount(); ++i)
|
for (int i = 0; i < graphicsCount(); ++i)
|
||||||
updateGraphic(i);
|
updateGraphic(i);
|
||||||
|
updateGraphics();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -261,11 +262,13 @@ void GraphicAnalysis::addPoint(const QPointF & p, int graphic, bool update_) {
|
|||||||
|
|
||||||
void GraphicAnalysis::setGraphicTransformFunction(std::function<QPolygonF(const QPolygonF &)> f) {
|
void GraphicAnalysis::setGraphicTransformFunction(std::function<QPolygonF(const QPolygonF &)> f) {
|
||||||
tf_gr = f;
|
tf_gr = f;
|
||||||
|
updateAllGraphic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GraphicAnalysis::setSpectrumTransformFunction(std::function<QPolygonF(const QPolygonF &)> f) {
|
void GraphicAnalysis::setSpectrumTransformFunction(std::function<QPolygonF(const QPolygonF &)> f) {
|
||||||
tf_fft = f;
|
tf_fft = f;
|
||||||
|
updateAllGraphic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
MapViewTileProvider_OSM::MapViewTileProvider_OSM() {
|
MapViewTileProvider_OSM::MapViewTileProvider_OSM() {
|
||||||
nam = new QNetworkAccessManager();
|
nam = new QNetworkAccessManager();
|
||||||
PIValueTree p;
|
PIValueTree p;
|
||||||
p.addChild(PIValueTree("url", "http://tile.openstreetmap.org"));
|
p.addChild(PIValueTree("url", "https://tile.openstreetmap.org"));
|
||||||
initParameters(p);
|
initParameters(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -608,7 +608,7 @@ void PIValueTreeEdit::applyVariantEdit(PIVariantEdit * ve, const PIValueTree & v
|
|||||||
ve->setAttributes(attributesWithRO(vt.attributes()));
|
ve->setAttributes(attributesWithRO(vt.attributes()));
|
||||||
ve->setValue(vt.value());
|
ve->setValue(vt.value());
|
||||||
ve->setFullEditMode(is_full_edit);
|
ve->setFullEditMode(is_full_edit);
|
||||||
ve->setToolTip(PI2QString(vt.attribute(PIValueTree::Attribute::toolTip).toString()));
|
ve->setToolTip(PIVariantEditorBase::vtTr(vt.attribute(PIValueTree::Attribute::toolTip).toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include <QSqlError>
|
#include <QSqlError>
|
||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
|
||||||
namespace QAD {
|
namespace QAD {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <QActionGroup>
|
#include <QActionGroup>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
|
#include <QMimeData>
|
||||||
#include <pifile.h>
|
#include <pifile.h>
|
||||||
#include <pijson.h>
|
#include <pijson.h>
|
||||||
#include <pivaluetree.h>
|
#include <pivaluetree.h>
|
||||||
@@ -14,6 +15,8 @@
|
|||||||
|
|
||||||
MainWindow::MainWindow(QWidget * parent): EMainWindow(parent), Ui::MainWindow() {
|
MainWindow::MainWindow(QWidget * parent): EMainWindow(parent), Ui::MainWindow() {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
setRecentMenu(menuOpen_recent);
|
||||||
|
setAcceptDrops(true);
|
||||||
session.setFile(QAD::userPath(QAD::ltConfig, "session_valuetreeeditor"));
|
session.setFile(QAD::userPath(QAD::ltConfig, "session_valuetreeeditor"));
|
||||||
session.addEntry(this);
|
session.addEntry(this);
|
||||||
session.load();
|
session.load();
|
||||||
@@ -91,6 +94,34 @@ void MainWindow::changeEvent(QEvent * e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::dragEnterEvent(QDragEnterEvent * e) {
|
||||||
|
if (!e->mimeData()) return;
|
||||||
|
QString str = e->mimeData()->text();
|
||||||
|
if (str.isEmpty()) return;
|
||||||
|
static QStringList exts({"conf", "ini", "json", "bin"});
|
||||||
|
if (exts.contains(QFileInfo(str).suffix().toLower().trimmed())) {
|
||||||
|
e->accept();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::dropEvent(QDropEvent * e) {
|
||||||
|
if (!e->mimeData()) return;
|
||||||
|
auto path = QUrl(e->mimeData()->text()).toLocalFile();
|
||||||
|
if (load(path)) addToRecent(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::loadingSession(QPIConfig & conf) {
|
||||||
|
setRecentFiles(conf.getValue("recent files").toStringList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::savingSession(QPIConfig & conf) {
|
||||||
|
conf.setValue("recent files", recentFiles());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QString MainWindow::loadFilter() {
|
QString MainWindow::loadFilter() {
|
||||||
return "All types(*.conf *.ini *.json *.bin);;INI format(*.conf *.ini);;JSON(*.json);;Binary(*.bin)";
|
return "All types(*.conf *.ini *.json *.bin);;INI format(*.conf *.ini);;JSON(*.json);;Binary(*.bin)";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,11 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent * e) override;
|
void changeEvent(QEvent * e) override;
|
||||||
|
void dragEnterEvent(QDragEnterEvent * e) override;
|
||||||
|
void dropEvent(QDropEvent * e) override;
|
||||||
|
|
||||||
|
void loadingSession(QPIConfig & conf) override;
|
||||||
|
void savingSession(QPIConfig & conf) override;
|
||||||
QString loadFilter() override;
|
QString loadFilter() override;
|
||||||
QString saveFilter() override { return loadFilter(); }
|
QString saveFilter() override { return loadFilter(); }
|
||||||
|
|
||||||
|
|||||||
@@ -44,12 +44,12 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>780</width>
|
<width>780</width>
|
||||||
<height>444</height>
|
<height>437</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="PIValueTreeEdit" name="widget" native="true"/>
|
<widget class="PIValueTreeEdit" name="widget"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
@@ -91,15 +91,25 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>780</width>
|
<width>780</width>
|
||||||
<height>31</height>
|
<height>29</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>File</string>
|
<string>File</string>
|
||||||
</property>
|
</property>
|
||||||
|
<widget class="QMenu" name="menuOpen_recent">
|
||||||
|
<property name="title">
|
||||||
|
<string>Open recent</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../libs/widgets/qad_widgets.qrc">
|
||||||
|
<normaloff>:/icons/document-open-recent.png</normaloff>:/icons/document-open-recent.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<addaction name="actionNew"/>
|
<addaction name="actionNew"/>
|
||||||
<addaction name="actionOpen"/>
|
<addaction name="actionOpen"/>
|
||||||
|
<addaction name="menuOpen_recent"/>
|
||||||
<addaction name="actionSave"/>
|
<addaction name="actionSave"/>
|
||||||
<addaction name="actionSaveAs"/>
|
<addaction name="actionSaveAs"/>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -152,7 +162,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionNew">
|
<action name="actionNew">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../libs/widgets/qad_widgets.qrc">
|
<iconset resource="../../libs/qglview/qglview.qrc">
|
||||||
<normaloff>:/icons/document-new.png</normaloff>:/icons/document-new.png</iconset>
|
<normaloff>:/icons/document-new.png</normaloff>:/icons/document-new.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -164,7 +174,7 @@
|
|||||||
</action>
|
</action>
|
||||||
<action name="actionAbout">
|
<action name="actionAbout">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../../cd/utils/pult/cdpult.qrc">
|
<iconset resource="../../libs/graphic_analysis/qad_graphic_analysis.qrc">
|
||||||
<normaloff>:/icons/dialog-information.png</normaloff>:/icons/dialog-information.png</iconset>
|
<normaloff>:/icons/dialog-information.png</normaloff>:/icons/dialog-information.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -201,8 +211,9 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../cd/utils/pult/cdpult.qrc"/>
|
|
||||||
<include location="../../libs/blockview/qad_blockview.qrc"/>
|
<include location="../../libs/blockview/qad_blockview.qrc"/>
|
||||||
|
<include location="../../libs/graphic_analysis/qad_graphic_analysis.qrc"/>
|
||||||
|
<include location="../../libs/qglview/qglview.qrc"/>
|
||||||
<include location="../../libs/widgets/qad_widgets.qrc"/>
|
<include location="../../libs/widgets/qad_widgets.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
|
|||||||
Reference in New Issue
Block a user