tree changes

This commit is contained in:
2020-08-19 00:47:44 +03:00
parent 4b7c513f7f
commit 3e1768b418
355 changed files with 4116 additions and 4316 deletions

View File

@@ -153,6 +153,7 @@ else()
if (SomeQtFound) if (SomeQtFound)
message(STATUS "Building Qt-derived targets for ${QtVersions}") message(STATUS "Building Qt-derived targets for ${QtVersions}")
add_subdirectory(qad) add_subdirectory(qad)
include_directories(${qad_includes})
set(_DIRS piqt piqt_utils qcd_utils) set(_DIRS piqt piqt_utils qcd_utils)
if (Qt5) if (Qt5)
list(APPEND _DIRS) list(APPEND _DIRS)

2
pip

Submodule pip updated: 9834ac177b...ccd6a9888f

View File

@@ -23,7 +23,7 @@ list(APPEND QT_MULTILIB_LIST ${PROJECT_NAME})
set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE)
include_directories(${PIP_INCLUDES} ${QAD_INCLUDES}) include_directories(${PIP_INCLUDES} ${QAD_INCLUDES})
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
pip_code_model(CCM "../pip/lib/main/io_devices/piiodevice.h" "../pip/lib/main/io_utils/pipacketextractor.h" OPTIONS "-DPIP_EXPORT" "-Es") pip_code_model(CCM "../pip/libs/main/io_devices/piiodevice.h" "../pip/libs/main/io_utils/pipacketextractor.h" OPTIONS "-DPIP_EXPORT" "-Es")
find_qt(${QtVersions} Core Gui) find_qt(${QtVersions} Core Gui)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
qt_add_library(${PROJECT_NAME} ${LIBTYPE} out_CPP CCM) qt_add_library(${PROJECT_NAME} ${LIBTYPE} out_CPP CCM)

View File

@@ -1,6 +1,6 @@
project(piintrospector) project(piintrospector)
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts") file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
set(PII_ROOT "../../pip/lib/main/introspection") set(PII_ROOT "../../pip/libs/main/introspection")
pip_code_model(PII_CCM "${PII_ROOT}/piintrospection_server_p.h" "${PII_ROOT}/piintrospection_threads_p.h" OPTIONS "-DPIP_EXPORT" "-Es") pip_code_model(PII_CCM "${PII_ROOT}/piintrospection_server_p.h" "${PII_ROOT}/piintrospection_threads_p.h" OPTIONS "-DPIP_EXPORT" "-Es")
find_qt(${QtVersions} Core Gui) find_qt(${QtVersions} Core Gui)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM) qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)

View File

@@ -184,10 +184,6 @@ macro(qad_project NAME _MODULES _LIBS)
endif() endif()
qt_target_link_libraries(${PROJ_NAME} ${_LIBS}) qt_target_link_libraries(${PROJ_NAME} ${_LIBS})
qad_install(${PROJ_NAME} "out_HDR" "out_QM") qad_install(${PROJ_NAME} "out_HDR" "out_QM")
set(${NAME}_UTILS 1)
if (LIBPROJECT)
set(${NAME}_UTILS ${UTILS})
endif()
message(STATUS "Building ${PROJ_NAME}") message(STATUS "Building ${PROJ_NAME}")
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin") if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugin")
set(_${NAME}_PLUGIN_LIBS "${_LIBS}") set(_${NAME}_PLUGIN_LIBS "${_LIBS}")
@@ -195,15 +191,14 @@ macro(qad_project NAME _MODULES _LIBS)
endif() endif()
endmacro() endmacro()
set(DIRS utils widgets application blockview graphic sql_table touch_widgets doc) add_subdirectory(libs)
foreach(D ${DIRS}) if (UTILS)
list(APPEND QT_MULTILIB_LIST qad_${D}) add_subdirectory(utils)
endforeach(D) endif()
set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE) set(QT_MULTILIB_LIST ${QT_MULTILIB_LIST} PARENT_SCOPE)
foreach(D ${DIRS}) set(qad_includes ${qad_includes} PARENT_SCOPE)
include_directories(${D})
add_subdirectory(${D})
endforeach(D)
if (LIB) if (LIB)
set(_ALL_TARGETS ${_ALL_TARGETS} PARENT_SCOPE) set(_ALL_TARGETS ${_ALL_TARGETS} PARENT_SCOPE)
endif() endif()

View File

@@ -1,35 +0,0 @@
<RCC>
<qresource prefix="/">
<file>lang/qad_application_ru.ts</file>
<file>../icons/application-exit.png</file>
<file>../icons/dialog-close.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-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/edit-undo.png</file>
<file>../icons/edit-redo.png</file>
<file>../icons/border-line.png</file>
<file>../icons/edockwidget.png</file>
<file>../icons/historyview.png</file>
<file>../icons/clear-history.png</file>
<file>../icons/layer-visible-off.png</file>
<file>../icons/layer-visible-on.png</file>
<file>../icons/logview.png</file>
<file>../icons/qt.png</file>
<file>../icons/select-all.png</file>
<file>../icons/select-none.png</file>
</qresource>
</RCC>

View File

@@ -1,4 +0,0 @@
qad_project(blockview "Gui;Widgets" "qad_utils;qad_widgets")
if (blockview_UTILS)
add_subdirectory(blockeditor)
endif()

View File

@@ -1,51 +0,0 @@
<RCC>
<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/view-fullscreen.png</file>
<file>../icons/draw-ellipse.png</file>
<file>../icons/draw-rectangle.png</file>
<file>../icons/draw-text.png</file>
<file>../icons/view-preview.png</file>
<file>../icons/format-fill-color.png</file>
<file>../icons/format-stroke-color.png</file>
<file>../icons/document-open.png</file>
<file>../icons/align-bottom-center.png</file>
<file>../icons/align-bottom-left.png</file>
<file>../icons/align-bottom-right.png</file>
<file>../icons/align-center-center.png</file>
<file>../icons/align-center-left.png</file>
<file>../icons/align-center-right.png</file>
<file>../icons/align-top-center.png</file>
<file>../icons/align-top-left.png</file>
<file>../icons/align-top-right.png</file>
<file>../icons/z-bottom.png</file>
<file>../icons/z-down.png</file>
<file>../icons/z-top.png</file>
<file>../icons/z-up.png</file>
</qresource>
</RCC>

View File

@@ -1,28 +0,0 @@
<RCC>
<qresource prefix="/">
<file>../icons/media-playback-pause.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/view-autofit.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/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/graphic.png</file>
<file>../icons/view-fullscreen.png</file>
<file>../icons/pause-back.png</file>
<file>../icons/pause-front.png</file>
</qresource>
</RCC>

View File

@@ -1,188 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.2.1, 2016-03-25T15:17:49. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{948faa78-0b50-402e-a285-1bca3b08de64}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">false</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">DesktopBuild</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">DesktopBuild</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{3c749452-9483-442d-b011-933a1b5dac10}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="bool" key="CMakeProjectManager.CMakeBuildConfiguration.UseNinja">false</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/work/qpicalculator-build</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="CMakeProjectManager.MakeStep.Clean">false</value>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments">clean</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="CMakeProjectManager.MakeStep.Clean">true</value>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">all</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Установка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Локальная установка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">3</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">qpicalculator</value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
<value type="bool" key="CMakeProjectManager.CMakeRunConfiguration.UseTerminal">false</value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qpicalculator</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.qpicalculator</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">16</value>
</data>
<data>
<variable>Version</variable>
<value type="int">16</value>
</data>
</qtcreator>

View File

@@ -1 +1 @@
qad_project(application "Gui;Widgets" "qad_widgets") qad_project(application "Gui;Widgets" "qad_widgets")

View File

@@ -1,217 +1,217 @@
#include "aboutwindow.h" #include "aboutwindow.h"
#include "ui_aboutwindow.h" #include "ui_aboutwindow.h"
#include "qad_types.h" #include "qad_types.h"
#include "qpiconfig.h" #include "qpiconfig.h"
#include <QApplication> #include <QApplication>
#include <QFile> #include <QFile>
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
# include <QDesktopWidget> # include <QDesktopWidget>
#else #else
# include <QScreen> # include <QScreen>
#endif #endif
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
# define MOBILE_VIEW # define MOBILE_VIEW
#endif #endif
QImage AboutWindow::logo; QImage AboutWindow::logo;
QVector<AboutWindow::SSPair> AboutWindow::versions, AboutWindow::builds; QVector<AboutWindow::SSPair> AboutWindow::versions, AboutWindow::builds;
QString AboutWindow::comment, AboutWindow::stylesheet; QString AboutWindow::comment, AboutWindow::stylesheet;
AboutWindow::AboutWindow(QWidget * parent): QDialog(parent), ui(new Ui::AboutWindow) { AboutWindow::AboutWindow(QWidget * parent): QDialog(parent), ui(new Ui::AboutWindow) {
#ifdef ANDROID #ifdef ANDROID
QDialog::setStyleSheet("font: 12pt \"DejaVu Sans\";"); QDialog::setStyleSheet("font: 12pt \"DejaVu Sans\";");
#endif #endif
if (!stylesheet.isEmpty()) if (!stylesheet.isEmpty())
QDialog::setStyleSheet(stylesheet); QDialog::setStyleSheet(stylesheet);
ui->setupUi(this); ui->setupUi(this);
ui->labelAuthors->setOpenExternalLinks(true); ui->labelAuthors->setOpenExternalLinks(true);
QImage logo_im = logo; QImage logo_im = logo;
if (logo_im.isNull()) if (logo_im.isNull())
logo_im.load(":/icons/splash.png"); logo_im.load(":/icons/splash.png");
setWindowTitle(QApplication::applicationName() + " - " + tr("About")); setWindowTitle(QApplication::applicationName() + " - " + tr("About"));
QIcon ic = QApplication::windowIcon(); QIcon ic = QApplication::windowIcon();
if (ic.isNull()) { if (ic.isNull()) {
QWidgetList tlw = QApplication::topLevelWidgets(); QWidgetList tlw = QApplication::topLevelWidgets();
foreach (QWidget * w, tlw) foreach (QWidget * w, tlw)
if (!w->windowIcon().isNull()) { if (!w->windowIcon().isNull()) {
ic = w->windowIcon(); ic = w->windowIcon();
break; break;
} }
} }
if (ic.isNull()) if (ic.isNull())
ic = QIcon(QPixmap::fromImage(logo_im)); ic = QIcon(QPixmap::fromImage(logo_im));
setWindowIcon(ic); setWindowIcon(ic);
QFormLayout * lay = (QFormLayout*)(ui->groupVersions->layout()); QFormLayout * lay = (QFormLayout*)(ui->groupVersions->layout());
foreach (SSPair p, versions) { foreach (SSPair p, versions) {
lay->addRow(p.first, new QLabel(p.second)); lay->addRow(p.first, new QLabel(p.second));
} }
lay = (QFormLayout*)(ui->groupBuild->layout()); lay = (QFormLayout*)(ui->groupBuild->layout());
foreach (SSPair p, builds) { foreach (SSPair p, builds) {
lay->addRow(p.first, new QLabel(p.second)); lay->addRow(p.first, new QLabel(p.second));
} }
ui->imageView->setPixmap(QPixmap::fromImage(logo_im)); ui->imageView->setPixmap(QPixmap::fromImage(logo_im));
ui->labelComment->setText(comment); ui->labelComment->setText(comment);
ui->labelComment->setOpenExternalLinks(true); ui->labelComment->setOpenExternalLinks(true);
ui->labelComment->setHidden(comment.isEmpty()); ui->labelComment->setHidden(comment.isEmpty());
//ui->labelArch->setText(QSysInfo::currentCpuArchitecture()); //ui->labelArch->setText(QSysInfo::currentCpuArchitecture());
ui->labelAuthors->setText(authors()); ui->labelAuthors->setText(authors());
connect(ui->buttonQt, SIGNAL(clicked()), qApp, SLOT(aboutQt())); connect(ui->buttonQt, SIGNAL(clicked()), qApp, SLOT(aboutQt()));
#ifdef MOBILE_VIEW #ifdef MOBILE_VIEW
ui->layoutMain->insertWidget(0, ui->imageView); ui->layoutMain->insertWidget(0, ui->imageView);
//ui->verticalSpacer->changeSize(1, 1, QSizePolicy::Preferred, QSizePolicy::Preferred); //ui->verticalSpacer->changeSize(1, 1, QSizePolicy::Preferred, QSizePolicy::Preferred);
#endif #endif
#ifdef MOBILE_VIEW #ifdef MOBILE_VIEW
ui->layoutMain->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::Expanding)); ui->layoutMain->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::Expanding));
#else #else
QRect r; QRect r;
# if QT_VERSION < 0x050000 # if QT_VERSION < 0x050000
r = QApplication::desktop()->geometry(); r = QApplication::desktop()->geometry();
# else # else
QScreen * scr = QScreen * scr =
# if QT_VERSION >= 0x050A00 # if QT_VERSION >= 0x050A00
QApplication::screenAt(QCursor::pos()); QApplication::screenAt(QCursor::pos());
# else # else
QApplication::screens()[0]; QApplication::screens()[0];
# endif # endif
if (scr) { if (scr) {
r.setSize(scr->availableSize() / 2); r.setSize(scr->availableSize() / 2);
r.moveCenter(scr->availableGeometry().center()); r.moveCenter(scr->availableGeometry().center());
} }
# endif # endif
if (r.isValid()) if (r.isValid())
setGeometry(r); setGeometry(r);
#endif #endif
} }
AboutWindow::~AboutWindow() { AboutWindow::~AboutWindow() {
delete ui; delete ui;
} }
void AboutWindow::setLogo(QImage im) { void AboutWindow::setLogo(QImage im) {
logo = im; logo = im;
} }
void AboutWindow::setLogo(QString path) { void AboutWindow::setLogo(QString path) {
logo = QImage(path); logo = QImage(path);
} }
void AboutWindow::addVersion(QString name, QString version) { void AboutWindow::addVersion(QString name, QString version) {
if (!name.endsWith(":")) name.append(":"); if (!name.endsWith(":")) name.append(":");
foreach (const SSPair & p, versions) { foreach (const SSPair & p, versions) {
if (p.first == name) return; if (p.first == name) return;
} }
version.prepend("<b>"); version.prepend("<b>");
if (version.contains("(")) if (version.contains("("))
version.insert(version.indexOf("("), "</b>"); version.insert(version.indexOf("("), "</b>");
else else
version.append("</b>"); version.append("</b>");
versions << SSPair(name, version); versions << SSPair(name, version);
} }
void AboutWindow::addBuildInfo(QString name, QString value) { void AboutWindow::addBuildInfo(QString name, QString value) {
if (!name.endsWith(":")) name.append(":"); if (!name.endsWith(":")) name.append(":");
foreach (const SSPair & p, builds) { foreach (const SSPair & p, builds) {
if (p.first == name) return; if (p.first == name) return;
} }
builds << SSPair(name, value); builds << SSPair(name, value);
} }
void AboutWindow::setComment(QString text) { void AboutWindow::setComment(QString text) {
comment = text; comment = text;
} }
void AboutWindow::setStyleSheet(QString ss) { void AboutWindow::setStyleSheet(QString ss) {
stylesheet = ss; stylesheet = ss;
} }
void AboutWindow::show() { void AboutWindow::show() {
AboutWindow w; AboutWindow w;
w.exec(); w.exec();
} }
int AboutWindow::exec() { int AboutWindow::exec() {
#ifdef MOBILE_VIEW #ifdef MOBILE_VIEW
showFullScreen(); showFullScreen();
//setWindowState(Qt::WindowFullScreen); //setWindowState(Qt::WindowFullScreen);
#endif #endif
return QDialog::exec(); return QDialog::exec();
} }
void AboutWindow::changeEvent(QEvent *e) { void AboutWindow::changeEvent(QEvent *e) {
QDialog::changeEvent(e); QDialog::changeEvent(e);
switch (e->type()) { switch (e->type()) {
case QEvent::LanguageChange: case QEvent::LanguageChange:
ui->retranslateUi(this); ui->retranslateUi(this);
setWindowTitle(QApplication::applicationName() + " - " + tr("About")); setWindowTitle(QApplication::applicationName() + " - " + tr("About"));
break; break;
case QEvent::FontChange: case QEvent::FontChange:
case QEvent::Polish: case QEvent::Polish:
ui->buttonOK->setIconSize(preferredIconSize(2., this)); ui->buttonOK->setIconSize(preferredIconSize(2., this));
ui->buttonQt->setIconSize(preferredIconSize(2., this)); ui->buttonQt->setIconSize(preferredIconSize(2., this));
break; break;
default: break; default: break;
} }
} }
void addAuthor(QString & ret, const QString & name, const QString & mail) { void addAuthor(QString & ret, const QString & name, const QString & mail) {
ret += QString("<p>%1 (<a href=\"mailto:%2?subject=%3\">%2</a>)</p>").arg(name, mail, QApplication::applicationName()); ret += QString("<p>%1 (<a href=\"mailto:%2?subject=%3\">%2</a>)</p>").arg(name, mail, QApplication::applicationName());
} }
QString AboutWindow::authors() { QString AboutWindow::authors() {
QString ret, fc; QString ret, fc;
if (QFile::exists(":/authors.txt")) { if (QFile::exists(":/authors.txt")) {
QFile f(":/authors.txt"); QFile f(":/authors.txt");
f.open(QIODevice::ReadOnly); f.open(QIODevice::ReadOnly);
fc = QString::fromUtf8(f.readAll()); fc = QString::fromUtf8(f.readAll());
} else { } else {
if (QFile::exists(":/AUTHORS.txt")) { if (QFile::exists(":/AUTHORS.txt")) {
QFile f(":/AUTHORS.txt"); QFile f(":/AUTHORS.txt");
f.open(QIODevice::ReadOnly); f.open(QIODevice::ReadOnly);
fc = QString::fromUtf8(f.readAll()); fc = QString::fromUtf8(f.readAll());
} }
} }
QTextStream ts(&fc, QIODevice::ReadOnly); QTextStream ts(&fc, QIODevice::ReadOnly);
QString l = ts.readLine(); QString l = ts.readLine();
if (l.contains(";")) { if (l.contains(";")) {
QStringList sl; QStringList sl;
while (!ts.atEnd()) { while (!ts.atEnd()) {
l = ts.readLine(); l = ts.readLine();
if (l.isEmpty()) continue; if (l.isEmpty()) continue;
QString name, mail; QString name, mail;
sl = l.split(";"); sl = l.split(";");
if (sl.size() > 0) name = sl[0].trimmed(); if (sl.size() > 0) name = sl[0].trimmed();
if (sl.size() > 1) mail = sl[1].trimmed(); if (sl.size() > 1) mail = sl[1].trimmed();
addAuthor(ret, name, mail); addAuthor(ret, name, mail);
} }
return ret; return ret;
} else { } else {
QPIConfig conf(&fc); QPIConfig conf(&fc);
QPIConfig::Branch br = conf.allLeaves(); QPIConfig::Branch br = conf.allLeaves();
foreach (QPIConfig::Entry * e, br) { foreach (QPIConfig::Entry * e, br) {
l = e->toString().trimmed(); l = e->toString().trimmed();
if (!l.contains("<")) continue; if (!l.contains("<")) continue;
QString name, mail; QString name, mail;
name = l.left(l.indexOf("<")); name = l.left(l.indexOf("<"));
mail = l.mid(name.size() + 1); mail = l.mid(name.size() + 1);
if (mail.endsWith(">")) if (mail.endsWith(">"))
mail.chop(1); mail.chop(1);
name = name.trimmed(); name = name.trimmed();
mail = mail.trimmed(); mail = mail.trimmed();
addAuthor(ret, name, mail); addAuthor(ret, name, mail);
} }
} }
return ret; return ret;
} }

