Compare commits
15 Commits
49ae1473f9
...
b1852ab1fa
| Author | SHA1 | Date | |
|---|---|---|---|
| b1852ab1fa | |||
| b4e77d136a | |||
| ebebcd11ce | |||
| 32da3d029d | |||
| 681a79a672 | |||
| 88bcc7f2e9 | |||
| 04d9cf6edf | |||
| 66dc481d6e | |||
| f8e361190b | |||
| 745376adfb | |||
| 13d4e6cb75 | |||
| 0f13cf5196 | |||
| d403d0a242 | |||
| c959a712f7 | |||
| f9a8f5d6b1 |
@@ -135,7 +135,7 @@ JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
LambdaBodyIndentation: Signature
|
||||
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
|
||||
NamespaceIndentation: None
|
||||
ObjCBinPackProtocolList: Auto
|
||||
|
||||
@@ -4,7 +4,7 @@ cmake_policy(SET CMP0072 NEW) # FindOpenGL prefers GLVND by default
|
||||
project(QAD)
|
||||
set(QAD_MAJOR 2)
|
||||
set(QAD_MINOR 32)
|
||||
set(QAD_REVISION 1)
|
||||
set(QAD_REVISION 2)
|
||||
set(QAD_SUFFIX )
|
||||
set(QAD_COMPANY SHS)
|
||||
set(QAD_DOMAIN org.SHS)
|
||||
|
||||
@@ -726,7 +726,7 @@ macro(qad_target_link_libraries _NAME)
|
||||
list(APPEND _ARGS ${_i})
|
||||
endif()
|
||||
endforeach()
|
||||
target_link_libraries(${_TARGET} ${Qt${_v}_LIBRARIES} ${_ARGS})
|
||||
target_link_libraries(${_TARGET} ${_ARGS} ${Qt${_v}_LIBRARIES})
|
||||
#message("link ${_TARGET}: ${Qt${_v}_LIBRARIES} ${_ARGS}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -342,6 +342,7 @@ void Graphic::procGesture(QGesture * g) {
|
||||
QPointF dp = -pg->delta();
|
||||
dp.rx() /= getScaleX();
|
||||
dp.ry() /= getScaleY();
|
||||
dp.ry() = -dp.y();
|
||||
selrect.translate(dp);
|
||||
totalUpdate();
|
||||
} break;
|
||||
@@ -357,11 +358,7 @@ void Graphic::procGesture(QGesture * g) {
|
||||
} break;
|
||||
case Qt::TapAndHoldGesture: {
|
||||
QTapAndHoldGesture * pg = (QTapAndHoldGesture *)g;
|
||||
if (pg->state() == Qt::GestureStarted)
|
||||
QMetaObject::invokeMethod(
|
||||
this,
|
||||
[this]() { showMenu(); },
|
||||
Qt::QueuedConnection);
|
||||
if (pg->state() == Qt::GestureStarted) QMetaObject::invokeMethod(this, [this]() { showMenu(); }, Qt::QueuedConnection);
|
||||
} break;
|
||||
default: break;
|
||||
}
|
||||
@@ -2318,12 +2315,29 @@ void Graphic::on_graphic_buttonAutofit_clicked() {
|
||||
|
||||
void Graphic::on_graphic_buttonConfigure_clicked() {
|
||||
conf->graphicItems.clear();
|
||||
for (int i = 0; i < graphics.size(); i++) {
|
||||
int all_checks[2] = {-1, -1};
|
||||
auto addAllChecks = [](int & out, bool is_vis) {
|
||||
if (out < 0)
|
||||
out = is_vis ? Qt::Checked : Qt::Unchecked;
|
||||
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 = graphics[i].icon;
|
||||
item.name = graphics[i].name;
|
||||
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->comboStyleGrid->setCurrentIndex((int)grid_pen.style());
|
||||
conf->ui->spinWidthGrid->setValue(grid_pen.widthF());
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="qad_graphic.qrc">
|
||||
<normaloff>:/icons/zoom-original.png</normaloff>:/icons/zoom-original.png</iconset>
|
||||
<normaloff>:/icons/zoom-original.png</normaloff>:/icons/zoom-original.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -505,6 +505,9 @@
|
||||
<property name="shortcut">
|
||||
<string>Esc</string>
|
||||
</property>
|
||||
<property name="shortcutContext">
|
||||
<enum>Qt::WidgetShortcut</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCheck_all">
|
||||
<property name="icon">
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
if (HAS_GL)
|
||||
qad_library(graphic3d "Gui;Widgets;DataVisualization" "")
|
||||
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" "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ void GraphicAnalysis::updateGraphic(int index) {
|
||||
void GraphicAnalysis::updateAllGraphic() {
|
||||
for (int i = 0; i < graphicsCount(); ++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) {
|
||||
tf_gr = f;
|
||||
updateAllGraphic();
|
||||
}
|
||||
|
||||
|
||||
void GraphicAnalysis::setSpectrumTransformFunction(std::function<QPolygonF(const QPolygonF &)> f) {
|
||||
tf_fft = f;
|
||||
updateAllGraphic();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
MapViewTileProvider_MapTiler::MapViewTileProvider_MapTiler() {
|
||||
nam = new QNetworkAccessManager();
|
||||
PIValueTree p;
|
||||
p.addChild(PIValueTree("url", "https://api.maptiler.com/maps"));
|
||||
p.addChild(PIValueTree("url", "https://api.maptiler.com/tiles"));
|
||||
p.addChild(PIValueTree("key", ""));
|
||||
p.addChild(PIValueTree("tileset", ""));
|
||||
initParameters(p);
|
||||
@@ -32,11 +32,15 @@ bool MapViewTileProvider_MapTiler::requestTile(MapViewTypes::TileIndex index) {
|
||||
req.setHeader(QNetworkRequest::UserAgentHeader, "Qt/5");
|
||||
auto * r = nam->get(req);
|
||||
if (!r) return false;
|
||||
// qDebug() << "Reqst:" << index.z << index.x << index.y;
|
||||
// qDebug() << "Reqst:" << index.z << index.x << index.y << req.url().toString();
|
||||
connect(r, &QNetworkReply::finished, this, [this, r, index]() {
|
||||
r->deleteLater();
|
||||
QPixmap tim;
|
||||
if (r->error() != QNetworkReply::NoError) {
|
||||
if (r->error() == QNetworkReply::ContentAccessDenied) {
|
||||
qDebug() << "Error:" << index.z << index.x << index.y << r->error();
|
||||
return;
|
||||
}
|
||||
qDebug() << "Retry:" << index.z << index.x << index.y << r->error();
|
||||
QTimer::singleShot(500, this, [this, index] { requestTile(index); });
|
||||
return;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
MapViewTileProvider_OSM::MapViewTileProvider_OSM() {
|
||||
nam = new QNetworkAccessManager();
|
||||
PIValueTree p;
|
||||
p.addChild(PIValueTree("url", "http://tile.openstreetmap.org"));
|
||||
p.addChild(PIValueTree("url", "https://tile.openstreetmap.org"));
|
||||
initParameters(p);
|
||||
}
|
||||
|
||||
|
||||
@@ -608,7 +608,7 @@ void PIValueTreeEdit::applyVariantEdit(PIVariantEdit * ve, const PIValueTree & v
|
||||
ve->setAttributes(attributesWithRO(vt.attributes()));
|
||||
ve->setValue(vt.value());
|
||||
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 <QSqlQuery>
|
||||
#include <QVariant>
|
||||
#include <functional>
|
||||
|
||||
|
||||
namespace QAD {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <QHeaderView>
|
||||
#include <QKeyEvent>
|
||||
#include <QScreen>
|
||||
|
||||
|
||||
QCodeEditCompleter::QCodeEditCompleter(QWidget * parent): QTreeWidget(parent) {
|
||||
@@ -79,8 +80,13 @@ void QCodeEditCompleter::invoke(QPoint global_pos) {
|
||||
setCurrentItem(topLevelItem(1));
|
||||
if (isHidden()) move(global_pos);
|
||||
if (topLevelItemCount() > 0) {
|
||||
const auto screen = qApp->screenAt(global_pos);
|
||||
setVisible(true);
|
||||
adjust();
|
||||
if (global_pos.y() + height() > screen->availableSize().height()) {
|
||||
global_pos.setY(global_pos.y() -height() - fontHeight(this));
|
||||
}
|
||||
move(global_pos);
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <QActionGroup>
|
||||
#include <QFileInfo>
|
||||
#include <QMetaEnum>
|
||||
#include <QMimeData>
|
||||
#include <pifile.h>
|
||||
#include <pijson.h>
|
||||
#include <pivaluetree.h>
|
||||
@@ -14,6 +15,8 @@
|
||||
|
||||
MainWindow::MainWindow(QWidget * parent): EMainWindow(parent), Ui::MainWindow() {
|
||||
setupUi(this);
|
||||
setRecentMenu(menuOpen_recent);
|
||||
setAcceptDrops(true);
|
||||
session.setFile(QAD::userPath(QAD::ltConfig, "session_valuetreeeditor"));
|
||||
session.addEntry(this);
|
||||
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() {
|
||||
return "All types(*.conf *.ini *.json *.bin);;INI format(*.conf *.ini);;JSON(*.json);;Binary(*.bin)";
|
||||
}
|
||||
|
||||
@@ -20,7 +20,11 @@ public:
|
||||
|
||||
protected:
|
||||
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 saveFilter() override { return loadFilter(); }
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>780</width>
|
||||
<height>444</height>
|
||||
<height>437</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="PIValueTreeEdit" name="widget" native="true"/>
|
||||
<widget class="PIValueTreeEdit" name="widget"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
@@ -91,15 +91,25 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>780</width>
|
||||
<height>31</height>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</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="actionOpen"/>
|
||||
<addaction name="menuOpen_recent"/>
|
||||
<addaction name="actionSave"/>
|
||||
<addaction name="actionSaveAs"/>
|
||||
</widget>
|
||||
@@ -152,7 +162,7 @@
|
||||
</action>
|
||||
<action name="actionNew">
|
||||
<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>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -164,7 +174,7 @@
|
||||
</action>
|
||||
<action name="actionAbout">
|
||||
<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>
|
||||
</property>
|
||||
<property name="text">
|
||||
@@ -201,8 +211,9 @@
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../../../cd/utils/pult/cdpult.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"/>
|
||||
</resources>
|
||||
<connections>
|
||||
|
||||
Reference in New Issue
Block a user