Compare commits
16 Commits
9130496887
...
release
| Author | SHA1 | Date | |
|---|---|---|---|
| 75b3bb46ac | |||
| 75c6b5abcc | |||
| 97c6ddeaea | |||
| 235eb2acb8 | |||
| bd5579b8f1 | |||
| 7f820c8f67 | |||
| 5ae5034145 | |||
| 016753fb4d | |||
| b71db0530f | |||
| bb645bd71b | |||
| 12664842c7 | |||
| c41e92a9f5 | |||
| 6e4cdccc94 | |||
| e59bf65294 | |||
| 2e5d64f258 | |||
| 5382c54d6a |
@@ -35,7 +35,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(_QAD_MAJOR 1)
|
set(_QAD_MAJOR 1)
|
||||||
set(_QAD_MINOR 7)
|
set(_QAD_MINOR 9)
|
||||||
set(_QAD_REVISION 0)
|
set(_QAD_REVISION 0)
|
||||||
set(_QAD_SUFFIX )
|
set(_QAD_SUFFIX )
|
||||||
set(_QAD_COMPANY SHS)
|
set(_QAD_COMPANY SHS)
|
||||||
|
|||||||
2
pip
2
pip
Submodule pip updated: f033119a8b...a4b3edb3e1
@@ -32,7 +32,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="Graphic" name="graphic">
|
<widget class="Graphic" name="graphic">
|
||||||
<property name="buttons">
|
<property name="buttons">
|
||||||
<set>Graphic::Autofit|Graphic::BorderInputs|Graphic::Clear|Graphic::Configure|Graphic::CursorAxis|Graphic::Fullscreen|Graphic::Legend|Graphic::OnlyExpandY|Graphic::Pause|Graphic::Save</set>
|
<set>Graphic::Autofit|Graphic::BorderInputs|Graphic::Clear|Graphic::Configure|Graphic::CursorAxis|Graphic::Fullscreen|Graphic::Legend|Graphic::Pause|Graphic::Save</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="borderInputsVisible">
|
<property name="borderInputsVisible">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
<RCC>
|
|
||||||
<qresource prefix="/">
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
@@ -7,7 +7,7 @@ else()
|
|||||||
set(APP_ICON "icons/qpicalculator.png")
|
set(APP_ICON "icons/qpicalculator.png")
|
||||||
endif()
|
endif()
|
||||||
set(APP_INFO "Small calculator ang grapher")
|
set(APP_INFO "Small calculator ang grapher")
|
||||||
qad_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;qad_graphic")
|
qad_application(${PROJECT_NAME} "Gui;Widgets" "qad_utils;qad_widgets;qad_graphic;pip;piqt")
|
||||||
if (Qt5_FOUND)
|
if (Qt5_FOUND)
|
||||||
import_version(${PROJ_NAME}5 ${PROJECT_NAME})
|
import_version(${PROJ_NAME}5 ${PROJECT_NAME})
|
||||||
deploy_target(${PROJECT_NAME}5 DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${ROOT_DIR}/release)
|
deploy_target(${PROJECT_NAME}5 DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${ROOT_DIR}/release)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "piqt.h"
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget * parent): QMainWindow(parent), Ui::MainWindow() {
|
MainWindow::MainWindow(QWidget * parent): QMainWindow(parent), Ui::MainWindow() {
|
||||||
@@ -62,7 +63,7 @@ void MainWindow::redrawGraphics() {
|
|||||||
graphic->setGraphicName(ti->text(1), i);
|
graphic->setGraphicName(ti->text(1), i);
|
||||||
pol.clear();
|
pol.clear();
|
||||||
if (ti->checkState(0) == Qt::Checked) {
|
if (ti->checkState(0) == Qt::Checked) {
|
||||||
if (evaluator.check(ti->text(1))) {
|
if (evaluator.check(Q2PIString(ti->text(1)))) {
|
||||||
cx = sx;
|
cx = sx;
|
||||||
while (cx < fx) {
|
while (cx < fx) {
|
||||||
evaluator.setVariable(vi, complexd(cx, 0.));
|
evaluator.setVariable(vi, complexd(cx, 0.));
|
||||||
@@ -140,19 +141,19 @@ void MainWindow::saving(QPIConfig & conf) {
|
|||||||
|
|
||||||
|
|
||||||
void MainWindow::on_lineInput_textChanged(QString text) {
|
void MainWindow::on_lineInput_textChanged(QString text) {
|
||||||
if (evaluator.check(text)) lineInput->setPalette(npal);
|
if (evaluator.check(Q2PIString(text))) lineInput->setPalette(npal);
|
||||||
else lineInput->setPalette(epal);
|
else lineInput->setPalette(epal);
|
||||||
labelParsed->setText(evaluator.expression());
|
labelParsed->setText(PI2QString(evaluator.expression()));
|
||||||
labelError->setText(evaluator.error());
|
labelError->setText(PI2QString(evaluator.error()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_lineInput_returnPressed() {
|
void MainWindow::on_lineInput_returnPressed() {
|
||||||
bool ret = evaluator.check(lineInput->text());
|
bool ret = evaluator.check(Q2PIString(lineInput->text()));
|
||||||
if (ret) lineInput->setPalette(npal);
|
if (ret) lineInput->setPalette(npal);
|
||||||
else lineInput->setPalette(epal);
|
else lineInput->setPalette(epal);
|
||||||
labelParsed->setText(evaluator.expression());
|
labelParsed->setText(PI2QString(evaluator.expression()));
|
||||||
labelError->setText(evaluator.error());
|
labelError->setText(PI2QString(evaluator.error()));
|
||||||
if (!ret) return;
|
if (!ret) return;
|
||||||
complexd val = evaluator.evaluate();
|
complexd val = evaluator.evaluate();
|
||||||
evaluator.setVariable(ans, val);
|
evaluator.setVariable(ans, val);
|
||||||
@@ -182,6 +183,16 @@ void MainWindow::on_lineInput_returnPressed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_treeGraphics_itemSelectionChanged() {
|
||||||
|
buttonGraphicDel->setDisabled(treeGraphics->selectedItems().isEmpty());
|
||||||
|
if (treeGraphics->currentItem()) {
|
||||||
|
int ind = treeGraphics->indexOfTopLevelItem(treeGraphics->currentItem());
|
||||||
|
if (ind < 0 || ind >= graphic->graphicsCount()) return;
|
||||||
|
graphic->setCurrentGraphic(ind);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_treeGraphics_itemDoubleClicked(QTreeWidgetItem * item, int column) {
|
void MainWindow::on_treeGraphics_itemDoubleClicked(QTreeWidgetItem * item, int column) {
|
||||||
Qt::ItemFlags f = item->flags();
|
Qt::ItemFlags f = item->flags();
|
||||||
if (column != 1) f &= ~Qt::ItemIsEditable;
|
if (column != 1) f &= ~Qt::ItemIsEditable;
|
||||||
@@ -254,7 +265,7 @@ void MainWindow::on_tabWidget_currentChanged(int index) {
|
|||||||
vn = treeVariables->topLevelItem(i)->text(0);
|
vn = treeVariables->topLevelItem(i)->text(0);
|
||||||
vv = treeVariables->topLevelItem(i)->text(1);
|
vv = treeVariables->topLevelItem(i)->text(1);
|
||||||
eval.check(vv);
|
eval.check(vv);
|
||||||
evaluator.setVariable(vn, eval.evaluate());
|
evaluator.setVariable(Q2PIString(vn), eval.evaluate());
|
||||||
}
|
}
|
||||||
if (index == 0) on_lineInput_returnPressed();
|
if (index == 0) on_lineInput_returnPressed();
|
||||||
if (index == 2) redrawGraphics();
|
if (index == 2) redrawGraphics();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "qpievaluator.h"
|
#include "pievaluator.h"
|
||||||
#include "session_manager.h"
|
#include "session_manager.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ private:
|
|||||||
void updateGraphics();
|
void updateGraphics();
|
||||||
void redrawGraphics();
|
void redrawGraphics();
|
||||||
|
|
||||||
QPIEvaluator evaluator;
|
PIEvaluator evaluator;
|
||||||
QPalette npal, epal;
|
QPalette npal, epal;
|
||||||
SessionManager session;
|
SessionManager session;
|
||||||
int ans;
|
int ans;
|
||||||
@@ -39,7 +39,7 @@ private slots:
|
|||||||
void on_lineInput_returnPressed();
|
void on_lineInput_returnPressed();
|
||||||
void on_treeHistory_itemDoubleClicked(QTreeWidgetItem * item, int column) {lineInput->setText(item->text(0));}
|
void on_treeHistory_itemDoubleClicked(QTreeWidgetItem * item, int column) {lineInput->setText(item->text(0));}
|
||||||
void on_treeVariables_itemSelectionChanged() {buttonVarDel->setDisabled(treeVariables->selectedItems().isEmpty());}
|
void on_treeVariables_itemSelectionChanged() {buttonVarDel->setDisabled(treeVariables->selectedItems().isEmpty());}
|
||||||
void on_treeGraphics_itemSelectionChanged() {buttonGraphicDel->setDisabled(treeGraphics->selectedItems().isEmpty());}
|
void on_treeGraphics_itemSelectionChanged();
|
||||||
void on_treeGraphics_itemChanged(QTreeWidgetItem * , int col) { if (active_) redrawGraphics();}
|
void on_treeGraphics_itemChanged(QTreeWidgetItem * , int col) { if (active_) redrawGraphics();}
|
||||||
void on_treeGraphics_itemDoubleClicked(QTreeWidgetItem * item, int column);
|
void on_treeGraphics_itemDoubleClicked(QTreeWidgetItem * item, int column);
|
||||||
void on_buttonVarAdd_clicked();
|
void on_buttonVarAdd_clicked();
|
||||||
|
|||||||
@@ -114,7 +114,7 @@
|
|||||||
<string>OK</string>
|
<string>OK</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../widgets/qad_widgets.qrc">
|
<iconset resource="qad_application.qrc">
|
||||||
<normaloff>:/icons/dialog-ok-apply.png</normaloff>:/icons/dialog-ok-apply.png</iconset>
|
<normaloff>:/icons/dialog-ok-apply.png</normaloff>:/icons/dialog-ok-apply.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -131,7 +131,6 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../widgets/qad_widgets.qrc"/>
|
|
||||||
<include location="qad_application.qrc"/>
|
<include location="qad_application.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
|
|||||||
@@ -1,34 +1,17 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>../../icons/application-exit.png</file>
|
<file>../../icons/dialog-ok-apply.png</file>
|
||||||
<file>../../icons/dialog-close.png</file>
|
|
||||||
<file>../../icons/configure.png</file>
|
<file>../../icons/configure.png</file>
|
||||||
<file>../../icons/document-edit.png</file>
|
|
||||||
<file>../../icons/document-new.png</file>
|
|
||||||
<file>../../icons/document-save.png</file>
|
|
||||||
<file>../../icons/document-save-all.png</file>
|
|
||||||
<file>../../icons/document-save-as.png</file>
|
|
||||||
<file>../../icons/document-open.png</file>
|
|
||||||
<file>../../icons/document-open-recent.png</file>
|
|
||||||
<file>../../icons/document-close.png</file>
|
|
||||||
<file>../../icons/edit-clear.png</file>
|
<file>../../icons/edit-clear.png</file>
|
||||||
<file>../../icons/edit-clear-locationbar-rtl.png</file>
|
|
||||||
<file>../../icons/edit-find.png</file>
|
<file>../../icons/edit-find.png</file>
|
||||||
<file>../../icons/list-add.png</file>
|
|
||||||
<file>../../icons/edit-delete.png</file>
|
|
||||||
<file>../../icons/edit-copy.png</file>
|
<file>../../icons/edit-copy.png</file>
|
||||||
<file>../../icons/edit-paste.png</file>
|
|
||||||
<file>../../icons/edit-undo.png</file>
|
|
||||||
<file>../../icons/edit-redo.png</file>
|
|
||||||
<file>../../icons/border-line.png</file>
|
|
||||||
<file>../../icons/edockwidget.png</file>
|
<file>../../icons/edockwidget.png</file>
|
||||||
<file>../../icons/historyview.png</file>
|
<file>../../icons/historyview.png</file>
|
||||||
|
<file>../../icons/logview.png</file>
|
||||||
<file>../../icons/clear-history.png</file>
|
<file>../../icons/clear-history.png</file>
|
||||||
<file>../../icons/layer-visible-off.png</file>
|
<file>../../icons/layer-visible-off.png</file>
|
||||||
<file>../../icons/layer-visible-on.png</file>
|
<file>../../icons/layer-visible-on.png</file>
|
||||||
<file>../../icons/logview.png</file>
|
|
||||||
<file>../../icons/qt.png</file>
|
<file>../../icons/qt.png</file>
|
||||||
<file>../../icons/select-all.png</file>
|
<file>../../icons/select-all.png</file>
|
||||||
<file>../../icons/select-none.png</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -194,7 +194,7 @@
|
|||||||
<string>Add</string>
|
<string>Add</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/list-add.png</normaloff>:/icons/list-add.png</iconset>
|
<normaloff>:/icons/list-add.png</normaloff>:/icons/list-add.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -205,7 +205,7 @@
|
|||||||
<string>Clone</string>
|
<string>Clone</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/edit-copy.png</normaloff>:/icons/edit-copy.png</iconset>
|
<normaloff>:/icons/edit-copy.png</normaloff>:/icons/edit-copy.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -232,7 +232,7 @@
|
|||||||
<string>Remove selected</string>
|
<string>Remove selected</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/edit-delete.png</normaloff>:/icons/edit-delete.png</iconset>
|
<normaloff>:/icons/edit-delete.png</normaloff>:/icons/edit-delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
<string>Remove all</string>
|
<string>Remove all</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -346,7 +346,7 @@
|
|||||||
<string>Save</string>
|
<string>Save</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
<string>Save as ...</string>
|
<string>Save as ...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
@@ -406,7 +406,7 @@
|
|||||||
<string>Load ...</string>
|
<string>Load ...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../application/qad_application.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/document-open.png</normaloff>:/icons/document-open.png</iconset>
|
<normaloff>:/icons/document-open.png</normaloff>:/icons/document-open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
@@ -433,7 +433,7 @@
|
|||||||
<string>Clear</string>
|
<string>Clear</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -443,7 +443,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
<action name="actionRemove_items">
|
<action name="actionRemove_items">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/edit-delete.png</normaloff>:/icons/edit-delete.png</iconset>
|
<normaloff>:/icons/edit-delete.png</normaloff>:/icons/edit-delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -467,8 +467,6 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../utils/qad_utils.qrc"/>
|
|
||||||
<include location="../application/qad_application.qrc"/>
|
|
||||||
<include location="qad_blockview.qrc"/>
|
<include location="qad_blockview.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
<string>Edit text ...</string>
|
<string>Edit text ...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../application/qad_application.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/document-edit.png</normaloff>:/icons/document-edit.png</iconset>
|
<normaloff>:/icons/document-edit.png</normaloff>:/icons/document-edit.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolButtonStyle">
|
<property name="toolButtonStyle">
|
||||||
@@ -591,7 +591,7 @@
|
|||||||
<string>Load image ...</string>
|
<string>Load image ...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../application/qad_application.qrc">
|
<iconset resource="qad_blockview.qrc">
|
||||||
<normaloff>:/icons/document-open.png</normaloff>:/icons/document-open.png</iconset>
|
<normaloff>:/icons/document-open.png</normaloff>:/icons/document-open.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -814,7 +814,6 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../application/qad_application.qrc"/>
|
|
||||||
<include location="qad_blockview.qrc"/>
|
<include location="qad_blockview.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@@ -1,39 +1,16 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>../../icons/draw-line.png</file>
|
|
||||||
<file>../../icons/align-hor.png</file>
|
|
||||||
<file>../../icons/align-ver.png</file>
|
|
||||||
<file>../../icons/dialog-close.png</file>
|
|
||||||
<file>../../icons/edit-clear.png</file>
|
|
||||||
<file>../../icons/edit-guides.png</file>
|
|
||||||
<file>../../icons/view-grid.png</file>
|
|
||||||
<file>../../icons/zoom-fit-best.png</file>
|
|
||||||
<file>../../icons/configure.png</file>
|
|
||||||
<file>../../icons/document-save.png</file>
|
|
||||||
<file>../../icons/edit-clear-locationbar-rtl.png</file>
|
|
||||||
<file>../../icons/edit-find.png</file>
|
|
||||||
<file>../../icons/list-add.png</file>
|
|
||||||
<file>../../icons/edit-delete.png</file>
|
|
||||||
<file>../../icons/item.png</file>
|
|
||||||
<file>../../icons/node-add.png</file>
|
|
||||||
<file>../../icons/node.png</file>
|
|
||||||
<file>../../icons/edit-copy.png</file>
|
|
||||||
<file>../../icons/edit-paste.png</file>
|
|
||||||
<file>../../icons/expand_s_x.png</file>
|
|
||||||
<file>../../icons/expand_s_y.png</file>
|
|
||||||
<file>../../icons/expand_x.png</file>
|
|
||||||
<file>../../icons/expand_y.png</file>
|
|
||||||
<file>../../icons/border-line.png</file>
|
|
||||||
<file>../../icons/legend.png</file>
|
|
||||||
<file>../../icons/blockview.png</file>
|
<file>../../icons/blockview.png</file>
|
||||||
<file>../../icons/view-fullscreen.png</file>
|
<file>../../icons/draw-line.png</file>
|
||||||
<file>../../icons/draw-ellipse.png</file>
|
<file>../../icons/draw-ellipse.png</file>
|
||||||
<file>../../icons/draw-rectangle.png</file>
|
<file>../../icons/draw-rectangle.png</file>
|
||||||
<file>../../icons/draw-text.png</file>
|
<file>../../icons/draw-text.png</file>
|
||||||
<file>../../icons/view-preview.png</file>
|
<file>../../icons/z-bottom.png</file>
|
||||||
<file>../../icons/format-fill-color.png</file>
|
<file>../../icons/z-down.png</file>
|
||||||
<file>../../icons/format-stroke-color.png</file>
|
<file>../../icons/z-top.png</file>
|
||||||
<file>../../icons/document-open.png</file>
|
<file>../../icons/z-up.png</file>
|
||||||
|
<file>../../icons/align-hor.png</file>
|
||||||
|
<file>../../icons/align-ver.png</file>
|
||||||
<file>../../icons/align-bottom-center.png</file>
|
<file>../../icons/align-bottom-center.png</file>
|
||||||
<file>../../icons/align-bottom-left.png</file>
|
<file>../../icons/align-bottom-left.png</file>
|
||||||
<file>../../icons/align-bottom-right.png</file>
|
<file>../../icons/align-bottom-right.png</file>
|
||||||
@@ -43,9 +20,15 @@
|
|||||||
<file>../../icons/align-top-center.png</file>
|
<file>../../icons/align-top-center.png</file>
|
||||||
<file>../../icons/align-top-left.png</file>
|
<file>../../icons/align-top-left.png</file>
|
||||||
<file>../../icons/align-top-right.png</file>
|
<file>../../icons/align-top-right.png</file>
|
||||||
<file>../../icons/z-bottom.png</file>
|
<file>../../icons/dialog-close.png</file>
|
||||||
<file>../../icons/z-down.png</file>
|
<file>../../icons/edit-clear.png</file>
|
||||||
<file>../../icons/z-top.png</file>
|
<file>../../icons/edit-delete.png</file>
|
||||||
<file>../../icons/z-up.png</file>
|
<file>../../icons/edit-copy.png</file>
|
||||||
|
<file>../../icons/document-save.png</file>
|
||||||
|
<file>../../icons/document-open.png</file>
|
||||||
|
<file>../../icons/document-edit.png</file>
|
||||||
|
<file>../../icons/view-preview.png</file>
|
||||||
|
<file>../../icons/format-fill-color.png</file>
|
||||||
|
<file>../../icons/format-stroke-color.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include <QTapAndHoldGesture>
|
#include <QTapAndHoldGesture>
|
||||||
#include <QPanGesture>
|
#include <QPanGesture>
|
||||||
#include <QPinchGesture>
|
#include <QPinchGesture>
|
||||||
|
#include <QActionGroup>
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||||
# include <QRandomGenerator>
|
# include <QRandomGenerator>
|
||||||
#endif
|
#endif
|
||||||
@@ -37,6 +38,20 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
|
|||||||
#endif
|
#endif
|
||||||
ui = new Ui::Graphic();
|
ui = new Ui::Graphic();
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
QActionGroup * agroup = new QActionGroup(this);
|
||||||
|
agroup->addAction(ui->actionGuidesFree );
|
||||||
|
agroup->addAction(ui->actionGuidesTraceX);
|
||||||
|
agroup->addAction(ui->actionGuidesTraceY);
|
||||||
|
ui->actionGuidesFree ->setProperty("_value", (int)Free );
|
||||||
|
ui->actionGuidesTraceX->setProperty("_value", (int)TraceX);
|
||||||
|
ui->actionGuidesTraceY->setProperty("_value", (int)TraceY);
|
||||||
|
ui->actionGuidesFree->setChecked(true);
|
||||||
|
connect(agroup, SIGNAL(triggered(QAction*)), this, SLOT(actionGuidesTriggered(QAction*)));
|
||||||
|
ui->checkGuides->addAction(ui->actionGuidesFree );
|
||||||
|
ui->checkGuides->addAction(ui->actionGuidesTraceX);
|
||||||
|
ui->checkGuides->addAction(ui->actionGuidesTraceY);
|
||||||
|
ui->buttonAutofit->addAction(ui->actionExpandX);
|
||||||
|
ui->buttonAutofit->addAction(ui->actionExpandY);
|
||||||
line_x_min.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
line_x_min.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||||
line_x_max.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
line_x_max.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||||
((QBoxLayout * )ui->widgetLY->layout())->insertWidget(0, &line_y_min);
|
((QBoxLayout * )ui->widgetLY->layout())->insertWidget(0, &line_y_min);
|
||||||
@@ -76,6 +91,7 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
|
|||||||
emaxx = emaxy = DBL_MIN;
|
emaxx = emaxy = DBL_MIN;
|
||||||
grad_x = grad_y = Auto;
|
grad_x = grad_y = Auto;
|
||||||
axis_type_x = Numeric;
|
axis_type_x = Numeric;
|
||||||
|
floating_axis_type = Free;
|
||||||
min_repaint_int = 25;
|
min_repaint_int = 25;
|
||||||
inc_x = 1.;
|
inc_x = 1.;
|
||||||
buffer = 0;
|
buffer = 0;
|
||||||
@@ -374,10 +390,7 @@ void Graphic::canvasMousePressEvent(QMouseEvent * e) {
|
|||||||
emit graphicMousePressEvent(canvas2real(QPointF(e->pos())), e->button());
|
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
|
setGuidesCursor();
|
||||||
canvas_gl->setCursor(guides ? Qt::BlankCursor : Qt::ArrowCursor);
|
|
||||||
#endif
|
|
||||||
ui->canvas_raster->setCursor(guides ? Qt::BlankCursor : Qt::ArrowCursor);
|
|
||||||
prevpos = e->pos();
|
prevpos = e->pos();
|
||||||
startpos = prevpos;
|
startpos = prevpos;
|
||||||
startpos_r = canvas2real(startpos);
|
startpos_r = canvas2real(startpos);
|
||||||
@@ -393,7 +406,7 @@ void Graphic::canvasMousePressEvent(QMouseEvent * e) {
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
prevaction = curaction;
|
prevaction = curaction;
|
||||||
curaction = gaMove;
|
setCurrentAction(gaMove);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -419,10 +432,7 @@ void Graphic::canvasMouseReleaseEvent(QMouseEvent * e) {
|
|||||||
if (gestures) return;
|
if (gestures) return;
|
||||||
need_mouse_pan = false;
|
need_mouse_pan = false;
|
||||||
if (!navigation) return;
|
if (!navigation) return;
|
||||||
#ifdef HAS_GL
|
setGuidesCursor();
|
||||||
canvas_gl->setCursor(guides ? Qt::BlankCursor : Qt::ArrowCursor);
|
|
||||||
#endif
|
|
||||||
ui->canvas_raster->setCursor(guides ? Qt::BlankCursor : Qt::ArrowCursor);
|
|
||||||
QPointF tlp, brp;
|
QPointF tlp, brp;
|
||||||
QRect sr;
|
QRect sr;
|
||||||
sr = QRect(startpos, curpos).normalized();
|
sr = QRect(startpos, curpos).normalized();
|
||||||
@@ -585,18 +595,12 @@ void Graphic::setMaxVisibleTime(double val) {
|
|||||||
|
|
||||||
|
|
||||||
void Graphic::setOnlyExpandY(bool yes) {
|
void Graphic::setOnlyExpandY(bool yes) {
|
||||||
only_expand_y = yes;
|
ui->actionExpandY->setChecked(yes);
|
||||||
ui->checkExpandY->blockSignals(true);
|
|
||||||
ui->checkExpandY->setCheckable(yes);
|
|
||||||
ui->checkExpandY->blockSignals(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Graphic::setOnlyExpandX(bool yes) {
|
void Graphic::setOnlyExpandX(bool yes) {
|
||||||
only_expand_x = yes;
|
ui->actionExpandX->setChecked(yes);
|
||||||
ui->checkExpandX->blockSignals(true);
|
|
||||||
ui->checkExpandX->setCheckable(yes);
|
|
||||||
ui->checkExpandX->blockSignals(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -647,8 +651,6 @@ void Graphic::setButtons(Graphic::Buttons b) {
|
|||||||
ui->buttonAutofit->setVisible(b.testFlag(Autofit));
|
ui->buttonAutofit->setVisible(b.testFlag(Autofit));
|
||||||
ui->checkGrid->setVisible(b.testFlag(Grid));
|
ui->checkGrid->setVisible(b.testFlag(Grid));
|
||||||
ui->checkGuides->setVisible(b.testFlag(CursorAxis));
|
ui->checkGuides->setVisible(b.testFlag(CursorAxis));
|
||||||
ui->checkExpandY->setVisible(b.testFlag(OnlyExpandY));
|
|
||||||
ui->checkExpandX->setVisible(b.testFlag(OnlyExpandX));
|
|
||||||
ui->buttonFullscreen->setVisible(b.testFlag(Fullscreen));
|
ui->buttonFullscreen->setVisible(b.testFlag(Fullscreen));
|
||||||
ui->checkBorderInputs->setVisible(b.testFlag(BorderInputs));
|
ui->checkBorderInputs->setVisible(b.testFlag(BorderInputs));
|
||||||
ui->checkLegend->setVisible(b.testFlag(Legend));
|
ui->checkLegend->setVisible(b.testFlag(Legend));
|
||||||
@@ -1149,14 +1151,58 @@ void Graphic::drawGuides() {
|
|||||||
painter->resetTransform();
|
painter->resetTransform();
|
||||||
painter->setClipping(true);
|
painter->setClipping(true);
|
||||||
painter->setClipRect(QRect(gridborder.x(), 0, wid - gridborder.x(), hei - gridborder.y()));
|
painter->setClipRect(QRect(gridborder.x(), 0, wid - gridborder.x(), hei - gridborder.y()));
|
||||||
painter->drawLine(0, curpos.y(), wid, curpos.y());
|
QPoint apos = curpos;
|
||||||
painter->drawLine(curpos.x(), 0, curpos.x(), hei);
|
QPointF rpos = canvas2real(apos);
|
||||||
QString str = pointCoords(canvas2real(curpos)) + fp_size;
|
QString str;
|
||||||
|
str = pointCoords(rpos) + fp_size;
|
||||||
|
switch (floating_axis_type) {
|
||||||
|
case TraceX:
|
||||||
|
if (curGraphic >= 0 && curGraphic < graphics.size()) {
|
||||||
|
QPolygonF & pol(pause_ ? graphics[curGraphic].polyline_pause : graphics[curGraphic].polyline);
|
||||||
|
double cursor = rpos.x(), min_dist = -1, dist = 0.;
|
||||||
|
int index = -1;
|
||||||
|
for (int i = 0; i < pol.size(); ++i) {
|
||||||
|
dist = qAbs<double>(pol[i].x() - cursor);
|
||||||
|
if (min_dist > dist || min_dist < 0) {
|
||||||
|
min_dist = dist;
|
||||||
|
index = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (index >= 0) {
|
||||||
|
rpos = pol[index];
|
||||||
|
apos = real2canvas(rpos).toPoint();
|
||||||
|
str = pointCoords(pol[index]) + fp_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TraceY:
|
||||||
|
if (curGraphic >= 0 && curGraphic < graphics.size()) {
|
||||||
|
QPolygonF & pol(pause_ ? graphics[curGraphic].polyline_pause : graphics[curGraphic].polyline);
|
||||||
|
double cursor = rpos.y(), min_dist = -1, dist = 0.;
|
||||||
|
int index = -1;
|
||||||
|
for (int i = 0; i < pol.size(); ++i) {
|
||||||
|
dist = qAbs<double>(pol[i].y() - cursor);
|
||||||
|
if (min_dist > dist || min_dist < 0) {
|
||||||
|
min_dist = dist;
|
||||||
|
index = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (index >= 0) {
|
||||||
|
rpos = pol[index];
|
||||||
|
apos = real2canvas(rpos).toPoint();
|
||||||
|
str = pointCoords(pol[index]) + fp_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
painter->drawLine(0, apos.y(), wid, apos.y());
|
||||||
|
painter->drawLine(apos.x(), 0, apos.x(), hei);
|
||||||
|
QPoint p = apos + QPoint(font_sz.height() / 4., -font_sz.height() / 4.);
|
||||||
QFontMetrics fm(font());
|
QFontMetrics fm(font());
|
||||||
QRect r = fm.boundingRect(str);
|
QRect r = fm.boundingRect(str);
|
||||||
QPoint p = curpos + QPoint(font_sz.height() / 4., -font_sz.height() / 4.);
|
if (r.width() + apos.x() > wid - font_sz.height() / 2.) p.setX(apos.x() - r.width() - font_sz.height() / 4.);
|
||||||
if (r.width() + curpos.x() > wid - font_sz.height() / 2.) p.setX(curpos.x() - r.width() - font_sz.height() / 4.);
|
if (apos.y() - r.height() < font_sz.height() / 8.) p.setY(apos.y() + r.height() - font_sz.height() / 8.);
|
||||||
if (curpos.y() - r.height() < font_sz.height() / 8.) p.setY(curpos.y() + r.height() - font_sz.height() / 8.);
|
|
||||||
painter->setPen(text_color);
|
painter->setPen(text_color);
|
||||||
painter->drawText(p, str);
|
painter->drawText(p, str);
|
||||||
}
|
}
|
||||||
@@ -1287,8 +1333,7 @@ void Graphic::setCurrentAction(GraphicAction action) {
|
|||||||
curaction = action;
|
curaction = action;
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case gaNone:
|
case gaNone:
|
||||||
if (guides) setCanvasCursor(Qt::BlankCursor);
|
setGuidesCursor();
|
||||||
else setCanvasCursor(Qt::ArrowCursor);
|
|
||||||
break;
|
break;
|
||||||
case gaZoomInRect:
|
case gaZoomInRect:
|
||||||
setCanvasCursor(Qt::CrossCursor);
|
setCanvasCursor(Qt::CrossCursor);
|
||||||
@@ -1314,6 +1359,14 @@ void Graphic::setCanvasCursor(QCursor cursor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Graphic::setGuidesCursor() {
|
||||||
|
if (guides) {
|
||||||
|
setCanvasCursor(floating_axis_type == Free ? Qt::BlankCursor : Qt::CrossCursor);
|
||||||
|
} else
|
||||||
|
setCanvasCursor(Qt::ArrowCursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Graphic::swapToBuffer() {
|
void Graphic::swapToBuffer() {
|
||||||
QImage timg;
|
QImage timg;
|
||||||
#ifdef HAS_GL
|
#ifdef HAS_GL
|
||||||
@@ -1461,8 +1514,7 @@ void Graphic::on_buttonConfigure_clicked() {
|
|||||||
|
|
||||||
void Graphic::on_checkGuides_toggled(bool checked) {
|
void Graphic::on_checkGuides_toggled(bool checked) {
|
||||||
guides = checked;
|
guides = checked;
|
||||||
if (guides) setCanvasCursor(Qt::BlankCursor);
|
setGuidesCursor();
|
||||||
else setCanvasCursor(Qt::ArrowCursor);
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1733,13 +1785,19 @@ void Graphic::setLegendVisible(bool visible) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Graphic::on_checkExpandY_toggled(bool checked) {
|
void Graphic::on_actionExpandX_triggered(bool checked) {
|
||||||
only_expand_y = checked;
|
|
||||||
ui->checkExpandY->setIcon(checked ? icon_exp_y : icon_exp_sy);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Graphic::on_checkExpandX_toggled(bool checked) {
|
|
||||||
only_expand_x = checked;
|
only_expand_x = checked;
|
||||||
ui->checkExpandX->setIcon(checked ? icon_exp_x : icon_exp_sx);
|
ui->actionExpandX->setIcon(checked ? icon_exp_x : icon_exp_sx);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Graphic::on_actionExpandY_triggered(bool checked) {
|
||||||
|
only_expand_y = checked;
|
||||||
|
ui->actionExpandY->setIcon(checked ? icon_exp_y : icon_exp_sy);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Graphic::actionGuidesTriggered(QAction * a) {
|
||||||
|
ui->checkGuides->setChecked(true);
|
||||||
|
setFloatingAxisType((FloatingAxisType)a->property("_value").toInt());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class QAD_GRAPHIC_EXPORT Graphic: public QFrame
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_FLAGS(Buttons)
|
Q_FLAGS(Buttons)
|
||||||
Q_ENUMS(Alignment Graduation AxisType)
|
Q_ENUMS(Alignment Graduation AxisType FloatingAxisType)
|
||||||
|
|
||||||
Q_PROPERTY(QString caption READ caption WRITE setCaption)
|
Q_PROPERTY(QString caption READ caption WRITE setCaption)
|
||||||
Q_PROPERTY(QString labelX READ labelX WRITE setLabelX)
|
Q_PROPERTY(QString labelX READ labelX WRITE setLabelX)
|
||||||
@@ -113,6 +113,7 @@ class QAD_GRAPHIC_EXPORT Graphic: public QFrame
|
|||||||
Q_PROPERTY(double graduationStepX READ graduationStepX WRITE setGraduationStepX)
|
Q_PROPERTY(double graduationStepX READ graduationStepX WRITE setGraduationStepX)
|
||||||
Q_PROPERTY(double graduationStepY READ graduationStepY WRITE setGraduationStepY)
|
Q_PROPERTY(double graduationStepY READ graduationStepY WRITE setGraduationStepY)
|
||||||
Q_PROPERTY(AxisType axisType READ axisType WRITE setAxisType)
|
Q_PROPERTY(AxisType axisType READ axisType WRITE setAxisType)
|
||||||
|
Q_PROPERTY(FloatingAxisType floatingAxisType READ floatingAxisType WRITE setFloatingAxisType)
|
||||||
|
|
||||||
Q_PROPERTY(Graphic::GraphicsData graphicsData READ graphicsData WRITE setGraphicsData)
|
Q_PROPERTY(Graphic::GraphicsData graphicsData READ graphicsData WRITE setGraphicsData)
|
||||||
Q_PROPERTY(QByteArray graphicsDataRaw READ graphicsDataRaw WRITE setGraphicsDataRaw)
|
Q_PROPERTY(QByteArray graphicsDataRaw READ graphicsDataRaw WRITE setGraphicsDataRaw)
|
||||||
@@ -128,8 +129,6 @@ public:
|
|||||||
Autofit = 0x01,
|
Autofit = 0x01,
|
||||||
Grid = 0x02,
|
Grid = 0x02,
|
||||||
CursorAxis = 0x04,
|
CursorAxis = 0x04,
|
||||||
OnlyExpandY = 0x08,
|
|
||||||
OnlyExpandX = 0x10,
|
|
||||||
Fullscreen = 0x20,
|
Fullscreen = 0x20,
|
||||||
BorderInputs = 0x40,
|
BorderInputs = 0x40,
|
||||||
Legend = 0x80,
|
Legend = 0x80,
|
||||||
@@ -143,6 +142,7 @@ public:
|
|||||||
enum Alignment {Left, Right};
|
enum Alignment {Left, Right};
|
||||||
enum Graduation {Auto, Fixed};
|
enum Graduation {Auto, Fixed};
|
||||||
enum AxisType {Numeric, DateTime};
|
enum AxisType {Numeric, DateTime};
|
||||||
|
enum FloatingAxisType {Free, TraceX, TraceY};
|
||||||
Q_DECLARE_FLAGS(Buttons, Button)
|
Q_DECLARE_FLAGS(Buttons, Button)
|
||||||
|
|
||||||
QString caption() const;
|
QString caption() const;
|
||||||
@@ -200,6 +200,7 @@ public:
|
|||||||
double graduationStepX() const {return gridx;}
|
double graduationStepX() const {return gridx;}
|
||||||
double graduationStepY() const {return gridy;}
|
double graduationStepY() const {return gridy;}
|
||||||
AxisType axisType() const {return axis_type_x;}
|
AxisType axisType() const {return axis_type_x;}
|
||||||
|
FloatingAxisType floatingAxisType() const {return floating_axis_type;}
|
||||||
QVector<QPointF> graphicData(const int index = 0) const {return graphics[index].polyline;}
|
QVector<QPointF> graphicData(const int index = 0) const {return graphics[index].polyline;}
|
||||||
GraphicsData graphicsData() const;
|
GraphicsData graphicsData() const;
|
||||||
QByteArray graphicsDataRaw() const;
|
QByteArray graphicsDataRaw() const;
|
||||||
@@ -294,6 +295,7 @@ public slots:
|
|||||||
void setGraduationStepY(double sy) {gridy = sy; if (aupdate) update();}
|
void setGraduationStepY(double sy) {gridy = sy; if (aupdate) update();}
|
||||||
void setGraduationSteps(double sx, double sy) {gridx = sx; gridy = sy; if (aupdate) update();}
|
void setGraduationSteps(double sx, double sy) {gridx = sx; gridy = sy; if (aupdate) update();}
|
||||||
void setAxisType(AxisType t) {axis_type_x = t; if (aupdate) update();}
|
void setAxisType(AxisType t) {axis_type_x = t; if (aupdate) update();}
|
||||||
|
void setFloatingAxisType(FloatingAxisType t) {floating_axis_type = t; setGuidesCursor(); if (aupdate) update();}
|
||||||
|
|
||||||
void addPoint(const QPointF & p, int graphic, bool update_ = true);
|
void addPoint(const QPointF & p, int graphic, bool update_ = true);
|
||||||
void addPoint(const QPointF & p, bool update = true) {addPoint(p, curGraphic, update);}
|
void addPoint(const QPointF & p, bool update = true) {addPoint(p, curGraphic, update);}
|
||||||
@@ -346,6 +348,7 @@ protected:
|
|||||||
void updateLegend(bool es = true);
|
void updateLegend(bool es = true);
|
||||||
void updateLegendChecks();
|
void updateLegendChecks();
|
||||||
void setCanvasCursor(QCursor cursor);
|
void setCanvasCursor(QCursor cursor);
|
||||||
|
void setGuidesCursor();
|
||||||
void swapToBuffer();
|
void swapToBuffer();
|
||||||
void swapToNormal() {bufferActive = false;}
|
void swapToNormal() {bufferActive = false;}
|
||||||
void setRectToLines();
|
void setRectToLines();
|
||||||
@@ -388,6 +391,7 @@ protected:
|
|||||||
QImage icon_pause_b, icon_pause_f;
|
QImage icon_pause_b, icon_pause_f;
|
||||||
Graduation grad_x, grad_y;
|
Graduation grad_x, grad_y;
|
||||||
AxisType axis_type_x;
|
AxisType axis_type_x;
|
||||||
|
FloatingAxisType floating_axis_type;
|
||||||
double gridx, gridy, history, visible_time, inc_x, grid_numbers_x, grid_numbers_y, LN10;
|
double gridx, gridy, history, visible_time, inc_x, grid_numbers_x, grid_numbers_y, LN10;
|
||||||
double eminx, eminy, emaxx, emaxy, pause_phase, gesture_angle;
|
double eminx, eminy, emaxx, emaxy, pause_phase, gesture_angle;
|
||||||
int lastw, lasth, min_repaint_int, timer_pause, thick;
|
int lastw, lasth, min_repaint_int, timer_pause, thick;
|
||||||
@@ -417,11 +421,12 @@ protected slots:
|
|||||||
void on_buttonSave_clicked() {saveImage();}
|
void on_buttonSave_clicked() {saveImage();}
|
||||||
void on_checkGrid_toggled(bool checked) {grid = checked; update();}
|
void on_checkGrid_toggled(bool checked) {grid = checked; update();}
|
||||||
void on_checkGuides_toggled(bool checked);
|
void on_checkGuides_toggled(bool checked);
|
||||||
void on_checkExpandY_toggled(bool checked);
|
void on_actionExpandX_triggered(bool checked);
|
||||||
void on_checkExpandX_toggled(bool checked);
|
void on_actionExpandY_triggered(bool checked);
|
||||||
void on_checkBorderInputs_toggled(bool checked) {setBorderInputsVisible(checked);}
|
void on_checkBorderInputs_toggled(bool checked) {setBorderInputsVisible(checked);}
|
||||||
void on_checkLegend_toggled(bool checked) {setLegendVisible(checked);}
|
void on_checkLegend_toggled(bool checked) {setLegendVisible(checked);}
|
||||||
void on_checkPause_toggled(bool checked) {setPaused(checked);}
|
void on_checkPause_toggled(bool checked) {setPaused(checked);}
|
||||||
|
void actionGuidesTriggered(QAction * a);
|
||||||
void enterFullscreen();
|
void enterFullscreen();
|
||||||
void leaveFullscreen();
|
void leaveFullscreen();
|
||||||
|
|
||||||
@@ -436,7 +441,6 @@ signals:
|
|||||||
void cleared();
|
void cleared();
|
||||||
void visualRectChanged();
|
void visualRectChanged();
|
||||||
void graphicSettingsChanged();
|
void graphicSettingsChanged();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
<string>Grid</string>
|
<string>Grid</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../widgets/qad_widgets.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/view-grid.png</normaloff>:/icons/view-grid.png</iconset>
|
<normaloff>:/icons/view-grid.png</normaloff>:/icons/view-grid.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<string>Cursor axis</string>
|
<string>Cursor axis</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../widgets/qad_widgets.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/edit-guides.png</normaloff>:/icons/edit-guides.png</iconset>
|
<normaloff>:/icons/edit-guides.png</normaloff>:/icons/edit-guides.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
@@ -89,41 +89,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="checkExpandY">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Only expand Y</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../widgets/qad_widgets.qrc">
|
|
||||||
<normaloff>:/icons/expand_s_y.png</normaloff>:/icons/expand_s_y.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="checkExpandX">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Only expand X</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../widgets/qad_widgets.qrc">
|
|
||||||
<normaloff>:/icons/expand_s_x.png</normaloff>:/icons/expand_s_x.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="checkable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="buttonFullscreen">
|
<widget class="QToolButton" name="buttonFullscreen">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Fullscreen</string>
|
<string>Fullscreen</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../blockview/qad_blockview.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/view-fullscreen.png</normaloff>:/icons/view-fullscreen.png</iconset>
|
<normaloff>:/icons/view-fullscreen.png</normaloff>:/icons/view-fullscreen.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -134,7 +106,7 @@
|
|||||||
<string>Border inputs</string>
|
<string>Border inputs</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../widgets/qad_widgets.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/border-line.png</normaloff>:/icons/border-line.png</iconset>
|
<normaloff>:/icons/border-line.png</normaloff>:/icons/border-line.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
@@ -151,7 +123,7 @@
|
|||||||
<string>Legend</string>
|
<string>Legend</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../widgets/qad_widgets.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/legend.png</normaloff>:/icons/legend.png</iconset>
|
<normaloff>:/icons/legend.png</normaloff>:/icons/legend.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
@@ -182,7 +154,7 @@
|
|||||||
<string>Configure ...</string>
|
<string>Configure ...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../widgets/qad_widgets.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset>
|
<normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -193,7 +165,7 @@
|
|||||||
<string>Save image ...</string>
|
<string>Save image ...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -220,7 +192,7 @@
|
|||||||
<string>Clear</string>
|
<string>Clear</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../utils/qad_utils.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -231,7 +203,7 @@
|
|||||||
<string>Close</string>
|
<string>Close</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../widgets/qad_widgets.qrc">
|
<iconset resource="qad_graphic.qrc">
|
||||||
<normaloff>:/icons/dialog-close.png</normaloff>:/icons/dialog-close.png</iconset>
|
<normaloff>:/icons/dialog-close.png</normaloff>:/icons/dialog-close.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -425,6 +397,49 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
<action name="actionGuidesFree">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Free</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionGuidesTraceX">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Trace X</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionGuidesTraceY">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Trace Y</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionExpandX">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Only expand X</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionExpandY">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Only expand Y</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Only expand Y</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
@@ -434,9 +449,6 @@
|
|||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../utils/qad_utils.qrc"/>
|
|
||||||
<include location="../widgets/qad_widgets.qrc"/>
|
|
||||||
<include location="../blockview/qad_blockview.qrc"/>
|
|
||||||
<include location="qad_graphic.qrc"/>
|
<include location="qad_graphic.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|||||||
@@ -1,28 +1,22 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
|
<file>../../icons/expand_s_x.png</file>
|
||||||
|
<file>../../icons/expand_s_y.png</file>
|
||||||
|
<file>../../icons/expand_x.png</file>
|
||||||
|
<file>../../icons/expand_y.png</file>
|
||||||
|
<file>../../icons/pause-back.png</file>
|
||||||
|
<file>../../icons/pause-front.png</file>
|
||||||
<file>../../icons/media-playback-pause.png</file>
|
<file>../../icons/media-playback-pause.png</file>
|
||||||
<file>../../icons/dialog-close.png</file>
|
<file>../../icons/dialog-close.png</file>
|
||||||
<file>../../icons/edit-clear.png</file>
|
<file>../../icons/edit-clear.png</file>
|
||||||
<file>../../icons/edit-guides.png</file>
|
<file>../../icons/edit-guides.png</file>
|
||||||
<file>../../icons/view-grid.png</file>
|
<file>../../icons/view-grid.png</file>
|
||||||
<file>../../icons/view-autofit.png</file>
|
<file>../../icons/view-autofit.png</file>
|
||||||
|
<file>../../icons/view-fullscreen.png</file>
|
||||||
<file>../../icons/configure.png</file>
|
<file>../../icons/configure.png</file>
|
||||||
<file>../../icons/document-save.png</file>
|
<file>../../icons/document-save.png</file>
|
||||||
<file>../../icons/edit-clear-locationbar-rtl.png</file>
|
|
||||||
<file>../../icons/edit-find.png</file>
|
|
||||||
<file>../../icons/list-add.png</file>
|
|
||||||
<file>../../icons/edit-delete.png</file>
|
|
||||||
<file>../../icons/edit-copy.png</file>
|
|
||||||
<file>../../icons/edit-paste.png</file>
|
|
||||||
<file>../../icons/expand_s_x.png</file>
|
|
||||||
<file>../../icons/expand_s_y.png</file>
|
|
||||||
<file>../../icons/expand_x.png</file>
|
|
||||||
<file>../../icons/expand_y.png</file>
|
|
||||||
<file>../../icons/border-line.png</file>
|
<file>../../icons/border-line.png</file>
|
||||||
<file>../../icons/legend.png</file>
|
<file>../../icons/legend.png</file>
|
||||||
<file>../../icons/graphic.png</file>
|
<file>../../icons/graphic.png</file>
|
||||||
<file>../../icons/view-fullscreen.png</file>
|
|
||||||
<file>../../icons/pause-back.png</file>
|
|
||||||
<file>../../icons/pause-front.png</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -1,26 +1,11 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>../../icons/edit-table-insert-row-below.png</file>
|
|
||||||
<file>../../icons/dialog-close.png</file>
|
|
||||||
<file>../../icons/edit-clear.png</file>
|
|
||||||
<file>../../icons/edit-guides.png</file>
|
|
||||||
<file>../../icons/view-grid.png</file>
|
|
||||||
<file>../../icons/zoom-fit-best.png</file>
|
|
||||||
<file>../../icons/configure.png</file>
|
|
||||||
<file>../../icons/document-save.png</file>
|
|
||||||
<file>../../icons/edit-clear-locationbar-rtl.png</file>
|
|
||||||
<file>../../icons/edit-find.png</file>
|
|
||||||
<file>../../icons/list-add.png</file>
|
|
||||||
<file>../../icons/edit-delete.png</file>
|
|
||||||
<file>../../icons/item.png</file>
|
|
||||||
<file>../../icons/node-add.png</file>
|
|
||||||
<file>../../icons/node.png</file>
|
|
||||||
<file>../../icons/edit-copy.png</file>
|
|
||||||
<file>../../icons/edit-paste.png</file>
|
|
||||||
<file>../../icons/expand_s_x.png</file>
|
|
||||||
<file>../../icons/expand_s_y.png</file>
|
|
||||||
<file>../../icons/expand_x.png</file>
|
|
||||||
<file>../../icons/expand_y.png</file>
|
|
||||||
<file>../../icons/sql_table.png</file>
|
<file>../../icons/sql_table.png</file>
|
||||||
|
<file>../../icons/configure.png</file>
|
||||||
|
<file>../../icons/edit-delete.png</file>
|
||||||
|
<file>../../icons/edit-table-insert-row-below.png</file>
|
||||||
|
<file>../../icons/edit-find.png</file>
|
||||||
|
<file>../../icons/edit-clear.png</file>
|
||||||
|
<file>../../icons/list-add.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
<RCC>
|
|
||||||
<qresource prefix="/">
|
|
||||||
<file>../../icons/edit-clear.png</file>
|
|
||||||
<file>../../icons/document-save.png</file>
|
|
||||||
<file>../../icons/edit-clear-locationbar-rtl.png</file>
|
|
||||||
<file>../../icons/edit-find.png</file>
|
|
||||||
<file>../../icons/list-add.png</file>
|
|
||||||
<file>../../icons/edit-delete.png</file>
|
|
||||||
<file>../../icons/item-add.png</file>
|
|
||||||
<file>../../icons/item.png</file>
|
|
||||||
<file>../../icons/node-add.png</file>
|
|
||||||
<file>../../icons/node.png</file>
|
|
||||||
<file>../../icons/edit-copy.png</file>
|
|
||||||
<file>../../icons/edit-paste.png</file>
|
|
||||||
<file>../../icons/document-open_16.png</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
<string>Choose symbol</string>
|
<string>Choose symbol</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="mbricks.qrc">
|
<iconset resource="qad_widgets.qrc">
|
||||||
<normaloff>:/icons/icons/mbricks_128.png</normaloff>:/icons/icons/mbricks_128.png</iconset>
|
<normaloff>:/icons/chardialog.png</normaloff>:/icons/chardialog.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="margin">
|
<property name="margin">
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="mbricks.qrc"/>
|
<include location="qad_widgets.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ QString ImageViewPlugin::group() const {
|
|||||||
|
|
||||||
|
|
||||||
QIcon ImageViewPlugin::icon() const {
|
QIcon ImageViewPlugin::icon() const {
|
||||||
return QIcon(/*":/icons/spinslider.png"*/);
|
return QIcon(":/icons/view-preview.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ QString QPointEditPlugin::group() const {
|
|||||||
|
|
||||||
|
|
||||||
QIcon QPointEditPlugin::icon() const {
|
QIcon QPointEditPlugin::icon() const {
|
||||||
return QIcon(":/icons/qpointedit.png");
|
return QIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ QString QRectEditPlugin::group() const {
|
|||||||
|
|
||||||
|
|
||||||
QIcon QRectEditPlugin::icon() const {
|
QIcon QRectEditPlugin::icon() const {
|
||||||
return QIcon(":/icons/qrectedit.png");
|
return QIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,46 +1,35 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>../../icons/go-next.png</file>
|
<file>../../icons/edit-clear-locationbar-rtl.png</file>
|
||||||
<file>../../icons/go-previous.png</file>
|
<file>../../icons/edit-copy.png</file>
|
||||||
<file>../../icons/dialog-close.png</file>
|
<file>../../icons/edit-paste.png</file>
|
||||||
<file>../../icons/edit-clear.png</file>
|
<file>../../icons/edit-find.png</file>
|
||||||
<file>../../icons/edit-guides.png</file>
|
<file>../../icons/edit-delete.png</file>
|
||||||
<file>../../icons/view-grid.png</file>
|
<file>../../icons/edit-clear.png</file>
|
||||||
<file>../../icons/zoom-fit-best.png</file>
|
<file>../../icons/dialog-ok-apply.png</file>
|
||||||
<file>../../icons/configure.png</file>
|
<file>../../icons/dialog-warning.png</file>
|
||||||
<file>../../icons/alpha.png</file>
|
<file>../../icons/tools-wizard.png</file>
|
||||||
<file>../../icons/document-save.png</file>
|
<file>../../icons/go-next.png</file>
|
||||||
<file>../../icons/edit-clear-locationbar-rtl.png</file>
|
<file>../../icons/go-previous.png</file>
|
||||||
<file>../../icons/edit-find.png</file>
|
<file>../../icons/item.png</file>
|
||||||
<file>../../icons/list-add.png</file>
|
<file>../../icons/item-add.png</file>
|
||||||
<file>../../icons/edit-delete.png</file>
|
<file>../../icons/node.png</file>
|
||||||
<file>../../icons/item-add.png</file>
|
<file>../../icons/node-add.png</file>
|
||||||
<file>../../icons/item.png</file>
|
<file>../../icons/list-add.png</file>
|
||||||
<file>../../icons/node-add.png</file>
|
<file>../../icons/document-save.png</file>
|
||||||
<file>../../icons/node.png</file>
|
<file>../../icons/document-open.png</file>
|
||||||
<file>../../icons/edit-copy.png</file>
|
<file>../../icons/alpha.png</file>
|
||||||
<file>../../icons/edit-paste.png</file>
|
<file>../../icons/chardialog.png</file>
|
||||||
<file>../../icons/expand_s_x.png</file>
|
<file>../../icons/clineedit.png</file>
|
||||||
<file>../../icons/expand_s_y.png</file>
|
<file>../../icons/colorbutton.png</file>
|
||||||
<file>../../icons/expand_x.png</file>
|
<file>../../icons/ecombobox.png</file>
|
||||||
<file>../../icons/expand_y.png</file>
|
<file>../../icons/evalspinbox.png</file>
|
||||||
<file>../../icons/border-line.png</file>
|
<file>../../icons/qcodeedit.png</file>
|
||||||
<file>../../icons/legend.png</file>
|
<file>../../icons/qpiconsole.png</file>
|
||||||
<file>../../icons/chardialog.png</file>
|
<file>../../icons/qvariantedit.png</file>
|
||||||
<file>../../icons/clineedit.png</file>
|
<file>../../icons/spinslider.png</file>
|
||||||
<file>../../icons/colorbutton.png</file>
|
<file>../../icons/code-word.png</file>
|
||||||
<file>../../icons/ecombobox.png</file>
|
<file>../../icons/f1.png</file>
|
||||||
<file>../../icons/qpiconsole.png</file>
|
<file>../../icons/scroll_spin.png</file>
|
||||||
<file>../../icons/spinslider.png</file>
|
</qresource>
|
||||||
<file>../../icons/etabwidget.png</file>
|
|
||||||
<file>../../icons/qcodeedit.png</file>
|
|
||||||
<file>../../icons/qvariantedit.png</file>
|
|
||||||
<file>../../icons/code-word.png</file>
|
|
||||||
<file>../../icons/f1.png</file>
|
|
||||||
<file>../../icons/dialog-ok-apply.png</file>
|
|
||||||
<file>../../icons/dialog-warning.png</file>
|
|
||||||
<file>../../icons/tools-wizard.png</file>
|
|
||||||
<file>../../icons/evalspinbox.png</file>
|
|
||||||
<file>../../icons/scroll_spin.png</file>
|
|
||||||
</qresource>
|
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -1243,7 +1243,7 @@ void QCodeEdit::invokeAutoCompletition(bool force) {
|
|||||||
hideHelp();
|
hideHelp();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
acl << wordsCompletitionList(scope.second);
|
if (word_complet) acl << wordsCompletitionList(scope.second);
|
||||||
QFont bf(font());
|
QFont bf(font());
|
||||||
bf.setBold(true);
|
bf.setBold(true);
|
||||||
foreach (const ACPair & ac, acl) {
|
foreach (const ACPair & ac, acl) {
|
||||||
@@ -1274,8 +1274,9 @@ void QCodeEdit::invokeAutoCompletition(bool force) {
|
|||||||
completer->setVisible(true);
|
completer->setVisible(true);
|
||||||
//qApp->processEvents();
|
//qApp->processEvents();
|
||||||
int sz = completer->verticalScrollBar()->width();
|
int sz = completer->verticalScrollBar()->width();
|
||||||
for (int i = 0; i < completer->header()->count(); ++i)
|
sz += ((QAbstractItemView*)completer)->viewport()->width();
|
||||||
sz += qMax<int>(sz, ((QAbstractItemView*)completer)->sizeHintForColumn(i));
|
// for (int i = 0; i < completer->header()->count(); ++i)
|
||||||
|
// sz += ((QAbstractItemView*)completer)->sizeHintForColumn(i);
|
||||||
completer->resize(sz, fontHeight() * 16);
|
completer->resize(sz, fontHeight() * 16);
|
||||||
} else
|
} else
|
||||||
completer->hide();
|
completer->hide();
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class QAD_WIDGETS_EXPORT QCodeEdit: public QWidget
|
|||||||
Q_PROPERTY(QString text READ text WRITE setText)
|
Q_PROPERTY(QString text READ text WRITE setText)
|
||||||
Q_PROPERTY(bool showSpaces READ showSpaces WRITE setShowSpaces)
|
Q_PROPERTY(bool showSpaces READ showSpaces WRITE setShowSpaces)
|
||||||
Q_PROPERTY(bool showLineNumbers READ showLineNumbers WRITE setShowLineNumbers)
|
Q_PROPERTY(bool showLineNumbers READ showLineNumbers WRITE setShowLineNumbers)
|
||||||
|
Q_PROPERTY(bool wordCompletitionEnabled READ wordCompletitionEnabled WRITE setWordCompletitionEnabled)
|
||||||
Q_PROPERTY(QFont editorFont READ editorFont WRITE setEditorFont)
|
Q_PROPERTY(QFont editorFont READ editorFont WRITE setEditorFont)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -72,6 +73,8 @@ public:
|
|||||||
|
|
||||||
void registerAutoCompletitionClass(int id, ACClassType ac_class, const QString & name, const QIcon & icon = QIcon()) {ac_classes[id] = ACClass(id, ac_class, name, icon);}
|
void registerAutoCompletitionClass(int id, ACClassType ac_class, const QString & name, const QIcon & icon = QIcon()) {ac_classes[id] = ACClass(id, ac_class, name, icon);}
|
||||||
|
|
||||||
|
bool wordCompletitionEnabled() const {return word_complet;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef QPair<QString, QString> StringsPair;
|
typedef QPair<QString, QString> StringsPair;
|
||||||
typedef QPair<int, QList<StringsPair> > ACPair;
|
typedef QPair<int, QList<StringsPair> > ACPair;
|
||||||
@@ -111,6 +114,7 @@ private:
|
|||||||
QStringList cursor_scope;
|
QStringList cursor_scope;
|
||||||
int prev_lc, auto_comp_pl, timer, cur_search_ind, pos_press, pos_el_press;
|
int prev_lc, auto_comp_pl, timer, cur_search_ind, pos_press, pos_el_press;
|
||||||
bool spaces_, _ignore_focus_out, _first, _destructor, _replacing;
|
bool spaces_, _ignore_focus_out, _first, _destructor, _replacing;
|
||||||
|
bool word_complet;
|
||||||
|
|
||||||
bool eventFilter(QObject * o, QEvent * e);
|
bool eventFilter(QObject * o, QEvent * e);
|
||||||
void showEvent(QShowEvent * );
|
void showEvent(QShowEvent * );
|
||||||
@@ -163,6 +167,8 @@ public slots:
|
|||||||
void searchNext(bool next = true);
|
void searchNext(bool next = true);
|
||||||
void searchPrevious();
|
void searchPrevious();
|
||||||
void hideSearch();
|
void hideSearch();
|
||||||
|
void setWordCompletitionEnabled(bool on) {word_complet = on;}
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void textChanged();
|
void textChanged();
|
||||||
|
|||||||
@@ -178,7 +178,7 @@
|
|||||||
<string>Previous</string>
|
<string>Previous</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../../SHS/src/designers/SH_designer/SH_designer.qrc">
|
<iconset resource="qad_widgets.qrc">
|
||||||
<normaloff>:/icons/go-previous.png</normaloff>:/icons/go-previous.png</iconset>
|
<normaloff>:/icons/go-previous.png</normaloff>:/icons/go-previous.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -195,7 +195,7 @@
|
|||||||
<string>Next</string>
|
<string>Next</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="../../../SHS/src/designers/SH_designer/SH_designer.qrc">
|
<iconset resource="qad_widgets.qrc">
|
||||||
<normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset>
|
<normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -311,7 +311,9 @@
|
|||||||
<header>ecombobox.h</header>
|
<header>ecombobox.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="qad_widgets.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>buttonSearchNext</sender>
|
<sender>buttonSearchNext</sender>
|
||||||
|
|||||||
@@ -64,7 +64,9 @@
|
|||||||
<header>evalspinbox.h</header>
|
<header>evalspinbox.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="qad_widgets.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
<slots>
|
<slots>
|
||||||
<slot>mapChanged()</slot>
|
<slot>mapChanged()</slot>
|
||||||
|
|||||||
Reference in New Issue
Block a user