View File

@@ -1,82 +1,82 @@
/* /*
QAD - Qt ADvanced QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef ABOUTWINDOW_H #ifndef ABOUTWINDOW_H
#define ABOUTWINDOW_H #define ABOUTWINDOW_H
#include "qad_export.h" #include "qad_export.h"
#include <QDialog> #include <QDialog>
#define ADD_ABOUT_VERSION(lib) \ #define ADD_ABOUT_VERSION(lib) \
{ \ { \
if (lib##_VERSION_BUILD > 0) \ if (lib##_VERSION_BUILD > 0) \
AboutWindow::addVersion(#lib, lib##_VERSION_NAME " (build " + QString::number(lib##_VERSION_BUILD) + ")"); \ AboutWindow::addVersion(#lib, lib##_VERSION_NAME " (build " + QString::number(lib##_VERSION_BUILD) + ")"); \
else \ else \
AboutWindow::addVersion(#lib, lib##_VERSION_NAME); \ AboutWindow::addVersion(#lib, lib##_VERSION_NAME); \
} }
#define ADD_ABOUT_VERSION_NAMED(lib, label) \ #define ADD_ABOUT_VERSION_NAMED(lib, label) \
{ \ { \
if (lib##_VERSION_BUILD > 0) \ if (lib##_VERSION_BUILD > 0) \
AboutWindow::addVersion(label, lib##_VERSION_NAME " (build " + QString::number(lib##_VERSION_BUILD) + ")"); \ AboutWindow::addVersion(label, lib##_VERSION_NAME " (build " + QString::number(lib##_VERSION_BUILD) + ")"); \
else \ else \
AboutWindow::addVersion(label, lib##_VERSION_NAME); \ AboutWindow::addVersion(label, lib##_VERSION_NAME); \
} }
#define ADD_ABOUT_BUILD_INFO(lib) \ #define ADD_ABOUT_BUILD_INFO(lib) \
AboutWindow::addBuildInfo("Arch", lib##_ARCH); \ AboutWindow::addBuildInfo("Arch", lib##_ARCH); \
AboutWindow::addBuildInfo("Compiler", lib##_CXX_COMPILER); \ AboutWindow::addBuildInfo("Compiler", lib##_CXX_COMPILER); \
AboutWindow::addBuildInfo("CMake", lib##_CMAKE_VERSION); \ AboutWindow::addBuildInfo("CMake", lib##_CMAKE_VERSION); \
AboutWindow::addBuildInfo("Date", lib##_BUILD_DATE); AboutWindow::addBuildInfo("Date", lib##_BUILD_DATE);
namespace Ui { namespace Ui {
class AboutWindow; class AboutWindow;
} }
class QAD_EXPORT AboutWindow: public QDialog class QAD_EXPORT AboutWindow: public QDialog
{ {
Q_OBJECT Q_OBJECT
typedef QPair<QString, QString> SSPair; typedef QPair<QString, QString> SSPair;
explicit AboutWindow(QWidget * parent = 0); explicit AboutWindow(QWidget * parent = 0);
~AboutWindow(); ~AboutWindow();
public: public:
static void setLogo(QImage im); static void setLogo(QImage im);
static void setLogo(QString path); static void setLogo(QString path);
static void addVersion(QString name, QString version); static void addVersion(QString name, QString version);
static void addBuildInfo(QString name, QString value); static void addBuildInfo(QString name, QString value);
static void setComment(QString text); static void setComment(QString text);
static void setStyleSheet(QString ss); static void setStyleSheet(QString ss);
static void show(); static void show();
protected: protected:
virtual void changeEvent(QEvent * e); virtual void changeEvent(QEvent * e);
virtual int exec(); virtual int exec();
QString authors(); QString authors();
private: private:
Ui::AboutWindow * ui; Ui::AboutWindow * ui;
static QImage logo; static QImage logo;
static QVector<SSPair> versions, builds; static QVector<SSPair> versions, builds;
static QString stylesheet, comment; static QString stylesheet, comment;
}; };
#endif // ABOUTWINDOW_H #endif // ABOUTWINDOW_H

View File

@@ -1,155 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>AboutWindow</class> <class>AboutWindow</class>
<widget class="QWidget" name="AboutWindow"> <widget class="QWidget" name="AboutWindow">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>724</width> <width>724</width>
<height>502</height> <height>502</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string> - About</string> <string> - About</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="ImageView" name="imageView"> <widget class="ImageView" name="imageView">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::NoFrame</enum> <enum>QFrame::NoFrame</enum>
</property> </property>
<property name="backgroundBrush"> <property name="backgroundBrush">
<brush brushstyle="NoBrush"> <brush brushstyle="NoBrush">
<color alpha="255"> <color alpha="255">
<red>0</red> <red>0</red>
<green>0</green> <green>0</green>
<blue>0</blue> <blue>0</blue>
</color> </color>
</brush> </brush>
</property> </property>
<property name="renderHints"> <property name="renderHints">
<set>QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set> <set>QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="layoutMain"> <layout class="QVBoxLayout" name="layoutMain">
<item> <item>
<widget class="QLabel" name="labelComment"/> <widget class="QLabel" name="labelComment"/>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupVersions"> <widget class="QGroupBox" name="groupVersions">
<property name="title"> <property name="title">
<string>Versions</string> <string>Versions</string>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<property name="labelAlignment"> <property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBuild"> <widget class="QGroupBox" name="groupBuild">
<property name="title"> <property name="title">
<string>Build</string> <string>Build</string>
</property> </property>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<property name="labelAlignment"> <property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupAuthors"> <widget class="QGroupBox" name="groupAuthors">
<property name="title"> <property name="title">
<string>Authors</string> <string>Authors</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="labelAuthors"> <widget class="QLabel" name="labelAuthors">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>1</width> <width>1</width>
<height>1</height> <height>1</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="buttonQt"> <widget class="QPushButton" name="buttonQt">
<property name="text"> <property name="text">
<string>About Qt...</string> <string>About Qt...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="qad_application.qrc"> <iconset resource="qad_application.qrc">
<normaloff>:/icons/qt.png</normaloff>:/icons/qt.png</iconset> <normaloff>:/icons/qt.png</normaloff>:/icons/qt.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="buttonOK"> <widget class="QPushButton" name="buttonOK">
<property name="text"> <property name="text">
<string>OK</string> <string>OK</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../widgets/qad_widgets.qrc"> <iconset resource="../widgets/qad_widgets.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>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>ImageView</class> <class>ImageView</class>
<extends>QGraphicsView</extends> <extends>QGraphicsView</extends>
<header>image_view.h</header> <header>image_view.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../widgets/qad_widgets.qrc"/> <include location="../widgets/qad_widgets.qrc"/>
<include location="qad_application.qrc"/> <include location="qad_application.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>
<sender>buttonOK</sender> <sender>buttonOK</sender>
<signal>clicked()</signal> <signal>clicked()</signal>
<receiver>AboutWindow</receiver> <receiver>AboutWindow</receiver>
<slot>close()</slot> <slot>close()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>712</x> <x>712</x>
<y>490</y> <y>490</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>320</x> <x>320</x>
<y>385</y> <y>385</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
</connections> </connections>
</ui> </ui>

View File

@@ -1 +1 @@
qad_plugin(application "Gui;Widgets" "") qad_plugin(application "Gui;Widgets" "")

View File

@@ -0,0 +1,34 @@
<RCC>
<qresource prefix="/">
<file>../../icons/application-exit.png</file>
<file>../../icons/dialog-close.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-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/edit-undo.png</file>
<file>../../icons/edit-redo.png</file>
<file>../../icons/border-line.png</file>
<file>../../icons/edockwidget.png</file>
<file>../../icons/historyview.png</file>
<file>../../icons/clear-history.png</file>
<file>../../icons/layer-visible-off.png</file>
<file>../../icons/layer-visible-on.png</file>
<file>../../icons/logview.png</file>
<file>../../icons/qt.png</file>
<file>../../icons/select-all.png</file>
<file>../../icons/select-none.png</file>
</qresource>
</RCC>

View File

@@ -0,0 +1 @@
qad_project(blockview "Gui;Widgets" "qad_utils;qad_widgets")

View File

@@ -1,400 +1,400 @@
#include "blockeditor.h" #include "blockeditor.h"
#include "ui_blockeditor.h" #include "ui_blockeditor.h"
#include "drawtools.h" #include "drawtools.h"
#include "blockview.h" #include "blockview.h"
#include <QToolBar> #include <QToolBar>
#include <QComboBox> #include <QComboBox>
#include <QFileDialog> #include <QFileDialog>
#include <QFile> #include <QFile>
#include <QTimer> #include <QTimer>
BlockEditor::BlockEditor(QWidget *parent) : QWidget(parent), ui(new Ui::BlockEditor) { BlockEditor::BlockEditor(QWidget *parent) : QWidget(parent), ui(new Ui::BlockEditor) {
init = false; init = false;
m_editorMode = false; m_editorMode = false;
m_pinsEditable = true; m_pinsEditable = true;
ui->setupUi(this); ui->setupUi(this);
src_title = windowTitle(); src_title = windowTitle();
connect(ui->blockView->scene(), SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); connect(ui->blockView->scene(), SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
block.setFlags(0); block.setFlags(0);
ui->blockView->addItem(&block); ui->blockView->addItem(&block);
ui->blockView->viewport()->installEventFilter(this); ui->blockView->viewport()->installEventFilter(this);
DrawTools * drawtools = new DrawTools(ui->blockView); DrawTools * drawtools = new DrawTools(ui->blockView);
connect(drawtools, SIGNAL(itemCreated(QGraphicsItem*)), this, SLOT(addItem(QGraphicsItem*))); connect(drawtools, SIGNAL(itemCreated(QGraphicsItem*)), this, SLOT(addItem(QGraphicsItem*)));
drawtools->textEditCombo()->addItems(QStringList() << "%name" << "%value" << "%id"); drawtools->textEditCombo()->addItems(QStringList() << "%name" << "%value" << "%id");
ui->layoutProperties->addWidget(drawtools->propertyWidget()); ui->layoutProperties->addWidget(drawtools->propertyWidget());
ui->actionRemove_items->setEnabled(false); ui->actionRemove_items->setEnabled(false);
ui->button_color->setColor(Qt::lightGray); ui->button_color->setColor(Qt::lightGray);
ui->treePins->setItemDelegateForColumn(1, new PinBusDelegate()); ui->treePins->setItemDelegateForColumn(1, new PinBusDelegate());
connect(ui->treePins, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(updateBlock())); connect(ui->treePins, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(updateBlock()));
ui->treePins->viewport()->installEventFilter(this); ui->treePins->viewport()->installEventFilter(this);
QToolBar * bar; QToolBar * bar;
bar = new QToolBar(ui->widgetBar); bar = new QToolBar(ui->widgetBar);
bar->setOrientation(Qt::Vertical); bar->setOrientation(Qt::Vertical);
bar->addActions(drawtools->actionsForAdd()); bar->addActions(drawtools->actionsForAdd());
ui->widgetBar->setMinimumSize(bar->sizeHint()); ui->widgetBar->setMinimumSize(bar->sizeHint());
bar = new QToolBar(ui->widgetBarZ); bar = new QToolBar(ui->widgetBarZ);
bar->setOrientation(Qt::Vertical); bar->setOrientation(Qt::Vertical);
bar->addActions(drawtools->actionsForZ()); bar->addActions(drawtools->actionsForZ());
bar->addSeparator(); bar->addSeparator();
bar->addActions(QList<QAction*>() << ui->actionRemove_items); bar->addActions(QList<QAction*>() << ui->actionRemove_items);
ui->widgetBarZ->setMinimumSize(bar->sizeHint()); ui->widgetBarZ->setMinimumSize(bar->sizeHint());
init = true; init = true;
on_buttonClear_clicked(); on_buttonClear_clicked();
} }
BlockEditor::~BlockEditor() { BlockEditor::~BlockEditor() {
init = false; init = false;
delete ui; delete ui;
} }
void BlockEditor::loadFile(QString path) { void BlockEditor::loadFile(QString path) {
if (path.isEmpty()) return; if (path.isEmpty()) return;
QFile f(path); QFile f(path);
if (f.open(QIODevice::ReadOnly)) { if (f.open(QIODevice::ReadOnly)) {
cur_file = path; cur_file = path;
loadModel(f.readAll()); loadModel(f.readAll());
QDir::setCurrent(QFileInfo(path).dir().path()); QDir::setCurrent(QFileInfo(path).dir().path());
} }
setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(path).baseName())); setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(path).baseName()));
} }
void BlockEditor::loadModel(const QByteArray &model) { void BlockEditor::loadModel(const QByteArray &model) {
BlockItem b; BlockItem b;
b.loadModel(model); b.loadModel(model);
ui->spin_w->setValue(b.width()); ui->spin_w->setValue(b.width());
ui->spin_h->setValue(b.height()); ui->spin_h->setValue(b.height());
ui->spin_margin->setValue(b.pinsMargin()); ui->spin_margin->setValue(b.pinsMargin());
ui->button_color->setColor(b.color()); ui->button_color->setColor(b.color());
block.loadModel(model); block.loadModel(model);
treePinsClear(); treePinsClear();
ui->treePins->blockSignals(true); ui->treePins->blockSignals(true);
QVector<BlockItemPin * > pins = block.pins(); QVector<BlockItemPin * > pins = block.pins();
foreach (BlockItemPin * p, pins) { foreach (BlockItemPin * p, pins) {
QTreeWidgetItem * ti = new QTreeWidgetItem(QStringList() << p->text() << QString::number(p->busType())); QTreeWidgetItem * ti = new QTreeWidgetItem(QStringList() << p->text() << QString::number(p->busType()));
ti->setData(0, Qt::UserRole, qulonglong(p)); ti->setData(0, Qt::UserRole, qulonglong(p));
ti->setData(0, Qt::UserRole + 1, (int)p->alignment()); ti->setData(0, Qt::UserRole + 1, (int)p->alignment());
ti->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled); ti->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled);
pin_tli[p->alignment()]->addChild(ti); pin_tli[p->alignment()]->addChild(ti);
} }
foreach (QGraphicsItem * i, block.decors()) { foreach (QGraphicsItem * i, block.decors()) {
i->setData(1002, false); i->setData(1002, false);
i->setData(1100, true); i->setData(1100, true);
} }
ui->treePins->blockSignals(false); ui->treePins->blockSignals(false);
} }
QByteArray BlockEditor::saveModel() { QByteArray BlockEditor::saveModel() {
return block.saveModel(); return block.saveModel();
} }
void BlockEditor::setEditorMode(bool editorMode) { void BlockEditor::setEditorMode(bool editorMode) {
m_editorMode = editorMode; m_editorMode = editorMode;
ui->buttonClear->setVisible(!editorMode); ui->buttonClear->setVisible(!editorMode);
ui->buttonSave->setVisible(!editorMode); ui->buttonSave->setVisible(!editorMode);
ui->buttonSaveAs->setVisible(!editorMode); ui->buttonSaveAs->setVisible(!editorMode);
ui->buttonLoad->setVisible(!editorMode); ui->buttonLoad->setVisible(!editorMode);
} }
void BlockEditor::setPinsEditable(bool pinsEditable) { void BlockEditor::setPinsEditable(bool pinsEditable) {
m_pinsEditable = pinsEditable; m_pinsEditable = pinsEditable;
ui->treePins->setVisible(pinsEditable); ui->treePins->setVisible(pinsEditable);
ui->buttonPinAdd->setVisible(pinsEditable); ui->buttonPinAdd->setVisible(pinsEditable);
ui->buttonPinClear->setVisible(pinsEditable); ui->buttonPinClear->setVisible(pinsEditable);
ui->buttonPinDelete->setVisible(pinsEditable); ui->buttonPinDelete->setVisible(pinsEditable);
ui->buttonPinDup->setVisible(pinsEditable); ui->buttonPinDup->setVisible(pinsEditable);
ui->groupPins->setVisible(pinsEditable); ui->groupPins->setVisible(pinsEditable);
} }
void BlockEditor::selectionChanged() { void BlockEditor::selectionChanged() {
if (!init) return; if (!init) return;
ui->actionRemove_items->setEnabled(!ui->blockView->scene()->selectedItems().isEmpty()); ui->actionRemove_items->setEnabled(!ui->blockView->scene()->selectedItems().isEmpty());
} }
void BlockEditor::addItem(QGraphicsItem *item) { void BlockEditor::addItem(QGraphicsItem *item) {
block.addDecor(item); block.addDecor(item);
item->setData(1002, false); item->setData(1002, false);
item->setData(1100, true); item->setData(1100, true);
} }
void BlockEditor::updateBlock() { void BlockEditor::updateBlock() {
block.setSize(ui->spin_w->value(), ui->spin_h->value()); block.setSize(ui->spin_w->value(), ui->spin_h->value());
block.setColor(ui->button_color->color()); block.setColor(ui->button_color->color());
block.setPinsMargin(ui->spin_margin->value()); block.setPinsMargin(ui->spin_margin->value());
} }
void BlockEditor::treePinsClear() { void BlockEditor::treePinsClear() {
ui->treePins->blockSignals(true); ui->treePins->blockSignals(true);
ui->treePins->clear(); ui->treePins->clear();
QFont bf(font()); bf.setBold(true); QFont bf(font()); bf.setBold(true);
QList<int> al = QList<int>() << Qt::AlignLeft << Qt::AlignRight << Qt::AlignTop << Qt::AlignBottom; QList<int> al = QList<int>() << Qt::AlignLeft << Qt::AlignRight << Qt::AlignTop << Qt::AlignBottom;
QStringList an = QStringList() << "Left" << "Right" << "Top" << "Bottom"; QStringList an = QStringList() << "Left" << "Right" << "Top" << "Bottom";
pin_tli.clear(); pin_tli.clear();
for (int i = 0; i < al.size(); ++i) { for (int i = 0; i < al.size(); ++i) {
QTreeWidgetItem * ti = new QTreeWidgetItem(); QTreeWidgetItem * ti = new QTreeWidgetItem();
ti->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDropEnabled); ti->setFlags(Qt::ItemIsEnabled | Qt::ItemIsDropEnabled);
ti->setData(0, Qt::UserRole, al[i]); ti->setData(0, Qt::UserRole, al[i]);
ti->setText(0, an[i]); ti->setText(0, an[i]);
ti->setFont(0, bf); ti->setFont(0, bf);
ui->treePins->addTopLevelItem(ti); ui->treePins->addTopLevelItem(ti);
ti->setFirstColumnSpanned(true); ti->setFirstColumnSpanned(true);
ti->setExpanded(true); ti->setExpanded(true);
pin_tli[al[i]] = ti; pin_tli[al[i]] = ti;
} }
ui->treePins->blockSignals(false); ui->treePins->blockSignals(false);
} }
bool BlockEditor::eventFilter(QObject *o, QEvent *e) { bool BlockEditor::eventFilter(QObject *o, QEvent *e) {
if (!init) QWidget::eventFilter(o, e); if (!init) QWidget::eventFilter(o, e);
if (o == ui->treePins->viewport()) { if (o == ui->treePins->viewport()) {
if (e->type() == QEvent::Drop) { if (e->type() == QEvent::Drop) {
QTimer::singleShot(0, this, SLOT(arrangePins())); QTimer::singleShot(0, this, SLOT(arrangePins()));
} }
} }
if (o == ui->blockView->viewport()) { if (o == ui->blockView->viewport()) {
if (e->type() == QEvent::Resize) { if (e->type() == QEvent::Resize) {
ui->blockView->centerOn(&block); ui->blockView->centerOn(&block);
} }
} }
return QWidget::eventFilter(o, e); return QWidget::eventFilter(o, e);
} }
void BlockEditor::changeEvent(QEvent * e) { void BlockEditor::changeEvent(QEvent * e) {
QWidget::changeEvent(e); QWidget::changeEvent(e);
switch (e->type()) { switch (e->type()) {
case QEvent::LanguageChange: case QEvent::LanguageChange:
ui->retranslateUi(this); ui->retranslateUi(this);
break; break;
default: break; default: break;
} }
} }
void BlockEditor::on_actionRemove_items_triggered() { void BlockEditor::on_actionRemove_items_triggered() {
QList<QGraphicsItem*> si = ui->blockView->scene()->selectedItems(); QList<QGraphicsItem*> si = ui->blockView->scene()->selectedItems();
foreach (QGraphicsItem * i, si) foreach (QGraphicsItem * i, si)
block.removeDecor(i); block.removeDecor(i);
} }
void BlockEditor::on_buttonSave_clicked() { void BlockEditor::on_buttonSave_clicked() {
if (cur_file.isEmpty()) { if (cur_file.isEmpty()) {
on_buttonSaveAs_clicked(); on_buttonSaveAs_clicked();
return; return;
} }
QFile f(cur_file); QFile f(cur_file);
if (f.open(QIODevice::WriteOnly)) { if (f.open(QIODevice::WriteOnly)) {
f.write(saveModel()); f.write(saveModel());
//setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(c).baseName())); //setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(c).baseName()));
} }
} }
void BlockEditor::on_buttonSaveAs_clicked() { void BlockEditor::on_buttonSaveAs_clicked() {
QString c = QFileDialog::getSaveFileName(this, "Save block model to file", cur_file, "*.blockmodel"); QString c = QFileDialog::getSaveFileName(this, "Save block model to file", cur_file, "*.blockmodel");
if (!c.isEmpty()) { if (!c.isEmpty()) {
QFile f(c); QFile f(c);
if (f.open(QIODevice::WriteOnly)) { if (f.open(QIODevice::WriteOnly)) {
cur_file = c; cur_file = c;
f.write(saveModel()); f.write(saveModel());
setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(c).baseName())); setWindowTitle(src_title + QString(" - %1").arg(QFileInfo(c).baseName()));
} }
} }
} }
void BlockEditor::on_buttonLoad_clicked() { void BlockEditor::on_buttonLoad_clicked() {
QString c = QFileDialog::getOpenFileName(this, "Save block model to file", cur_file, "*.blockmodel"); QString c = QFileDialog::getOpenFileName(this, "Save block model to file", cur_file, "*.blockmodel");
loadFile(c); loadFile(c);
} }
void BlockEditor::on_buttonClear_clicked() { void BlockEditor::on_buttonClear_clicked() {
BlockItem b; BlockItem b;
ui->spin_w->setValue(b.width()); ui->spin_w->setValue(b.width());
ui->spin_h->setValue(b.height()); ui->spin_h->setValue(b.height());
ui->spin_margin->setValue(b.pinsMargin()); ui->spin_margin->setValue(b.pinsMargin());
ui->button_color->setColor(b.color()); ui->button_color->setColor(b.color());
block.loadModel(QByteArray()); block.loadModel(QByteArray());
treePinsClear(); treePinsClear();
} }
void BlockEditor::on_buttonPinAdd_clicked() { void BlockEditor::on_buttonPinAdd_clicked() {
ui->treePins->blockSignals(true); ui->treePins->blockSignals(true);
QTreeWidgetItem * ti = new QTreeWidgetItem(QStringList() << "" << "0"); QTreeWidgetItem * ti = new QTreeWidgetItem(QStringList() << "" << "0");
ti->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled); ti->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled);
ti->setData(0, Qt::UserRole, qulonglong(block.addPin(Qt::AlignLeft, ti->text(1).toInt(), ti->text(0)))); ti->setData(0, Qt::UserRole, qulonglong(block.addPin(Qt::AlignLeft, ti->text(1).toInt(), ti->text(0))));
ti->setData(0, Qt::UserRole + 1, (int)Qt::AlignLeft); ti->setData(0, Qt::UserRole + 1, (int)Qt::AlignLeft);
pin_tli[Qt::AlignLeft]->addChild(ti); pin_tli[Qt::AlignLeft]->addChild(ti);
ui->treePins->setCurrentItem(ti); ui->treePins->setCurrentItem(ti);
ui->treePins->blockSignals(false); ui->treePins->blockSignals(false);
updateBlock(); updateBlock();
} }
void BlockEditor::on_buttonPinDup_clicked() { void BlockEditor::on_buttonPinDup_clicked() {
QTreeWidgetItem * ci = ui->treePins->currentItem(); QTreeWidgetItem * ci = ui->treePins->currentItem();
if (ci == 0) return; if (ci == 0) return;
ui->treePins->blockSignals(true); ui->treePins->blockSignals(true);
QTreeWidgetItem * ti = ci->clone(); QTreeWidgetItem * ti = ci->clone();
ti->setText(0, ti->text(0)); ti->setText(0, ti->text(0));
ti->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled); ti->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled);
Qt::Alignment al = (Qt::Alignment)ci->data(0, Qt::UserRole + 1).toInt(); Qt::Alignment al = (Qt::Alignment)ci->data(0, Qt::UserRole + 1).toInt();
ti->setData(0, Qt::UserRole, qulonglong(block.addPin(al, ci->text(1).toInt(), ci->text(0)))); ti->setData(0, Qt::UserRole, qulonglong(block.addPin(al, ci->text(1).toInt(), ci->text(0))));
ti->setData(0, Qt::UserRole + 1, (int)al); ti->setData(0, Qt::UserRole + 1, (int)al);
pin_tli[al]->addChild(ti); pin_tli[al]->addChild(ti);
ui->treePins->setCurrentItem(ti); ui->treePins->setCurrentItem(ti);
ui->treePins->blockSignals(false); ui->treePins->blockSignals(false);
} }
void BlockEditor::on_buttonPinDelete_clicked() { void BlockEditor::on_buttonPinDelete_clicked() {
ui->treePins->blockSignals(true); ui->treePins->blockSignals(true);
QList<QTreeWidgetItem*> si = ui->treePins->selectedItems(); QList<QTreeWidgetItem*> si = ui->treePins->selectedItems();
foreach (QTreeWidgetItem * i, si) { foreach (QTreeWidgetItem * i, si) {
if (!i->parent()) continue; if (!i->parent()) continue;
block.removePin((BlockItemPin*)(i->data(0, Qt::UserRole).toLongLong())); block.removePin((BlockItemPin*)(i->data(0, Qt::UserRole).toLongLong()));
delete i; delete i;
} }
ui->treePins->blockSignals(false); ui->treePins->blockSignals(false);
} }
void BlockEditor::on_buttonPinClear_clicked() { void BlockEditor::on_buttonPinClear_clicked() {
treePinsClear(); treePinsClear();
block.clearPins(); block.clearPins();
} }
void BlockEditor::on_treePins_itemChanged(QTreeWidgetItem * item, int column) { void BlockEditor::on_treePins_itemChanged(QTreeWidgetItem * item, int column) {
if (!item) return; if (!item) return;
BlockItemPin * pin = (BlockItemPin*)item->data(0, Qt::UserRole).toULongLong(); BlockItemPin * pin = (BlockItemPin*)item->data(0, Qt::UserRole).toULongLong();
if (!pin) return; if (!pin) return;
switch (column) { switch (column) {
case 0: case 0:
ui->treePins->blockSignals(true); ui->treePins->blockSignals(true);
item->setText(0, item->text(0)); item->setText(0, item->text(0));
pin->setText(item->text(0)); pin->setText(item->text(0));
ui->treePins->blockSignals(false); ui->treePins->blockSignals(false);
break; break;
case 1: pin->setBusType(item->text(1).toInt()); break; case 1: pin->setBusType(item->text(1).toInt()); break;
}; };
} }
void BlockEditor::arrangePins() { void BlockEditor::arrangePins() {
QVector<BlockItemPin * > pins = block.pins(); QVector<BlockItemPin * > pins = block.pins();
// block.clearPins(); // block.clearPins();
QList<QTreeWidgetItem*> tli = pin_tli.values(); QList<QTreeWidgetItem*> tli = pin_tli.values();
foreach (QTreeWidgetItem * ti, tli) { foreach (QTreeWidgetItem * ti, tli) {
for (int i = 0; i < ti->childCount(); ++i) { for (int i = 0; i < ti->childCount(); ++i) {
foreach (BlockItemPin * p, pins) foreach (BlockItemPin * p, pins)
if (p == (BlockItemPin*)(ti->child(i)->data(0, Qt::UserRole).toULongLong())) { if (p == (BlockItemPin*)(ti->child(i)->data(0, Qt::UserRole).toULongLong())) {
p->setAlignment((Qt::Alignment)ti->data(0, Qt::UserRole).toInt()); p->setAlignment((Qt::Alignment)ti->data(0, Qt::UserRole).toInt());
BlockItemPin * np = block.addPin(p, false); BlockItemPin * np = block.addPin(p, false);
ti->child(i)->setData(0, Qt::UserRole, qulonglong(np)); ti->child(i)->setData(0, Qt::UserRole, qulonglong(np));
ti->child(i)->setData(0, Qt::UserRole + 1, ti->data(0, Qt::UserRole).toInt()); ti->child(i)->setData(0, Qt::UserRole + 1, ti->data(0, Qt::UserRole).toInt());
break; break;
} }
} }
} }
// for (int i = 0; i < ui->treePins->topLevelItemCount(); ++i) { // for (int i = 0; i < ui->treePins->topLevelItemCount(); ++i) {
// QTreeWidgetItem * ti = ui->treePins->topLevelItem(i); // QTreeWidgetItem * ti = ui->treePins->topLevelItem(i);
// if (tli.contains(ti)) continue; // if (tli.contains(ti)) continue;
// ti = ui->treePins->takeTopLevelItem(i); // ti = ui->treePins->takeTopLevelItem(i);
// pin_tli[ti->data(0, Qt::UserRole + 1).toInt()]->addChild(ti); // pin_tli[ti->data(0, Qt::UserRole + 1).toInt()]->addChild(ti);
// foreach (BlockItemPin * p, pins) // foreach (BlockItemPin * p, pins)
// if (p->text() == ti->text(0)) { // if (p->text() == ti->text(0)) {
// p->setAlignment((Qt::Alignment)ti->data(0, Qt::UserRole + 1).toInt()); // p->setAlignment((Qt::Alignment)ti->data(0, Qt::UserRole + 1).toInt());
// block.addPin(p, false); // block.addPin(p, false);
// break; // break;
// } // }
// } // }
block.arrangePins(); block.arrangePins();
} }
/// *********************************************************** /// ***********************************************************
/// *********************************************************** /// ***********************************************************
/// *********************************************************** /// ***********************************************************
/// *********************************************************** /// ***********************************************************
QWidget * PinAlignDelegate::createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const { QWidget * PinAlignDelegate::createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const {
QComboBox * combo = new QComboBox(parent); QComboBox * combo = new QComboBox(parent);
int cv = index.data().toInt(); int cv = index.data().toInt();
combo->addItem("Left", int(Qt::AlignLeft)); if (cv == Qt::AlignLeft) combo->setCurrentIndex(0); combo->addItem("Left", int(Qt::AlignLeft)); if (cv == Qt::AlignLeft) combo->setCurrentIndex(0);
combo->addItem("Right", int(Qt::AlignRight)); if (cv == Qt::AlignRight) combo->setCurrentIndex(1); combo->addItem("Right", int(Qt::AlignRight)); if (cv == Qt::AlignRight) combo->setCurrentIndex(1);
combo->addItem("Top", int(Qt::AlignTop)); if (cv == Qt::AlignTop) combo->setCurrentIndex(2); combo->addItem("Top", int(Qt::AlignTop)); if (cv == Qt::AlignTop) combo->setCurrentIndex(2);
combo->addItem("Bottom", int(Qt::AlignBottom)); if (cv == Qt::AlignBottom) combo->setCurrentIndex(3); combo->addItem("Bottom", int(Qt::AlignBottom)); if (cv == Qt::AlignBottom) combo->setCurrentIndex(3);
combo->setGeometry(option.rect); combo->setGeometry(option.rect);
return combo; return combo;
} }
QString PinAlignDelegate::displayText(const QVariant & value, const QLocale & locale) const { QString PinAlignDelegate::displayText(const QVariant & value, const QLocale & locale) const {
int cv = value.toInt(); int cv = value.toInt();
switch (cv) { switch (cv) {
case Qt::AlignLeft: return tr("Left"); break; case Qt::AlignLeft: return tr("Left"); break;
case Qt::AlignRight: return tr("Right"); break; case Qt::AlignRight: return tr("Right"); break;
case Qt::AlignTop: return tr("Top"); break; case Qt::AlignTop: return tr("Top"); break;
case Qt::AlignBottom: return tr("Bottom"); break; case Qt::AlignBottom: return tr("Bottom"); break;
} }
return tr("unknown"); return tr("unknown");
} }
void PinAlignDelegate::setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const { void PinAlignDelegate::setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const {
model->setData(index, ((QComboBox*)editor)->itemData(((QComboBox*)editor)->currentIndex()).toInt()); model->setData(index, ((QComboBox*)editor)->itemData(((QComboBox*)editor)->currentIndex()).toInt());
} }
/// *********************************************************** /// ***********************************************************
/// *********************************************************** /// ***********************************************************
/// *********************************************************** /// ***********************************************************
/// *********************************************************** /// ***********************************************************
QWidget * PinBusDelegate::createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const { QWidget * PinBusDelegate::createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const {
QSpinBox * spin = new QSpinBox(parent); QSpinBox * spin = new QSpinBox(parent);
spin->setMinimum(-2147483648); spin->setMinimum(-2147483648);
spin->setMaximum(2147483647); spin->setMaximum(2147483647);
spin->setValue(index.data().toInt()); spin->setValue(index.data().toInt());
return spin; return spin;
} }
QString PinBusDelegate::displayText(const QVariant & value, const QLocale & locale) const { QString PinBusDelegate::displayText(const QVariant & value, const QLocale & locale) const {
int cv = value.toInt(); int cv = value.toInt();
return QString::number(cv); return QString::number(cv);
} }
void PinBusDelegate::setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const { void PinBusDelegate::setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const {
model->setData(index, ((QSpinBox*)editor)->value()); model->setData(index, ((QSpinBox*)editor)->value());
} }
//void BlockEditor::on_treePins_itemSelectionChanged() { //void BlockEditor::on_treePins_itemSelectionChanged() {
// arrangePins(); // arrangePins();
// qDebug() << "111111111111111"; // qDebug() << "111111111111111";
//} //}

View File

@@ -1,111 +1,111 @@
/* /*
QAD - Qt ADvanced QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef BLOCKEDITOR_H #ifndef BLOCKEDITOR_H
#define BLOCKEDITOR_H #define BLOCKEDITOR_H
#include <QWidget> #include <QWidget>
#include <QTreeWidgetItem> #include <QTreeWidgetItem>
#include <QStyledItemDelegate> #include <QStyledItemDelegate>
#include "blockitem.h" #include "blockitem.h"
namespace Ui { namespace Ui {
class BlockEditor; class BlockEditor;
} }
class QAD_EXPORT BlockEditor : public QWidget class QAD_EXPORT BlockEditor : public QWidget
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool editorMode READ editorMode WRITE setEditorMode) Q_PROPERTY(bool editorMode READ editorMode WRITE setEditorMode)
Q_PROPERTY(bool pinsEditable READ pinsEditable WRITE setPinsEditable) Q_PROPERTY(bool pinsEditable READ pinsEditable WRITE setPinsEditable)
public: public:
explicit BlockEditor(QWidget *parent = 0); explicit BlockEditor(QWidget *parent = 0);
~BlockEditor(); ~BlockEditor();
bool editorMode() const {return m_editorMode;} bool editorMode() const {return m_editorMode;}
bool pinsEditable() const {return m_pinsEditable;} bool pinsEditable() const {return m_pinsEditable;}
public slots: public slots:
void loadFile(QString path); void loadFile(QString path);
void loadModel(const QByteArray & model); void loadModel(const QByteArray & model);
QByteArray saveModel(); QByteArray saveModel();
void setEditorMode(bool editorMode); void setEditorMode(bool editorMode);
void setPinsEditable(bool pinsEditable); void setPinsEditable(bool pinsEditable);
private slots: private slots:
void selectionChanged(); void selectionChanged();
void addItem(QGraphicsItem * item); void addItem(QGraphicsItem * item);
void updateBlock(); void updateBlock();
void treePinsClear(); void treePinsClear();
void arrangePins(); void arrangePins();
void on_actionRemove_items_triggered(); void on_actionRemove_items_triggered();
void on_buttonSave_clicked(); void on_buttonSave_clicked();
void on_buttonSaveAs_clicked(); void on_buttonSaveAs_clicked();
void on_buttonLoad_clicked(); void on_buttonLoad_clicked();
void on_buttonClear_clicked(); void on_buttonClear_clicked();
void on_buttonPinAdd_clicked(); void on_buttonPinAdd_clicked();
void on_buttonPinDup_clicked(); void on_buttonPinDup_clicked();
void on_buttonPinDelete_clicked(); void on_buttonPinDelete_clicked();
void on_buttonPinClear_clicked(); void on_buttonPinClear_clicked();
void on_treePins_itemChanged(QTreeWidgetItem *item, int column); void on_treePins_itemChanged(QTreeWidgetItem *item, int column);
// void on_treePins_itemSelectionChanged(); // void on_treePins_itemSelectionChanged();
private: private:
bool eventFilter(QObject * o, QEvent * e); bool eventFilter(QObject * o, QEvent * e);
void changeEvent(QEvent * e); void changeEvent(QEvent * e);
Ui::BlockEditor *ui; Ui::BlockEditor *ui;
QMap<int, QTreeWidgetItem*> pin_tli; QMap<int, QTreeWidgetItem*> pin_tli;
BlockItem block; BlockItem block;
QString src_title, cur_file; QString src_title, cur_file;
bool init; bool init;
bool m_editorMode; bool m_editorMode;
bool m_pinsEditable; bool m_pinsEditable;
}; };
class QAD_EXPORT PinAlignDelegate: public QStyledItemDelegate { class QAD_EXPORT PinAlignDelegate: public QStyledItemDelegate {
Q_OBJECT Q_OBJECT
public: public:
PinAlignDelegate(QObject * parent = 0): QStyledItemDelegate(parent) {} PinAlignDelegate(QObject * parent = 0): QStyledItemDelegate(parent) {}
QWidget * createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const; QWidget * createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const;
QString displayText(const QVariant & value, const QLocale & locale) const; QString displayText(const QVariant & value, const QLocale & locale) const;
void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const; void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const;
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const {return QSize(60, 26);} QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const {return QSize(60, 26);}
}; };
class QAD_EXPORT PinBusDelegate: public QStyledItemDelegate { class QAD_EXPORT PinBusDelegate: public QStyledItemDelegate {
Q_OBJECT Q_OBJECT
public: public:
PinBusDelegate(QObject * parent = 0): QStyledItemDelegate(parent) {} PinBusDelegate(QObject * parent = 0): QStyledItemDelegate(parent) {}
QWidget * createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const; QWidget * createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const;
QString displayText(const QVariant & value, const QLocale & locale) const; QString displayText(const QVariant & value, const QLocale & locale) const;
void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const; void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index) const;
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const {return QSize(60, 26);} QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const {return QSize(60, 26);}
private: private:
typedef QPair<int, QString> ISPair; typedef QPair<int, QString> ISPair;
QVector<ISPair> buses; QVector<ISPair> buses;
}; };
#endif // BLOCKEDITOR_H #endif // BLOCKEDITOR_H

View File

@@ -1,543 +1,543 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>BlockEditor</class> <class>BlockEditor</class>
<widget class="QWidget" name="BlockEditor"> <widget class="QWidget" name="BlockEditor">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>847</width> <width>847</width>
<height>810</height> <height>810</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Block editor</string> <string>Block editor</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="qad_blockview.qrc"> <iconset resource="qad_blockview.qrc">
<normaloff>:/icons/blockview.png</normaloff>:/icons/blockview.png</iconset> <normaloff>:/icons/blockview.png</normaloff>:/icons/blockview.png</iconset>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="QSplitter" name="splitter_2"> <widget class="QSplitter" name="splitter_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<widget class="QSplitter" name="splitter"> <widget class="QSplitter" name="splitter">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<widget class="QGroupBox" name="groupParameters"> <widget class="QGroupBox" name="groupParameters">
<property name="title"> <property name="title">
<string>Block parameters</string> <string>Block parameters</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<property name="labelAlignment"> <property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>4</number> <number>4</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>4</number> <number>4</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>4</number> <number>4</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>4</number> <number>4</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Width:</string> <string>Width:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QSpinBox" name="spin_w"> <widget class="QSpinBox" name="spin_w">
<property name="maximum"> <property name="maximum">
<number>1000</number> <number>1000</number>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<number>20</number> <number>20</number>
</property> </property>
<property name="value"> <property name="value">
<number>100</number> <number>100</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Heigth:</string> <string>Heigth:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QSpinBox" name="spin_h"> <widget class="QSpinBox" name="spin_h">
<property name="maximum"> <property name="maximum">
<number>1000</number> <number>1000</number>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<number>20</number> <number>20</number>
</property> </property>
<property name="value"> <property name="value">
<number>60</number> <number>60</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Pins margin:</string> <string>Pins margin:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QSpinBox" name="spin_margin"> <widget class="QSpinBox" name="spin_margin">
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<number>10</number> <number>10</number>
</property> </property>
<property name="value"> <property name="value">
<number>10</number> <number>10</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Color:</string> <string>Color:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="ColorButton" name="button_color"/> <widget class="ColorButton" name="button_color"/>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QGroupBox" name="groupPins"> <widget class="QGroupBox" name="groupPins">
<property name="title"> <property name="title">
<string>Pins</string> <string>Pins</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin"> <property name="leftMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
<widget class="QTreeWidget" name="treePins"> <widget class="QTreeWidget" name="treePins">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>200</height> <height>200</height>
</size> </size>
</property> </property>
<property name="dragDropMode"> <property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum> <enum>QAbstractItemView::InternalMove</enum>
</property> </property>
<property name="defaultDropAction"> <property name="defaultDropAction">
<enum>Qt::MoveAction</enum> <enum>Qt::MoveAction</enum>
</property> </property>
<property name="selectionMode"> <property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum> <enum>QAbstractItemView::ExtendedSelection</enum>
</property> </property>
<property name="verticalScrollMode"> <property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum> <enum>QAbstractItemView::ScrollPerPixel</enum>
</property> </property>
<property name="rootIsDecorated"> <property name="rootIsDecorated">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="itemsExpandable"> <property name="itemsExpandable">
<bool>false</bool> <bool>false</bool>
</property> </property>
<attribute name="headerDefaultSectionSize"> <attribute name="headerDefaultSectionSize">
<number>200</number> <number>200</number>
</attribute> </attribute>
<column> <column>
<property name="text"> <property name="text">
<string>Name</string> <string>Name</string>
</property> </property>
</column> </column>
<column> <column>
<property name="text"> <property name="text">
<string>Bus</string> <string>Bus</string>
</property> </property>
</column> </column>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QToolButton" name="buttonPinAdd"> <widget class="QToolButton" name="buttonPinAdd">
<property name="toolTip"> <property name="toolTip">
<string>Add</string> <string>Add</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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>
</item> </item>
<item> <item>
<widget class="QToolButton" name="buttonPinDup"> <widget class="QToolButton" name="buttonPinDup">
<property name="toolTip"> <property name="toolTip">
<string>Clone</string> <string>Clone</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_5"> <spacer name="horizontalSpacer_5">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Preferred</enum> <enum>QSizePolicy::Preferred</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QToolButton" name="buttonPinDelete"> <widget class="QToolButton" name="buttonPinDelete">
<property name="toolTip"> <property name="toolTip">
<string>Remove selected</string> <string>Remove selected</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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>
</item> </item>
<item> <item>
<widget class="QToolButton" name="buttonPinClear"> <widget class="QToolButton" name="buttonPinClear">
<property name="toolTip"> <property name="toolTip">
<string>Remove all</string> <string>Remove all</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_4"> <spacer name="horizontalSpacer_4">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>1</height> <height>1</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QFrame" name="frameProperties"> <widget class="QFrame" name="frameProperties">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" name="layoutProperties"> <layout class="QHBoxLayout" name="layoutProperties">
<property name="leftMargin"> <property name="leftMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>2</number> <number>2</number>
</property> </property>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QWidget" name="widgetBar" native="true"/> <widget class="QWidget" name="widgetBar" native="true"/>
</item> </item>
<item> <item>
<widget class="QWidget" name="widgetBarZ" native="true"/> <widget class="QWidget" name="widgetBarZ" native="true"/>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<widget class="BlockView" name="blockView"> <widget class="BlockView" name="blockView">
<property name="verticalScrollBarPolicy"> <property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="horizontalScrollBarPolicy"> <property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="navigateAnimationEnabled"> <property name="navigateAnimationEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="miniMap" stdset="0"> <property name="miniMap" stdset="0">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="zoomWheelOnly"> <property name="zoomWheelOnly">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QPushButton" name="buttonSave"> <widget class="QPushButton" name="buttonSave">
<property name="text"> <property name="text">
<string>Save</string> <string>Save</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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">
<string>Ctrl+S</string> <string>Ctrl+S</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_3"> <spacer name="horizontalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Preferred</enum> <enum>QSizePolicy::Preferred</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>10</width> <width>10</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="buttonSaveAs"> <widget class="QPushButton" name="buttonSaveAs">
<property name="text"> <property name="text">
<string>Save as ...</string> <string>Save as ...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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">
<string>Ctrl+S</string> <string>Ctrl+S</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Preferred</enum> <enum>QSizePolicy::Preferred</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="buttonLoad"> <widget class="QPushButton" name="buttonLoad">
<property name="text"> <property name="text">
<string>Load ...</string> <string>Load ...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../application/qad_application.qrc"> <iconset resource="../application/qad_application.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">
<string>Ctrl+O</string> <string>Ctrl+O</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="buttonClear"> <widget class="QPushButton" name="buttonClear">
<property name="text"> <property name="text">
<string>Clear</string> <string>Clear</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
<action name="actionRemove_items"> <action name="actionRemove_items">
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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">
<string>Remove items</string> <string>Remove items</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Del</string> <string>Del</string>
</property> </property>
</action> </action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>BlockView</class> <class>BlockView</class>
<extends>QGraphicsView</extends> <extends>QGraphicsView</extends>
<header>blockview.h</header> <header>blockview.h</header>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>ColorButton</class> <class>ColorButton</class>
<extends>QPushButton</extends> <extends>QPushButton</extends>
<header>colorbutton.h</header> <header>colorbutton.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../utils/qad_utils.qrc"/> <include location="../utils/qad_utils.qrc"/>
<include location="../application/qad_application.qrc"/> <include location="../application/qad_application.qrc"/>
<include location="qad_blockview.qrc"/> <include location="qad_blockview.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>
<sender>spin_w</sender> <sender>spin_w</sender>
<signal>valueChanged(int)</signal> <signal>valueChanged(int)</signal>
<receiver>BlockEditor</receiver> <receiver>BlockEditor</receiver>
<slot>updateBlock()</slot> <slot>updateBlock()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>170</x> <x>170</x>
<y>21</y> <y>21</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>254</x> <x>254</x>
<y>1</y> <y>1</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>spin_h</sender> <sender>spin_h</sender>
<signal>valueChanged(int)</signal> <signal>valueChanged(int)</signal>
<receiver>BlockEditor</receiver> <receiver>BlockEditor</receiver>
<slot>updateBlock()</slot> <slot>updateBlock()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>250</x> <x>250</x>
<y>49</y> <y>49</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>373</x> <x>373</x>
<y>5</y> <y>5</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>spin_margin</sender> <sender>spin_margin</sender>
<signal>valueChanged(int)</signal> <signal>valueChanged(int)</signal>
<receiver>BlockEditor</receiver> <receiver>BlockEditor</receiver>
<slot>updateBlock()</slot> <slot>updateBlock()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>350</x> <x>350</x>
<y>90</y> <y>90</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>492</x> <x>492</x>
<y>8</y> <y>8</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>button_color</sender> <sender>button_color</sender>
<signal>colorChanged(QColor)</signal> <signal>colorChanged(QColor)</signal>
<receiver>BlockEditor</receiver> <receiver>BlockEditor</receiver>
<slot>updateBlock()</slot> <slot>updateBlock()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>561</x> <x>561</x>
<y>115</y> <y>115</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>613</x> <x>613</x>
<y>6</y> <y>6</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
</connections> </connections>
<slots> <slots>
<slot>updateBlock()</slot> <slot>updateBlock()</slot>
</slots> </slots>
</ui> </ui>

View File

@@ -1,163 +1,163 @@
#include "blockview.h" #include "blockview.h"
#include <QApplication> #include <QApplication>
BlockItemPin::BlockItemPin(Qt::Alignment a, int bus_type_, const QString & text_, QGraphicsObject * _parent): QGraphicsObject(_parent), ell_item(this), text_item(this) { BlockItemPin::BlockItemPin(Qt::Alignment a, int bus_type_, const QString & text_, QGraphicsObject * _parent): QGraphicsObject(_parent), ell_item(this), text_item(this) {
parent_ = 0; parent_ = 0;
setData(1004, "pin"); setData(1004, "pin");
setAcceptHoverEvents(true); setAcceptHoverEvents(true);
text_item.setData(1002, true); text_item.setData(1002, true);
ell_item.setData(1003, true); ell_item.setData(1003, true);
br[Disconnected] = QBrush(Qt::lightGray); br[Disconnected] = QBrush(Qt::lightGray);
br[Connected] = QBrush(Qt::darkGreen); br[Connected] = QBrush(Qt::darkGreen);
br[Hover] = QBrush(Qt::blue); br[Hover] = QBrush(Qt::blue);
br[Drop] = QBrush(Qt::green); br[Drop] = QBrush(Qt::green);
br[Accept] = QBrush(Qt::green); br[Accept] = QBrush(Qt::green);
br[Reject] = QBrush(Qt::red); br[Reject] = QBrush(Qt::red);
anim_pin_size.setTargetObject(this); anim_pin_size.setTargetObject(this);
anim_pin_size.setPropertyName("pinSize"); anim_pin_size.setPropertyName("pinSize");
anim_pin_size.setEasingCurve(QEasingCurve::OutElastic); anim_pin_size.setEasingCurve(QEasingCurve::OutElastic);
anim_pin_size.setDuration(700); anim_pin_size.setDuration(700);
anim_accept.setTargetObject(this); anim_accept.setTargetObject(this);
anim_accept.setPropertyName("pinSize"); anim_accept.setPropertyName("pinSize");
anim_accept.setEasingCurve(QEasingCurve::InOutQuad); anim_accept.setEasingCurve(QEasingCurve::InOutQuad);
anim_accept.setDuration(150); anim_accept.setDuration(150);
connect(&anim_accept, SIGNAL(finished()), this, SLOT(animationAccept())); connect(&anim_accept, SIGNAL(finished()), this, SLOT(animationAccept()));
setState(Disconnected); setState(Disconnected);
setAlignment(a); setAlignment(a);
setBusType(bus_type_); setBusType(bus_type_);
setText(text_); setText(text_);
setZValue(2.); setZValue(2.);
setDirection(BlockItemPin::InputOutput); setDirection(BlockItemPin::InputOutput);
_reparent(); _reparent();
} }
void BlockItemPin::animAccept() { void BlockItemPin::animAccept() {
if (!((BlockView *)scene()->views().back())->isBlockAnimationEnabled() && anim_accept.state() != QAbstractAnimation::Running) return; if (!((BlockView *)scene()->views().back())->isBlockAnimationEnabled() && anim_accept.state() != QAbstractAnimation::Running) return;
anim_accept.setStartValue(pinSize()); anim_accept.setStartValue(pinSize());
anim_accept.setEndValue(10.); anim_accept.setEndValue(10.);
anim_accept.start(); anim_accept.start();
} }
void BlockItemPin::setState(State s) { void BlockItemPin::setState(State s) {
State os = state_; State os = state_;
state_ = s; state_ = s;
setBrush(br[int(state_)]); setBrush(br[int(state_)]);
if (s == Accept && os != Accept) { if (s == Accept && os != Accept) {
animAccept(); animAccept();
} }
update(); update();
} }
void BlockItemPin::enlargePin(bool enlarge) { void BlockItemPin::enlargePin(bool enlarge) {
double sz = enlarge ? 12. : 7; double sz = enlarge ? 12. : 7;
if (anim_accept.state() == QAbstractAnimation::Running && enlarge) { if (anim_accept.state() == QAbstractAnimation::Running && enlarge) {
anim_accept.stop(); anim_accept.stop();
resizePin(sz); resizePin(sz);
} }
if (!((BlockView *)scene()->views().back())->isBlockAnimationEnabled()) { if (!((BlockView *)scene()->views().back())->isBlockAnimationEnabled()) {
resizePin(sz); resizePin(sz);
return; return;
} }
if (sz == anim_pin_size.endValue()) if (sz == anim_pin_size.endValue())
return; return;
anim_pin_size.stop(); anim_pin_size.stop();
anim_pin_size.setStartValue(pinSize()); anim_pin_size.setStartValue(pinSize());
anim_pin_size.setEndValue(sz); anim_pin_size.setEndValue(sz);
anim_pin_size.start(); anim_pin_size.start();
} }
void BlockItemPin::resizePin(double r) { void BlockItemPin::resizePin(double r) {
ell_item.setRect(-r, -r, r+r, r+r); ell_item.setRect(-r, -r, r+r, r+r);
} }
double BlockItemPin::pinSize() const { double BlockItemPin::pinSize() const {
return ell_item.rect().width() / 2.; return ell_item.rect().width() / 2.;
} }
void BlockItemPin::animationAccept() { void BlockItemPin::animationAccept() {
if (anim_accept.endValue().toDouble() == 7.) return; if (anim_accept.endValue().toDouble() == 7.) return;
anim_accept.setStartValue(pinSize()); anim_accept.setStartValue(pinSize());
anim_accept.setEndValue(7.); anim_accept.setEndValue(7.);
anim_accept.start(); anim_accept.start();
} }
void BlockItemPin::_init(bool affect_parent) { void BlockItemPin::_init(bool affect_parent) {
text_item.setFont(AlignedTextItem::sceneFont(QApplication::font())); text_item.setFont(AlignedTextItem::sceneFont(QApplication::font()));
QRectF tbr = text_item.boundingRect(); QRectF tbr = text_item.boundingRect();
const double r = 7.; const double r = 7.;
ell_item.setRect(-r, -r, r+r, r+r); ell_item.setRect(-r, -r, r+r, r+r);
ell_item.setSpanAngle(16*180); ell_item.setSpanAngle(16*180);
text_item.resetTransform(); text_item.resetTransform();
text_item.setPos(0, -tbr.height() / 2.); text_item.setPos(0, -tbr.height() / 2.);
text_item.setTransformOriginPoint(0, tbr.height() / 2.); text_item.setTransformOriginPoint(0, tbr.height() / 2.);
switch (align) { switch (align) {
case Qt::AlignBottom: ell_item.setStartAngle(16*0); text_item.setRotation(-90.); text_item.moveBy(0, -r * 1.5); break; case Qt::AlignBottom: ell_item.setStartAngle(16*0); text_item.setRotation(-90.); text_item.moveBy(0, -r * 1.5); break;
case Qt::AlignRight: ell_item.setStartAngle(16*90); text_item.setRotation(0.); text_item.moveBy(-tbr.width() - r * 1.5, 0); break; case Qt::AlignRight: ell_item.setStartAngle(16*90); text_item.setRotation(0.); text_item.moveBy(-tbr.width() - r * 1.5, 0); break;
case Qt::AlignTop: ell_item.setStartAngle(16*180); text_item.setRotation(-90.); text_item.moveBy(0, tbr.width() + r * 1.5); break; case Qt::AlignTop: ell_item.setStartAngle(16*180); text_item.setRotation(-90.); text_item.moveBy(0, tbr.width() + r * 1.5); break;
case Qt::AlignLeft: ell_item.setStartAngle(16*270); text_item.setRotation(0.); text_item.moveBy(r * 1.5, 0); break; case Qt::AlignLeft: ell_item.setStartAngle(16*270); text_item.setRotation(0.); text_item.moveBy(r * 1.5, 0); break;
default: break; default: break;
} }
if (affect_parent && parent_) if (affect_parent && parent_)
parent_->arrangePins(); parent_->arrangePins();
} }
void BlockItemPin::_reparent() { void BlockItemPin::_reparent() {
if (parentItem() == 0) return; if (parentItem() == 0) return;
if (qgraphicsitem_cast<BlockItem*>(parentItem()) == 0) return; if (qgraphicsitem_cast<BlockItem*>(parentItem()) == 0) return;
QPen p = qgraphicsitem_cast<BlockItem*>(parentItem())->g_main.pen(); QPen p = qgraphicsitem_cast<BlockItem*>(parentItem())->g_main.pen();
ell_item.setPen(p); ell_item.setPen(p);
if (scene()) { if (scene()) {
text_item.setFont(AlignedTextItem::sceneFont(scene()->font())); text_item.setFont(AlignedTextItem::sceneFont(scene()->font()));
QRectF tbr = text_item.boundingRect(); QRectF tbr = text_item.boundingRect();
text_item.resetTransform(); text_item.resetTransform();
text_item.setPos(0, -tbr.height() / 2.); text_item.setPos(0, -tbr.height() / 2.);
text_item.setTransformOriginPoint(0, tbr.height() / 2.); text_item.setTransformOriginPoint(0, tbr.height() / 2.);
} }
} }
QGraphicsView * BlockItemPin::_view() const { QGraphicsView * BlockItemPin::_view() const {
if (!scene()) return 0; if (!scene()) return 0;
if (scene()->views().isEmpty()) return 0; if (scene()->views().isEmpty()) return 0;
return scene()->views().back(); return scene()->views().back();
} }
QVariant BlockItemPin::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant & value) { QVariant BlockItemPin::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant & value) {
if (change == QGraphicsItem::ItemParentChange) if (change == QGraphicsItem::ItemParentChange)
_reparent(); _reparent();
return QGraphicsItem::itemChange(change, value); return QGraphicsItem::itemChange(change, value);
} }
void BlockItemPin::hoverEnterEvent(QGraphicsSceneHoverEvent * e) { void BlockItemPin::hoverEnterEvent(QGraphicsSceneHoverEvent * e) {
QGraphicsView * v = _view(); QGraphicsView * v = _view();
bool m_pin_mc = false; bool m_pin_mc = false;
if (v) { if (v) {
QMetaObject::invokeMethod(v, "getPinMC", Q_ARG(bool*, &m_pin_mc)); QMetaObject::invokeMethod(v, "getPinMC", Q_ARG(bool*, &m_pin_mc));
QMetaObject::invokeMethod(v, "pinHoverInOut", Qt::QueuedConnection, Q_ARG(BlockItemPin*, this)); QMetaObject::invokeMethod(v, "pinHoverInOut", Qt::QueuedConnection, Q_ARG(BlockItemPin*, this));
} }
if ((state() != Disconnected) && !m_pin_mc) return; if ((state() != Disconnected) && !m_pin_mc) return;
saveState(); saveState();
setState(BlockItemPin::Hover); setState(BlockItemPin::Hover);
enlargePin(true); enlargePin(true);
update(); update();
} }
void BlockItemPin::hoverLeaveEvent(QGraphicsSceneHoverEvent * e) { void BlockItemPin::hoverLeaveEvent(QGraphicsSceneHoverEvent * e) {
QGraphicsView * v = _view(); QGraphicsView * v = _view();
restoreState(); restoreState();
enlargePin(false); enlargePin(false);
update(); update();
if (v) QMetaObject::invokeMethod(v, "pinHoverInOut", Q_ARG(BlockItemPin*, 0)); if (v) QMetaObject::invokeMethod(v, "pinHoverInOut", Q_ARG(BlockItemPin*, 0));
} }

View File

@@ -1,131 +1,131 @@
/* /*
QAD - Qt ADvanced QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef BLOCKITEMPIN_H #ifndef BLOCKITEMPIN_H
#define BLOCKITEMPIN_H #define BLOCKITEMPIN_H
#include <QGraphicsView> #include <QGraphicsView>
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QGraphicsObject> #include <QGraphicsObject>
#include <QGraphicsEllipseItem> #include <QGraphicsEllipseItem>
#include <QGraphicsSceneHoverEvent> #include <QGraphicsSceneHoverEvent>
#include <QGraphicsSceneMouseEvent> #include <QGraphicsSceneMouseEvent>
#include <QStack> #include <QStack>
#include <QDebug> #include <QDebug>
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <qmath.h> #include <qmath.h>
#include "blockbase.h" #include "blockbase.h"
#include "alignedtextitem.h" #include "alignedtextitem.h"
class BlockItem; class BlockItem;
class BlockBusItem; class BlockBusItem;
class QAD_EXPORT BlockItemPin: public QGraphicsObject, public PropertyStorage class QAD_EXPORT BlockItemPin: public QGraphicsObject, public PropertyStorage
{ {
friend class BlockView; friend class BlockView;
friend class BlockItem; friend class BlockItem;
Q_OBJECT Q_OBJECT
Q_PROPERTY(double pinSize READ pinSize WRITE resizePin DESIGNABLE false SCRIPTABLE false) Q_PROPERTY(double pinSize READ pinSize WRITE resizePin DESIGNABLE false SCRIPTABLE false)
public: public:
BlockItemPin(Qt::Alignment a = Qt::AlignLeft, int bus_type = 0, const QString & text_ = QString(), QGraphicsObject * parent_ = 0); BlockItemPin(Qt::Alignment a = Qt::AlignLeft, int bus_type = 0, const QString & text_ = QString(), QGraphicsObject * parent_ = 0);
enum State { enum State {
Disconnected, Disconnected,
Connected, Connected,
Hover, Hover,
Drop, Drop,
Accept, Accept,
Reject Reject
}; };
enum Direction { enum Direction {
None = 0x0, None = 0x0,
Input = 0x1, Input = 0x1,
Output = 0x2, Output = 0x2,
InputOutput = 0x3 InputOutput = 0x3
}; };
void setPen(const QPen & p) {ell_item.setPen(p);} void setPen(const QPen & p) {ell_item.setPen(p);}
QPen pen() const {return ell_item.pen();} QPen pen() const {return ell_item.pen();}
void setBrush(const QBrush & b) {ell_item.setBrush(b);} void setBrush(const QBrush & b) {ell_item.setBrush(b);}
QBrush brush() const {return ell_item.brush();} QBrush brush() const {return ell_item.brush();}
int busType() const {return bus_type;} int busType() const {return bus_type;}
Qt::Alignment alignment() const {return align;} Qt::Alignment alignment() const {return align;}
Direction direction() const {return dir;} Direction direction() const {return dir;}
QString text() const {return text_item.text();} QString text() const {return text_item.text();}
State state() const {return state_;} State state() const {return state_;}
void setBusType(int type_) {bus_type = type_;} void setBusType(int type_) {bus_type = type_;}
void setAlignment(Qt::Alignment a) {align = a; _init(true);} void setAlignment(Qt::Alignment a) {align = a; _init(true);}
void setDirection(Direction d) {dir = d; _init(true);} void setDirection(Direction d) {dir = d; _init(true);}
void setText(const QString & t) {text_item.setText(t); _init(true);} void setText(const QString & t) {text_item.setText(t); _init(true);}
void setState(State s); void setState(State s);
void saveState() {sstate_.push(state_);} void saveState() {sstate_.push(state_);}
bool restoreState() {if (sstate_.isEmpty()) return false; setState(sstate_.pop()); return true;} bool restoreState() {if (sstate_.isEmpty()) return false; setState(sstate_.pop()); return true;}
void clearStateStack() {sstate_.clear();} void clearStateStack() {sstate_.clear();}
void enlargePin(bool enlarge); void enlargePin(bool enlarge);
BlockItem * parent() const {return parent_;} BlockItem * parent() const {return parent_;}
QList<BlockBusItem * > connectedBuses() const {return buses_;} QList<BlockBusItem * > connectedBuses() const {return buses_;}
enum {Type = UserType + 3}; enum {Type = UserType + 3};
public slots: public slots:
void animAccept(); void animAccept();
protected: protected:
void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0) {} void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0) {}
QRectF boundingRect() const {return ell_item.boundingRect().translated(ell_item.pos()) | text_item.boundingRect().translated(text_item.pos());} QRectF boundingRect() const {return ell_item.boundingRect().translated(ell_item.pos()) | text_item.boundingRect().translated(text_item.pos());}
int type() const {return Type;} int type() const {return Type;}
QVariant itemChange(GraphicsItemChange change, const QVariant & value); QVariant itemChange(GraphicsItemChange change, const QVariant & value);
void hoverEnterEvent(QGraphicsSceneHoverEvent * e); void hoverEnterEvent(QGraphicsSceneHoverEvent * e);
void hoverLeaveEvent(QGraphicsSceneHoverEvent * e); void hoverLeaveEvent(QGraphicsSceneHoverEvent * e);
void _init(bool affect_parent = false); void _init(bool affect_parent = false);
void _reparent(); void _reparent();
QGraphicsView * _view() const; QGraphicsView * _view() const;
int bus_type; int bus_type;
State state_; State state_;
QGraphicsEllipseItem ell_item; QGraphicsEllipseItem ell_item;
QGraphicsSimpleTextItem text_item; QGraphicsSimpleTextItem text_item;
QStack<State> sstate_; QStack<State> sstate_;
QList<BlockBusItem * > buses_; QList<BlockBusItem * > buses_;
BlockItem * parent_; BlockItem * parent_;
Qt::Alignment align; Qt::Alignment align;
Direction dir; Direction dir;
QBrush br[6]; QBrush br[6];
private slots: private slots:
void animationAccept(); void animationAccept();
private: private:
void resizePin(double r); void resizePin(double r);
double pinSize() const; double pinSize() const;
QPropertyAnimation anim_pin_size; QPropertyAnimation anim_pin_size;
QPropertyAnimation anim_accept; QPropertyAnimation anim_accept;
}; };
#endif // BLOCKITEMPIN_H #endif // BLOCKITEMPIN_H

View File

@@ -1 +1 @@
qad_plugin(blockview "Gui;Widgets" "") qad_plugin(blockview "Gui;Widgets" "")

View File

@@ -0,0 +1,51 @@
<RCC>
<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/view-fullscreen.png</file>
<file>../../icons/draw-ellipse.png</file>
<file>../../icons/draw-rectangle.png</file>
<file>../../icons/draw-text.png</file>
<file>../../icons/view-preview.png</file>
<file>../../icons/format-fill-color.png</file>
<file>../../icons/format-stroke-color.png</file>
<file>../../icons/document-open.png</file>
<file>../../icons/align-bottom-center.png</file>
<file>../../icons/align-bottom-left.png</file>
<file>../../icons/align-bottom-right.png</file>
<file>../../icons/align-center-center.png</file>
<file>../../icons/align-center-left.png</file>
<file>../../icons/align-center-right.png</file>
<file>../../icons/align-top-center.png</file>
<file>../../icons/align-top-left.png</file>
<file>../../icons/align-top-right.png</file>
<file>../../icons/z-bottom.png</file>
<file>../../icons/z-down.png</file>
<file>../../icons/z-top.png</file>
<file>../../icons/z-up.png</file>
</qresource>
</RCC>

View File

@@ -1,25 +1,25 @@
include(CheckIncludeFileCXX) include(CheckIncludeFileCXX)
set(CHECK_INCLUDES "-include stdio.h") set(CHECK_INCLUDES "-include stdio.h")
if(WIN32) if(WIN32)
set(CHECK_INCLUDES "-include windows.h -include stdio.h") set(CHECK_INCLUDES "-include windows.h -include stdio.h")
endif() endif()
set(_mkd_header_found 0) set(_mkd_header_found 0)
check_include_file_cxx("mkdio.h" MARKDOWN_HEADER_MKDIO ${CHECK_INCLUDES}) check_include_file_cxx("mkdio.h" MARKDOWN_HEADER_MKDIO ${CHECK_INCLUDES})
if (MARKDOWN_HEADER_MKDIO OR APPLE) if (MARKDOWN_HEADER_MKDIO OR APPLE)
set(_mkd_header_found 1) set(_mkd_header_found 1)
add_definitions("-DMARKDOWN_HEADER=\"mkdio.h\"") add_definitions("-DMARKDOWN_HEADER=\"mkdio.h\"")
else() else()
check_include_file_cxx("markdown/markdown.h" MARKDOWN_HEADER_MARKDOWN ${CHECK_INCLUDES}) check_include_file_cxx("markdown/markdown.h" MARKDOWN_HEADER_MARKDOWN ${CHECK_INCLUDES})
if (MARKDOWN_HEADER_MARKDOWN) if (MARKDOWN_HEADER_MARKDOWN)
set(_mkd_header_found 1) set(_mkd_header_found 1)
add_definitions("-DMARKDOWN_HEADER=\"markdown/markdown.h\"") add_definitions("-DMARKDOWN_HEADER=\"markdown/markdown.h\"")
endif() endif()
endif() endif()
find_library(MARKDOWN_LIBRARY markdown) find_library(MARKDOWN_LIBRARY markdown)
if (MARKDOWN_LIBRARY) if (MARKDOWN_LIBRARY)
if(_mkd_header_found) if(_mkd_header_found)
qad_project(doc "Core" "${MARKDOWN_LIBRARY}") qad_project(doc "Core" "${MARKDOWN_LIBRARY}")
else() else()
message(STATUS "Found markdown library, but *.h missing!") message(STATUS "Found markdown library, but *.h missing!")
endif() endif()
endif() endif()

View File

@@ -1,79 +1,79 @@
#include "markdown.h" #include "markdown.h"
#include <QDebug> #include <QDebug>
extern "C" { extern "C" {
#include MARKDOWN_HEADER #include MARKDOWN_HEADER
} }
#ifndef mkd_flags_are #ifndef mkd_flags_are
# ifndef MKD_DLEXTRA # ifndef MKD_DLEXTRA
# define MKD_DLEXTRA 0x01000000 # define MKD_DLEXTRA 0x01000000
# endif # endif
# ifndef MKD_FENCEDCODE # ifndef MKD_FENCEDCODE
# define MKD_FENCEDCODE 0x02000000 # define MKD_FENCEDCODE 0x02000000
# endif # endif
# ifndef MKD_EXTRA_FOOTNOTE # ifndef MKD_EXTRA_FOOTNOTE
# define MKD_EXTRA_FOOTNOTE 0x00200000 # define MKD_EXTRA_FOOTNOTE 0x00200000
# endif # endif
# ifndef MKD_TOC # ifndef MKD_TOC
# define MKD_TOC 0x00001000 # define MKD_TOC 0x00001000
# endif # endif
# ifndef MKD_AUTOLINK # ifndef MKD_AUTOLINK
# define MKD_AUTOLINK 0x00004000 # define MKD_AUTOLINK 0x00004000
# endif # endif
# ifndef MKD_GITHUBTAGS # ifndef MKD_GITHUBTAGS
# define MKD_GITHUBTAGS 0x08000000 # define MKD_GITHUBTAGS 0x08000000
# endif # endif
#endif #endif
static QString markdown_css = "table { margin: 5px; background-color: #cccccc; }" static QString markdown_css = "table { margin: 5px; background-color: #cccccc; }"
"table tr { background-color: white; }" "table tr { background-color: white; }"
"table td { vertical-align: middle; padding: 5px;}" "table td { vertical-align: middle; padding: 5px;}"
"table th { padding: 5px; };" "table th { padding: 5px; };"
; ;
QString md2html(const QByteArray & src) { QString md2html(const QByteArray & src) {
static bool _is_mkd_init = false; static bool _is_mkd_init = false;
if (src.isEmpty()) return QString(); if (src.isEmpty()) return QString();
if (!_is_mkd_init) { if (!_is_mkd_init) {
_is_mkd_init = true; _is_mkd_init = true;
mkd_initialize(); mkd_initialize();
} }
#ifdef _MARKDOWN_D #ifdef _MARKDOWN_D
DWORD flagm = (MKD_DLEXTRA | MKD_FENCEDCODE); DWORD flagm = (MKD_DLEXTRA | MKD_FENCEDCODE);
Document Document
#endif #endif
#ifdef _MKDIO_D #ifdef _MKDIO_D
#ifdef mkd_flags_are #ifdef mkd_flags_are
mkd_flag_t * flagm = mkd_flags(); mkd_flag_t * flagm = mkd_flags();
mkd_set_flag_num(flagm, MKD_DLEXTRA); mkd_set_flag_num(flagm, MKD_DLEXTRA);
mkd_set_flag_num(flagm, MKD_FENCEDCODE); mkd_set_flag_num(flagm, MKD_FENCEDCODE);
#else #else
mkd_flag_t flagm = (MKD_DLEXTRA | MKD_FENCEDCODE | MKD_GITHUBTAGS | MKD_AUTOLINK); mkd_flag_t flagm = (MKD_DLEXTRA | MKD_FENCEDCODE | MKD_GITHUBTAGS | MKD_AUTOLINK);
#endif #endif
MMIOT MMIOT
#endif #endif
* doc = mkd_string(src.constData(), src.size(), 0); * doc = mkd_string(src.constData(), src.size(), 0);
if (!doc) return QString(); if (!doc) return QString();
mkd_compile(doc, flagm); mkd_compile(doc, flagm);
char * html = 0; char * html = 0;
int len = mkd_document(doc, &html); int len = mkd_document(doc, &html);
if (!html) { if (!html) {
mkd_cleanup(doc); mkd_cleanup(doc);
return QString(); return QString();
} }
QString ret = QString::fromUtf8(html, len); QString ret = QString::fromUtf8(html, len);
mkd_cleanup(doc); mkd_cleanup(doc);
QString title = QTextStream(&ret, QIODevice::ReadOnly).readLine(); QString title = QTextStream(&ret, QIODevice::ReadOnly).readLine();
title = title.mid(title.indexOf(">")+1); title = title.mid(title.indexOf(">")+1);
title = title.left(title.indexOf("<")); title = title.left(title.indexOf("<"));
QString header = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" QString header = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html>\n<head>\n" "<html>\n<head>\n"
"<meta name=\"qrichtext\" content=\"1\" />\n" "<meta name=\"qrichtext\" content=\"1\" />\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n"; "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
header.append("<title>" + title + "</title>\n"); header.append("<title>" + title + "</title>\n");
header.append("<style>" + markdown_css + "</style>\n"); header.append("<style>" + markdown_css + "</style>\n");
header.append("</head>\n<body>\n"); header.append("</head>\n<body>\n");
ret.prepend(header); ret.prepend(header);
ret.append("</body>\n</html>\n"); ret.append("</body>\n</html>\n");
return ret; return ret;
} }

View File

@@ -1,30 +1,30 @@
/* /*
QAD - Qt ADvanced QAD - Qt ADvanced
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef QAD_MARKDOWN_H #ifndef QAD_MARKDOWN_H
#define QAD_MARKDOWN_H #define QAD_MARKDOWN_H
#include <QString> #include <QString>
#include "qad_export.h" #include "qad_export.h"
QAD_EXPORT QString md2html(const QByteArray & src); QAD_EXPORT QString md2html(const QByteArray & src);
#endif // QAD_MARKDOWN_H #endif // QAD_MARKDOWN_H

View File

@@ -1,4 +1 @@
qad_project(graphic "Gui;Widgets;OpenGL" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}") qad_project(graphic "Gui;Widgets;OpenGL" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}")
if (graphic_UTILS)
add_subdirectory(qpicalculator)
endif()

View File

@@ -1,443 +1,443 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Graphic</class> <class>Graphic</class>
<widget class="QFrame" name="Graphic"> <widget class="QFrame" name="Graphic">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>564</width> <width>564</width>
<height>433</height> <height>433</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>150</width> <width>150</width>
<height>150</height> <height>150</height>
</size> </size>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing"> <property name="spacing">
<number>2</number> <number>2</number>
</property> </property>
<item row="0" column="0" rowspan="2"> <item row="0" column="0" rowspan="2">
<widget class="QWidget" name="widgetLeft" native="true"> <widget class="QWidget" name="widgetLeft" native="true">
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="layoutWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>-10</x> <x>-10</x>
<y>0</y> <y>0</y>
<width>33</width> <width>33</width>
<height>420</height> <height>420</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="layoutButtons"> <layout class="QVBoxLayout" name="layoutButtons">
<property name="spacing"> <property name="spacing">
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
<widget class="QToolButton" name="buttonAutofit"> <widget class="QToolButton" name="buttonAutofit">
<property name="toolTip"> <property name="toolTip">
<string>Autofit</string> <string>Autofit</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="qad_graphic.qrc"> <iconset resource="qad_graphic.qrc">
<normaloff>:/icons/view-autofit.png</normaloff>:/icons/view-autofit.png</iconset> <normaloff>:/icons/view-autofit.png</normaloff>:/icons/view-autofit.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="checkGrid"> <widget class="QToolButton" name="checkGrid">
<property name="toolTip"> <property name="toolTip">
<string>Grid</string> <string>Grid</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../widgets/qad_widgets.qrc"> <iconset resource="../widgets/qad_widgets.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">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="checkGuides"> <widget class="QToolButton" name="checkGuides">
<property name="toolTip"> <property name="toolTip">
<string>Cursor axis</string> <string>Cursor axis</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../widgets/qad_widgets.qrc"> <iconset resource="../widgets/qad_widgets.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">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="checkExpandY"> <widget class="QToolButton" name="checkExpandY">
<property name="toolTip"> <property name="toolTip">
<string>Only expand Y</string> <string>Only expand Y</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../widgets/qad_widgets.qrc"> <iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/expand_s_y.png</normaloff>:/icons/expand_s_y.png</iconset> <normaloff>:/icons/expand_s_y.png</normaloff>:/icons/expand_s_y.png</iconset>
</property> </property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="checkExpandX"> <widget class="QToolButton" name="checkExpandX">
<property name="toolTip"> <property name="toolTip">
<string>Only expand X</string> <string>Only expand X</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../widgets/qad_widgets.qrc"> <iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/expand_s_x.png</normaloff>:/icons/expand_s_x.png</iconset> <normaloff>:/icons/expand_s_x.png</normaloff>:/icons/expand_s_x.png</iconset>
</property> </property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </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="../blockview/qad_blockview.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>
</item> </item>
<item> <item>
<widget class="QToolButton" name="checkBorderInputs"> <widget class="QToolButton" name="checkBorderInputs">
<property name="toolTip"> <property name="toolTip">
<string>Border inputs</string> <string>Border inputs</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../widgets/qad_widgets.qrc"> <iconset resource="../widgets/qad_widgets.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">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="checkLegend"> <widget class="QToolButton" name="checkLegend">
<property name="toolTip"> <property name="toolTip">
<string>Legend</string> <string>Legend</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../widgets/qad_widgets.qrc"> <iconset resource="../widgets/qad_widgets.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">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="checkPause"> <widget class="QToolButton" name="checkPause">
<property name="toolTip"> <property name="toolTip">
<string>Pause</string> <string>Pause</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="qad_graphic.qrc"> <iconset resource="qad_graphic.qrc">
<normaloff>:/icons/media-playback-pause.png</normaloff>:/icons/media-playback-pause.png</iconset> <normaloff>:/icons/media-playback-pause.png</normaloff>:/icons/media-playback-pause.png</iconset>
</property> </property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="buttonConfigure"> <widget class="QToolButton" name="buttonConfigure">
<property name="toolTip"> <property name="toolTip">
<string>Configure ...</string> <string>Configure ...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../widgets/qad_widgets.qrc"> <iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset> <normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QToolButton" name="buttonSave"> <widget class="QToolButton" name="buttonSave">
<property name="toolTip"> <property name="toolTip">
<string>Save image ...</string> <string>Save image ...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Preferred</enum> <enum>QSizePolicy::Preferred</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>0</width> <width>0</width>
<height>30</height> <height>30</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QToolButton" name="buttonClear"> <widget class="QToolButton" name="buttonClear">
<property name="toolTip"> <property name="toolTip">
<string>Clear</string> <string>Clear</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../utils/qad_utils.qrc"> <iconset resource="../utils/qad_utils.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>
</item> </item>
<item> <item>
<widget class="QToolButton" name="buttonClose"> <widget class="QToolButton" name="buttonClose">
<property name="toolTip"> <property name="toolTip">
<string>Close</string> <string>Close</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../widgets/qad_widgets.qrc"> <iconset resource="../widgets/qad_widgets.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>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>0</width> <width>0</width>
<height>79</height> <height>79</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="labelCaption"> <widget class="QLabel" name="labelCaption">
<property name="textFormat"> <property name="textFormat">
<enum>Qt::RichText</enum> <enum>Qt::RichText</enum>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2" rowspan="2"> <item row="0" column="2" rowspan="2">
<widget class="QWidget" name="widgetRight" native="true"/> <widget class="QWidget" name="widgetRight" native="true"/>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QFrame" name="frame"> <widget class="QFrame" name="frame">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::Box</enum> <enum>QFrame::Box</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="2" column="1" colspan="2"> <item row="2" column="1" colspan="2">
<widget class="QWidget" name="widgetLX" native="true"> <widget class="QWidget" name="widgetLX" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="1" rowspan="2" colspan="2"> <item row="0" column="1" rowspan="2" colspan="2">
<layout class="QVBoxLayout" name="layoutCanvas"> <layout class="QVBoxLayout" name="layoutCanvas">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="UWidget" name="canvas_raster" native="true"> <widget class="UWidget" name="canvas_raster" native="true">
<property name="mouseTracking"> <property name="mouseTracking">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="0" rowspan="2"> <item row="0" column="0" rowspan="2">
<widget class="QWidget" name="widgetLY" native="true"> <widget class="QWidget" name="widgetLY" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
<spacer name="verticalSpacer_3"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QLabel" name="status"> <widget class="QLabel" name="status">
<property name="text"> <property name="text">
<string>Cursor: ( ; )</string> <string>Cursor: ( ; )</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="QWidget" name="widgetLegend" native="true"> <widget class="QWidget" name="widgetLegend" native="true">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<layout class="QGridLayout" name="layoutLegend"> <layout class="QGridLayout" name="layoutLegend">
<property name="leftMargin"> <property name="leftMargin">
<number>1</number> <number>1</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>1</number> <number>1</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>1</number> <number>1</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>1</number> <number>1</number>
</property> </property>
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>4</number> <number>4</number>
</property> </property>
</layout> </layout>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>UWidget</class> <class>UWidget</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>uwidget.h</header> <header>uwidget.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../utils/qad_utils.qrc"/> <include location="../utils/qad_utils.qrc"/>
<include location="../widgets/qad_widgets.qrc"/> <include location="../widgets/qad_widgets.qrc"/>
<include location="../blockview/qad_blockview.qrc"/> <include location="../blockview/qad_blockview.qrc"/>
<include location="qad_graphic.qrc"/> <include location="qad_graphic.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View File

@@ -1,644 +1,644 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>GraphicConf</class> <class>GraphicConf</class>
<widget class="QDialog" name="GraphicConf"> <widget class="QDialog" name="GraphicConf">
<property name="windowModality"> <property name="windowModality">
<enum>Qt::WindowModal</enum> <enum>Qt::WindowModal</enum>
</property> </property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>500</width> <width>500</width>
<height>583</height> <height>583</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Graphic parameters</string> <string>Graphic parameters</string>
</property> </property>
<property name="modal"> <property name="modal">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Appearance</string> <string>Appearance</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0"> <item row="1" column="0">
<widget class="QCheckBox" name="checkInputs"> <widget class="QCheckBox" name="checkInputs">
<property name="text"> <property name="text">
<string>Border inputs</string> <string>Border inputs</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="checkAAlias"> <widget class="QCheckBox" name="checkAAlias">
<property name="text"> <property name="text">
<string>Antialiasing</string> <string>Antialiasing</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QCheckBox" name="checkStatus"> <widget class="QCheckBox" name="checkStatus">
<property name="text"> <property name="text">
<string>Status bar</string> <string>Status bar</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QCheckBox" name="checkOGL"> <widget class="QCheckBox" name="checkOGL">
<property name="text"> <property name="text">
<string>OpenGL</string> <string>OpenGL</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QCheckBox" name="checkLegend"> <widget class="QCheckBox" name="checkLegend">
<property name="text"> <property name="text">
<string>Legend</string> <string>Legend</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QFormLayout" name="formLayout_3">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Background color:</string> <string>Background color:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="ColorButton" name="colorBackground"> <widget class="ColorButton" name="colorBackground">
<property name="useAlphaChannel"> <property name="useAlphaChannel">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_7">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Text color:</string> <string>Text color:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="ColorButton" name="colorText"> <widget class="ColorButton" name="colorText">
<property name="useAlphaChannel"> <property name="useAlphaChannel">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QGroupBox" name="groupBox_1"> <widget class="QGroupBox" name="groupBox_1">
<property name="title"> <property name="title">
<string>Graphics</string> <string>Graphics</string>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="QComboBox" name="cbGraphicNames"> <widget class="QComboBox" name="cbGraphicNames">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Color:</string> <string>Color:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="ColorButton" name="colorGraphic"> <widget class="ColorButton" name="colorGraphic">
<property name="useAlphaChannel"> <property name="useAlphaChannel">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Style:</string> <string>Style:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QComboBox" name="comboStyleGraphic"/> <widget class="QComboBox" name="comboStyleGraphic"/>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QCheckBox" name="checkLines"> <widget class="QCheckBox" name="checkLines">
<property name="text"> <property name="text">
<string>Lines width:</string> <string>Lines width:</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="QDoubleSpinBox" name="spinLineWidthGraphic"> <widget class="QDoubleSpinBox" name="spinLineWidthGraphic">
<property name="decimals"> <property name="decimals">
<number>2</number> <number>2</number>
</property> </property>
<property name="value"> <property name="value">
<double>1.000000000000000</double> <double>1.000000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QCheckBox" name="checkPoints"> <widget class="QCheckBox" name="checkPoints">
<property name="text"> <property name="text">
<string>Points width:</string> <string>Points width:</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="QDoubleSpinBox" name="spinPointWidthGraphic"> <widget class="QDoubleSpinBox" name="spinPointWidthGraphic">
<property name="decimals"> <property name="decimals">
<number>2</number> <number>2</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>999.990000000000009</double> <double>999.990000000000009</double>
</property> </property>
<property name="value"> <property name="value">
<double>1.000000000000000</double> <double>1.000000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QCheckBox" name="checkFill"> <widget class="QCheckBox" name="checkFill">
<property name="text"> <property name="text">
<string>Fill:</string> <string>Fill:</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="5" column="1">
<widget class="ColorButton" name="colorFill"> <widget class="ColorButton" name="colorFill">
<property name="useAlphaChannel"> <property name="useAlphaChannel">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QGroupBox" name="groupBox_3"> <widget class="QGroupBox" name="groupBox_3">
<property name="title"> <property name="title">
<string>Grid</string> <string>Grid</string>
</property> </property>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>Color:</string> <string>Color:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="ColorButton" name="colorGrid"> <widget class="ColorButton" name="colorGrid">
<property name="useAlphaChannel"> <property name="useAlphaChannel">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="label_5">
<property name="text"> <property name="text">
<string>Style:</string> <string>Style:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QComboBox" name="comboStyleGrid"/> <widget class="QComboBox" name="comboStyleGrid"/>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="label_6"> <widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>Width:</string> <string>Width:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinWidthGrid"> <widget class="QDoubleSpinBox" name="spinWidthGrid">
<property name="decimals"> <property name="decimals">
<number>2</number> <number>2</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_8">
<property name="text"> <property name="text">
<string>Step X:</string> <string>Step X:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="6" column="0">
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="text"> <property name="text">
<string>Step Y:</string> <string>Step Y:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="2"> <item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkGridAutoX"> <widget class="QCheckBox" name="checkGridAutoX">
<property name="text"> <property name="text">
<string>Auto X</string> <string>Auto X</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" colspan="2"> <item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkGridAutoY"> <widget class="QCheckBox" name="checkGridAutoY">
<property name="text"> <property name="text">
<string>Auto Y</string> <string>Auto Y</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="6" column="1">
<widget class="EvalSpinBox" name="spinGridStepY"> <widget class="EvalSpinBox" name="spinGridStepY">
<property name="expression"> <property name="expression">
<string>30</string> <string>30</string>
</property> </property>
<property name="defaultText"> <property name="defaultText">
<string>30</string> <string>30</string>
</property> </property>
<property name="clearButtonVisible"> <property name="clearButtonVisible">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="EvalSpinBox" name="spinGridStepX"> <widget class="EvalSpinBox" name="spinGridStepX">
<property name="expression"> <property name="expression">
<string>50</string> <string>50</string>
</property> </property>
<property name="defaultText"> <property name="defaultText">
<string>50</string> <string>50</string>
</property> </property>
<property name="clearButtonVisible"> <property name="clearButtonVisible">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="4" column="0" colspan="2"> <item row="4" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="2"> <item row="3" column="0" colspan="2">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="0" colspan="2"> <item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="title"> <property name="title">
<string>Margins</string> <string>Margins</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="5"> <item row="1" column="5">
<widget class="QSpinBox" name="spinMarginR"> <widget class="QSpinBox" name="spinMarginR">
<property name="suffix"> <property name="suffix">
<string> px</string> <string> px</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="2" column="3">
<widget class="QSpinBox" name="spinMarginB"> <widget class="QSpinBox" name="spinMarginB">
<property name="suffix"> <property name="suffix">
<string> px</string> <string> px</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QLabel" name="labelAll"> <widget class="QLabel" name="labelAll">
<property name="text"> <property name="text">
<string>All:</string> <string>All:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QSpinBox" name="spinMarginL"> <widget class="QSpinBox" name="spinMarginL">
<property name="suffix"> <property name="suffix">
<string> px</string> <string> px</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4"> <item row="1" column="4">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
<property name="text"> <property name="text">
<string>Right:</string> <string>Right:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="text"> <property name="text">
<string>Left:</string> <string>Left:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="2" column="2">
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">
<property name="text"> <property name="text">
<string>Bottom:</string> <string>Bottom:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QSpinBox" name="spinMarginT"> <widget class="QSpinBox" name="spinMarginT">
<property name="suffix"> <property name="suffix">
<string> px</string> <string> px</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="label_11">
<property name="text"> <property name="text">
<string>Top:</string> <string>Top:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3"> <item row="1" column="3">
<widget class="QSpinBox" name="spinMarginT_2"> <widget class="QSpinBox" name="spinMarginT_2">
<property name="suffix"> <property name="suffix">
<string> px</string> <string> px</string>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>ColorButton</class> <class>ColorButton</class>
<extends>QPushButton</extends> <extends>QPushButton</extends>
<header>colorbutton.h</header> <header>colorbutton.h</header>
<slots> <slots>
<signal>colorChanged(QColor)</signal> <signal>colorChanged(QColor)</signal>
</slots> </slots>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>EvalSpinBox</class> <class>EvalSpinBox</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>evalspinbox.h</header> <header>evalspinbox.h</header>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops> <tabstops>
<tabstop>checkAAlias</tabstop> <tabstop>checkAAlias</tabstop>
<tabstop>checkOGL</tabstop> <tabstop>checkOGL</tabstop>
<tabstop>colorBackground</tabstop> <tabstop>colorBackground</tabstop>
<tabstop>colorText</tabstop> <tabstop>colorText</tabstop>
<tabstop>colorGrid</tabstop> <tabstop>colorGrid</tabstop>
<tabstop>comboStyleGrid</tabstop> <tabstop>comboStyleGrid</tabstop>
<tabstop>spinWidthGrid</tabstop> <tabstop>spinWidthGrid</tabstop>
<tabstop>cbGraphicNames</tabstop> <tabstop>cbGraphicNames</tabstop>
<tabstop>colorGraphic</tabstop> <tabstop>colorGraphic</tabstop>
<tabstop>comboStyleGraphic</tabstop> <tabstop>comboStyleGraphic</tabstop>
<tabstop>checkLines</tabstop> <tabstop>checkLines</tabstop>
<tabstop>spinLineWidthGraphic</tabstop> <tabstop>spinLineWidthGraphic</tabstop>
<tabstop>checkPoints</tabstop> <tabstop>checkPoints</tabstop>
<tabstop>spinPointWidthGraphic</tabstop> <tabstop>spinPointWidthGraphic</tabstop>
<tabstop>buttonBox</tabstop> <tabstop>buttonBox</tabstop>
</tabstops> </tabstops>
<resources/> <resources/>
<connections> <connections>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>GraphicConf</receiver> <receiver>GraphicConf</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>255</x> <x>255</x>
<y>641</y> <y>641</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>245</x> <x>245</x>
<y>207</y> <y>207</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>checkLines</sender> <sender>checkLines</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>spinLineWidthGraphic</receiver> <receiver>spinLineWidthGraphic</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>322</x> <x>322</x>
<y>410</y> <y>410</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>415</x> <x>415</x>
<y>411</y> <y>411</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>checkPoints</sender> <sender>checkPoints</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>spinPointWidthGraphic</receiver> <receiver>spinPointWidthGraphic</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>322</x> <x>322</x>
<y>434</y> <y>434</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>415</x> <x>415</x>
<y>435</y> <y>435</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>GraphicConf</receiver> <receiver>GraphicConf</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>294</x> <x>294</x>
<y>641</y> <y>641</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>288</x> <x>288</x>
<y>268</y> <y>268</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>checkFill</sender> <sender>checkFill</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>colorFill</receiver> <receiver>colorFill</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>322</x> <x>322</x>
<y>458</y> <y>458</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>415</x> <x>415</x>
<y>460</y> <y>460</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>spinMarginT_2</sender> <sender>spinMarginT_2</sender>
<signal>valueChanged(int)</signal> <signal>valueChanged(int)</signal>
<receiver>spinMarginT</receiver> <receiver>spinMarginT</receiver>
<slot>setValue(int)</slot> <slot>setValue(int)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>259</x> <x>259</x>
<y>221</y> <y>221</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>249</x> <x>249</x>
<y>191</y> <y>191</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>spinMarginT_2</sender> <sender>spinMarginT_2</sender>
<signal>valueChanged(int)</signal> <signal>valueChanged(int)</signal>
<receiver>spinMarginR</receiver> <receiver>spinMarginR</receiver>
<slot>setValue(int)</slot> <slot>setValue(int)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>268</x> <x>268</x>
<y>220</y> <y>220</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>371</x> <x>371</x>
<y>220</y> <y>220</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>spinMarginT_2</sender> <sender>spinMarginT_2</sender>
<signal>valueChanged(int)</signal> <signal>valueChanged(int)</signal>
<receiver>spinMarginB</receiver> <receiver>spinMarginB</receiver>
<slot>setValue(int)</slot> <slot>setValue(int)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>233</x> <x>233</x>
<y>230</y> <y>230</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>234</x> <x>234</x>
<y>252</y> <y>252</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>spinMarginT_2</sender> <sender>spinMarginT_2</sender>
<signal>valueChanged(int)</signal> <signal>valueChanged(int)</signal>
<receiver>spinMarginL</receiver> <receiver>spinMarginL</receiver>
<slot>setValue(int)</slot> <slot>setValue(int)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>213</x> <x>213</x>
<y>230</y> <y>230</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>133</x> <x>133</x>
<y>229</y> <y>229</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
</connections> </connections>
</ui> </ui>

View File

@@ -1 +1 @@
qad_plugin(graphic "Gui;Widgets;OpenGL" "") qad_plugin(graphic "Gui;Widgets;OpenGL" "")

View File

@@ -0,0 +1,28 @@
<RCC>
<qresource prefix="/">
<file>../../icons/media-playback-pause.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/view-autofit.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/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/graphic.png</file>
<file>../../icons/view-fullscreen.png</file>
<file>../../icons/pause-back.png</file>
<file>../../icons/pause-front.png</file>
</qresource>
</RCC>

View File

@@ -1 +1 @@
qad_project(sql_table "Gui;Widgets;Sql" "qad_utils;qad_widgets") qad_project(sql_table "Gui;Widgets;Sql" "qad_utils;qad_widgets")

View File

@@ -1 +1 @@
qad_plugin(sql_table "Gui;Widgets;Sql" "") qad_plugin(sql_table "Gui;Widgets;Sql" "")

Some files were not shown because too many files have changed in this diff Show More