Merge with feature
--HG-- branch : develop
This commit is contained in:
commit
4290a60afd
|
@ -24,6 +24,7 @@ moc/
|
|||
obj/
|
||||
uic/
|
||||
rcc/
|
||||
man/
|
||||
|
||||
# Ignore file used QtCreator for user profile.
|
||||
*.pro.user
|
||||
|
|
218
Valentina.pro
218
Valentina.pro
|
@ -1,216 +1,2 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2013-06-18T12:36:43
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
# Use out-of-source builds (shadow builds)
|
||||
|
||||
QT += core gui widgets xml svg printsupport xmlpatterns
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
TARGET = valentina
|
||||
|
||||
CONFIG -= debug_and_release debug_and_release_target
|
||||
CONFIG += c++11
|
||||
|
||||
#DEFINES += ...
|
||||
|
||||
# directory for executable file
|
||||
DESTDIR = bin
|
||||
|
||||
# files created moc
|
||||
MOC_DIR = moc
|
||||
|
||||
# objecs files
|
||||
OBJECTS_DIR = obj
|
||||
|
||||
# files created rcc
|
||||
RCC_DIR = rcc
|
||||
|
||||
# files created uic
|
||||
UI_DIR = uic
|
||||
|
||||
include(src/src.pri)
|
||||
include(src/container/container.pri)
|
||||
include(src/dialogs/dialogs.pri)
|
||||
include(src/exception/exception.pri)
|
||||
include(src/geometry/geometry.pri)
|
||||
include(src/tools/tools.pri)
|
||||
include(src/widgets/widgets.pri)
|
||||
include(src/xml/xml.pri)
|
||||
|
||||
RESOURCES += \
|
||||
share/resources/icon.qrc \
|
||||
share/resources/cursor.qrc \
|
||||
share/resources/theme.qrc \
|
||||
share/resources/schema.qrc
|
||||
|
||||
OTHER_FILES += share/resources/valentina.rc \
|
||||
share/resources/icon/64x64/icon64x64.ico
|
||||
|
||||
TRANSLATIONS += share/translations/valentina.ts \
|
||||
share/translations/valentina_ru.ts \
|
||||
share/translations/valentina_uk.ts \
|
||||
share/translations/valentina_de.ts \
|
||||
share/translations/valentina_cs.ts \
|
||||
share/translations/valentina_he_IL.ts \
|
||||
share/translations/valentina_fr.ts
|
||||
|
||||
unix {
|
||||
QMAKE_CXX = ccache g++
|
||||
}
|
||||
|
||||
CONFIG += precompile_header
|
||||
# Precompiled headers (PCH)
|
||||
PRECOMPILED_HEADER = src/stable.h
|
||||
win32-msvc* {
|
||||
PRECOMPILED_SOURCE = src/stable.cpp
|
||||
}
|
||||
|
||||
CONFIG(debug, debug|release){
|
||||
# Debug
|
||||
unix {
|
||||
*-g++{
|
||||
QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \
|
||||
-isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \
|
||||
-isystem "/usr/include/qt5/QtCore" -isystem "$${UI_DIR}" -isystem "$${MOC_DIR}" \
|
||||
-isystem "$${RCC_DIR}" \
|
||||
-O0 -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \
|
||||
-Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self -Wstack-protector \
|
||||
-Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \
|
||||
-Wformat=2 -Wimport \
|
||||
-Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \
|
||||
-Wmissing-include-dirs -Wpacked -Wredundant-decls -Winline \
|
||||
-Wswitch-default -Wswitch-enum -Wuninitialized -Wvariadic-macros \
|
||||
-Wlogical-op -Wnoexcept -Wmissing-noreturn -Wpointer-arith\
|
||||
-Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3
|
||||
-ftrapv
|
||||
}
|
||||
} else {
|
||||
*-g++{#Don't use additional GCC keys on Windows system.
|
||||
QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic
|
||||
}
|
||||
}
|
||||
}else{
|
||||
# Release
|
||||
*-g++{
|
||||
QMAKE_CXXFLAGS += -O2
|
||||
}
|
||||
|
||||
DEFINES += QT_NO_DEBUG_OUTPUT
|
||||
}
|
||||
|
||||
message(Qt version: $$[QT_VERSION])
|
||||
message(Qt is installed in $$[QT_INSTALL_PREFIX])
|
||||
message(Qt resources can be found in the following locations:)
|
||||
message(Documentation: $$[QT_INSTALL_DOCS])
|
||||
message(Header files: $$[QT_INSTALL_HEADERS])
|
||||
message(Libraries: $$[QT_INSTALL_LIBS])
|
||||
message(Binary files (executables): $$[QT_INSTALL_BINS])
|
||||
message(Plugins: $$[QT_INSTALL_PLUGINS])
|
||||
message(Data files: $$[QT_INSTALL_DATA])
|
||||
message(Translation files: $$[QT_INSTALL_TRANSLATIONS])
|
||||
message(Settings: $$[QT_INSTALL_SETTINGS])
|
||||
message(Examples: $$[QT_INSTALL_EXAMPLES])
|
||||
|
||||
win32:RC_FILE = share/resources/valentina.rc
|
||||
|
||||
# Remove generated files at cleaning
|
||||
QMAKE_DISTCLEAN += $${DESTDIR}/* \
|
||||
$${OBJECTS_DIR}/* \
|
||||
$${UI_DIR}/* \
|
||||
$${MOC_DIR}/* \
|
||||
$${RCC_DIR}/* \
|
||||
$$PWD/share/translations/valentina_*.qm
|
||||
|
||||
INSTALL_TRANSLATIONS += share/translations/valentina_ru.qm \
|
||||
share/translations/valentina_uk.qm \
|
||||
share/translations/valentina_de.qm \
|
||||
share/translations/valentina_cs.qm \
|
||||
share/translations/valentina_he_IL.qm \
|
||||
share/translations/valentina_fr.qm
|
||||
|
||||
INSTALL_STANDARD_MEASHUREMENTS += share/tables/standard/GOST_man_ru.vst
|
||||
|
||||
INSTALL_INDIVIDUAL_MEASHUREMENTS += share/tables/individual/indivindual_ru.vit
|
||||
|
||||
unix {
|
||||
#VARIABLES
|
||||
isEmpty(PREFIX) {
|
||||
PREFIX = /usr
|
||||
}
|
||||
BINDIR = $$PREFIX/bin
|
||||
DATADIR =$$PREFIX/share
|
||||
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"
|
||||
#MAKE INSTALL
|
||||
target.path = $$BINDIR
|
||||
desktop.path = $$DATADIR/applications/
|
||||
desktop.files += dist/$${TARGET}.desktop
|
||||
pixmaps.path = $$DATADIR/pixmaps/
|
||||
pixmaps.files += dist/$${TARGET}.png
|
||||
translations.path = $$DATADIR/$${TARGET}/translations/
|
||||
translations.files = $$INSTALL_TRANSLATIONS
|
||||
standard.path = $$DATADIR/$${TARGET}/tables/standard/
|
||||
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS
|
||||
individual.path = $$DATADIR/$${TARGET}/tables/individual/
|
||||
individual.files = $$INSTALL_INDIVIDUAL_MEASHUREMENTS
|
||||
INSTALLS += target \
|
||||
desktop \
|
||||
pixmaps \
|
||||
translations \
|
||||
standard \
|
||||
individual
|
||||
}
|
||||
|
||||
!isEmpty(TRANSLATIONS): {
|
||||
for(_translation_name, TRANSLATIONS) {
|
||||
_translation_name_qm = $$section(_translation_name,".", 0, 0).qm
|
||||
|
||||
system($$shell_path($$[QT_INSTALL_BINS]/lrelease) $$shell_path($$PWD/$$_translation_name) -qm $$shell_path($$PWD/$$_translation_name_qm))
|
||||
}
|
||||
}
|
||||
|
||||
# Copies the given files to the destination directory
|
||||
defineTest(copyToDestdir) {
|
||||
files = $$1
|
||||
DDIR = $$2
|
||||
mkpath($$DDIR)
|
||||
|
||||
for(FILE, files) {
|
||||
|
||||
# Replace slashes in paths with backslashes for Windows
|
||||
win32{
|
||||
FILE ~= s,/,\\,g
|
||||
DDIR ~= s,/,\\,g
|
||||
}
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
|
||||
}
|
||||
|
||||
export(QMAKE_POST_LINK)
|
||||
}
|
||||
|
||||
for(DIR, INSTALL_TRANSLATIONS) {
|
||||
#add these absolute paths to a variable which
|
||||
#ends up as 'mkcommands = path1 path2 path3 ...'
|
||||
tr_path += $$PWD/$$DIR
|
||||
}
|
||||
|
||||
copyToDestdir($$tr_path, $$shell_path($$OUT_PWD/$$DESTDIR/translations))
|
||||
|
||||
for(DIR, INSTALL_STANDARD_MEASHUREMENTS) {
|
||||
#add these absolute paths to a variable which
|
||||
#ends up as 'mkcommands = path1 path2 path3 ...'
|
||||
st_path += $$PWD/$$DIR
|
||||
}
|
||||
|
||||
copyToDestdir($$st_path, $$shell_path($$OUT_PWD/$$DESTDIR/tables/standard))
|
||||
|
||||
for(DIR, INSTALL_INDIVIDUAL_MEASHUREMENTS) {
|
||||
#add these absolute paths to a variable which
|
||||
#ends up as 'mkcommands = path1 path2 path3 ...'
|
||||
ind_path += $$PWD/$$DIR
|
||||
}
|
||||
|
||||
copyToDestdir($$ind_path, $$shell_path($$OUT_PWD/$$DESTDIR/tables/individual))
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS = src
|
||||
|
|
27
dist/copyright_template.txt
vendored
Normal file
27
dist/copyright_template.txt
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file %FILENAME%
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date %DAY% %MONTH%, %YEAR%
|
||||
**
|
||||
** @brief
|
||||
** @copyright
|
||||
** This source code is part of the Valentine project, a pattern making
|
||||
** program, whose allow create and modeling patterns of clothing.
|
||||
** Copyright (C) %YEAR% Valentina project
|
||||
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||
**
|
||||
** Valentina is free software: you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
** the Free Software Foundation, either version 3 of the License, or
|
||||
** (at your option) any later version.
|
||||
**
|
||||
** Valentina is distributed in the hope that it will be useful,
|
||||
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
** GNU General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU General Public License
|
||||
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||
**
|
||||
*************************************************************************/
|
|
@ -1,5 +1,10 @@
|
|||
#!/bin/sh
|
||||
# Script generate developer documentation for progect.
|
||||
# Output directory doc/
|
||||
# Run from root directory of project
|
||||
# Script generate developer documentation for whole progect.
|
||||
# Output directories src/app/doc/, src/libs/qmuparser/doc/
|
||||
# Run from "scripts" directory
|
||||
cd ..
|
||||
cd src/app
|
||||
doxygen doc/doxygen/Doxyfile
|
||||
cd ..
|
||||
cd libs/qmuparser
|
||||
doxygen doc/doxygen/Doxyfile
|
||||
|
|
234
src/app/app.pri
Normal file
234
src/app/app.pri
Normal file
|
@ -0,0 +1,234 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2013-06-18T12:36:43
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
# Use out-of-source builds (shadow builds)
|
||||
|
||||
QT += core gui widgets xml svg printsupport xmlpatterns
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
TARGET = valentina
|
||||
|
||||
CONFIG -= debug_and_release debug_and_release_target
|
||||
CONFIG += c++11
|
||||
|
||||
#DEFINES += ...
|
||||
|
||||
# directory for executable file
|
||||
DESTDIR = bin
|
||||
|
||||
# files created moc
|
||||
MOC_DIR = moc
|
||||
|
||||
# objecs files
|
||||
OBJECTS_DIR = obj
|
||||
|
||||
# files created rcc
|
||||
RCC_DIR = rcc
|
||||
|
||||
# files created uic
|
||||
UI_DIR = uic
|
||||
|
||||
include(src/app/container/container.pri)
|
||||
include(src/app/dialogs/dialogs.pri)
|
||||
include(src/app/exception/exception.pri)
|
||||
include(src/app/geometry/geometry.pri)
|
||||
include(src/app/tools/tools.pri)
|
||||
include(src/app/widgets/widgets.pri)
|
||||
include(src/app/xml/xml.pri)
|
||||
|
||||
SOURCES += \
|
||||
src/app/main.cpp \
|
||||
src/app/mainwindow.cpp \
|
||||
src/app/tablewindow.cpp \
|
||||
src/app/stable.cpp \
|
||||
src/app/version.cpp
|
||||
|
||||
HEADERS += \
|
||||
src/app/mainwindow.h \
|
||||
src/app/options.h \
|
||||
src/app/tablewindow.h \
|
||||
src/app/stable.h \
|
||||
src/app/version.h
|
||||
|
||||
FORMS += \
|
||||
src/app/mainwindow.ui \
|
||||
src/app/tablewindow.ui
|
||||
|
||||
RESOURCES += \
|
||||
share/resources/icon.qrc \
|
||||
share/resources/cursor.qrc \
|
||||
share/resources/theme.qrc \
|
||||
share/resources/schema.qrc
|
||||
|
||||
OTHER_FILES += share/resources/valentina.rc \
|
||||
share/resources/icon/64x64/icon64x64.ico
|
||||
|
||||
TRANSLATIONS += share/translations/valentina.ts \
|
||||
share/translations/valentina_ru.ts \
|
||||
share/translations/valentina_uk.ts \
|
||||
share/translations/valentina_de.ts \
|
||||
share/translations/valentina_cs.ts \
|
||||
share/translations/valentina_he_IL.ts \
|
||||
share/translations/valentina_fr.ts
|
||||
|
||||
unix {
|
||||
QMAKE_CXX = ccache g++
|
||||
}
|
||||
|
||||
CONFIG += precompile_header
|
||||
# Precompiled headers (PCH)
|
||||
PRECOMPILED_HEADER = src/stable.h
|
||||
win32-msvc* {
|
||||
PRECOMPILED_SOURCE = src/stable.cpp
|
||||
}
|
||||
|
||||
CONFIG(debug, debug|release){
|
||||
# Debug
|
||||
unix {
|
||||
*-g++{
|
||||
QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \
|
||||
-isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \
|
||||
-isystem "/usr/include/qt5/QtCore" -isystem "$${UI_DIR}" -isystem "$${MOC_DIR}" \
|
||||
-isystem "$${RCC_DIR}" \
|
||||
-O0 -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \
|
||||
-Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self -Wstack-protector \
|
||||
-Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \
|
||||
-Wformat=2 -Wimport \
|
||||
-Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \
|
||||
-Wmissing-include-dirs -Wpacked -Wredundant-decls -Winline \
|
||||
-Wswitch-default -Wswitch-enum -Wuninitialized -Wvariadic-macros \
|
||||
-Wlogical-op -Wnoexcept -Wmissing-noreturn -Wpointer-arith\
|
||||
-Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3
|
||||
-ftrapv
|
||||
}
|
||||
} else {
|
||||
*-g++{#Don't use additional GCC keys on Windows system.
|
||||
QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic
|
||||
}
|
||||
}
|
||||
}else{
|
||||
# Release
|
||||
*-g++{
|
||||
QMAKE_CXXFLAGS += -O2
|
||||
}
|
||||
|
||||
DEFINES += QT_NO_DEBUG_OUTPUT
|
||||
}
|
||||
|
||||
message(Qt version: $$[QT_VERSION])
|
||||
message(Qt is installed in $$[QT_INSTALL_PREFIX])
|
||||
message(Qt resources can be found in the following locations:)
|
||||
message(Documentation: $$[QT_INSTALL_DOCS])
|
||||
message(Header files: $$[QT_INSTALL_HEADERS])
|
||||
message(Libraries: $$[QT_INSTALL_LIBS])
|
||||
message(Binary files (executables): $$[QT_INSTALL_BINS])
|
||||
message(Plugins: $$[QT_INSTALL_PLUGINS])
|
||||
message(Data files: $$[QT_INSTALL_DATA])
|
||||
message(Translation files: $$[QT_INSTALL_TRANSLATIONS])
|
||||
message(Settings: $$[QT_INSTALL_SETTINGS])
|
||||
message(Examples: $$[QT_INSTALL_EXAMPLES])
|
||||
|
||||
win32:RC_FILE = share/resources/valentina.rc
|
||||
|
||||
# Remove generated files at cleaning
|
||||
QMAKE_DISTCLEAN += $${DESTDIR}/* \
|
||||
$${OBJECTS_DIR}/* \
|
||||
$${UI_DIR}/* \
|
||||
$${MOC_DIR}/* \
|
||||
$${RCC_DIR}/* \
|
||||
$$PWD/share/translations/valentina_*.qm
|
||||
|
||||
INSTALL_TRANSLATIONS += share/translations/valentina_ru.qm \
|
||||
share/translations/valentina_uk.qm \
|
||||
share/translations/valentina_de.qm \
|
||||
share/translations/valentina_cs.qm \
|
||||
share/translations/valentina_he_IL.qm \
|
||||
share/translations/valentina_fr.qm
|
||||
|
||||
INSTALL_STANDARD_MEASHUREMENTS += share/tables/standard/GOST_man_ru.vst
|
||||
|
||||
INSTALL_INDIVIDUAL_MEASHUREMENTS += share/tables/individual/indivindual_ru.vit
|
||||
|
||||
unix {
|
||||
#VARIABLES
|
||||
isEmpty(PREFIX) {
|
||||
PREFIX = /usr
|
||||
}
|
||||
BINDIR = $$PREFIX/bin
|
||||
DATADIR =$$PREFIX/share
|
||||
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"
|
||||
#MAKE INSTALL
|
||||
target.path = $$BINDIR
|
||||
desktop.path = $$DATADIR/applications/
|
||||
desktop.files += dist/$${TARGET}.desktop
|
||||
pixmaps.path = $$DATADIR/pixmaps/
|
||||
pixmaps.files += dist/$${TARGET}.png
|
||||
translations.path = $$DATADIR/$${TARGET}/translations/
|
||||
translations.files = $$INSTALL_TRANSLATIONS
|
||||
standard.path = $$DATADIR/$${TARGET}/tables/standard/
|
||||
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS
|
||||
individual.path = $$DATADIR/$${TARGET}/tables/individual/
|
||||
individual.files = $$INSTALL_INDIVIDUAL_MEASHUREMENTS
|
||||
INSTALLS += target \
|
||||
desktop \
|
||||
pixmaps \
|
||||
translations \
|
||||
standard \
|
||||
individual
|
||||
}
|
||||
|
||||
!isEmpty(TRANSLATIONS): {
|
||||
for(_translation_name, TRANSLATIONS) {
|
||||
_translation_name_qm = $$section(_translation_name,".", 0, 0).qm
|
||||
|
||||
system($$shell_path($$[QT_INSTALL_BINS]/lrelease) $$shell_path($$PWD/$$_translation_name) -qm $$shell_path($$PWD/$$_translation_name_qm))
|
||||
}
|
||||
}
|
||||
|
||||
# Copies the given files to the destination directory
|
||||
defineTest(copyToDestdir) {
|
||||
files = $$1
|
||||
DDIR = $$2
|
||||
mkpath($$DDIR)
|
||||
|
||||
for(FILE, files) {
|
||||
|
||||
# Replace slashes in paths with backslashes for Windows
|
||||
win32{
|
||||
FILE ~= s,/,\\,g
|
||||
DDIR ~= s,/,\\,g
|
||||
}
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
|
||||
}
|
||||
|
||||
export(QMAKE_POST_LINK)
|
||||
}
|
||||
|
||||
for(DIR, INSTALL_TRANSLATIONS) {
|
||||
#add these absolute paths to a variable which
|
||||
#ends up as 'mkcommands = path1 path2 path3 ...'
|
||||
tr_path += $$PWD/$$DIR
|
||||
}
|
||||
|
||||
copyToDestdir($$tr_path, $$shell_path($$OUT_PWD/$$DESTDIR/translations))
|
||||
|
||||
for(DIR, INSTALL_STANDARD_MEASHUREMENTS) {
|
||||
#add these absolute paths to a variable which
|
||||
#ends up as 'mkcommands = path1 path2 path3 ...'
|
||||
st_path += $$PWD/$$DIR
|
||||
}
|
||||
|
||||
copyToDestdir($$st_path, $$shell_path($$OUT_PWD/$$DESTDIR/tables/standard))
|
||||
|
||||
for(DIR, INSTALL_INDIVIDUAL_MEASHUREMENTS) {
|
||||
#add these absolute paths to a variable which
|
||||
#ends up as 'mkcommands = path1 path2 path3 ...'
|
||||
ind_path += $$PWD/$$DIR
|
||||
}
|
||||
|
||||
copyToDestdir($$ind_path, $$shell_path($$OUT_PWD/$$DESTDIR/tables/individual))
|
||||
|
240
src/app/app.pro
Normal file
240
src/app/app.pro
Normal file
|
@ -0,0 +1,240 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2013-06-18T12:36:43
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
# Use out-of-source builds (shadow builds)
|
||||
|
||||
QT += core gui widgets xml svg printsupport xmlpatterns
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
TARGET = valentina
|
||||
|
||||
CONFIG -= debug_and_release debug_and_release_target
|
||||
CONFIG += c++11
|
||||
|
||||
#DEFINES += ...
|
||||
|
||||
# directory for executable file
|
||||
DESTDIR = bin
|
||||
|
||||
# files created moc
|
||||
MOC_DIR = moc
|
||||
|
||||
# objecs files
|
||||
OBJECTS_DIR = obj
|
||||
|
||||
# files created rcc
|
||||
RCC_DIR = rcc
|
||||
|
||||
# files created uic
|
||||
UI_DIR = uic
|
||||
|
||||
include(container/container.pri)
|
||||
include(dialogs/dialogs.pri)
|
||||
include(exception/exception.pri)
|
||||
include(geometry/geometry.pri)
|
||||
include(tools/tools.pri)
|
||||
include(widgets/widgets.pri)
|
||||
include(xml/xml.pri)
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
mainwindow.cpp \
|
||||
tablewindow.cpp \
|
||||
stable.cpp \
|
||||
version.cpp
|
||||
|
||||
HEADERS += \
|
||||
mainwindow.h \
|
||||
options.h \
|
||||
tablewindow.h \
|
||||
stable.h \
|
||||
version.h
|
||||
|
||||
FORMS += \
|
||||
mainwindow.ui \
|
||||
tablewindow.ui
|
||||
|
||||
RESOURCES += \
|
||||
share/resources/icon.qrc \
|
||||
share/resources/cursor.qrc \
|
||||
share/resources/theme.qrc \
|
||||
share/resources/schema.qrc
|
||||
|
||||
OTHER_FILES += share/resources/valentina.rc \
|
||||
share/resources/icon/64x64/icon64x64.ico
|
||||
|
||||
TRANSLATIONS += share/translations/valentina.ts \
|
||||
share/translations/valentina_ru.ts \
|
||||
share/translations/valentina_uk.ts \
|
||||
share/translations/valentina_de.ts \
|
||||
share/translations/valentina_cs.ts \
|
||||
share/translations/valentina_he_IL.ts \
|
||||
share/translations/valentina_fr.ts
|
||||
|
||||
unix {
|
||||
QMAKE_CXX = ccache g++
|
||||
}
|
||||
|
||||
CONFIG += precompile_header
|
||||
# Precompiled headers (PCH)
|
||||
PRECOMPILED_HEADER = stable.h
|
||||
win32-msvc* {
|
||||
PRECOMPILED_SOURCE = stable.cpp
|
||||
}
|
||||
|
||||
CONFIG(debug, debug|release){
|
||||
# Debug
|
||||
unix {
|
||||
*-g++{
|
||||
QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \
|
||||
-isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \
|
||||
-isystem "/usr/include/qt5/QtCore" -isystem "$${UI_DIR}" -isystem "$${MOC_DIR}" \
|
||||
-isystem "$${RCC_DIR}" \
|
||||
-O0 -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \
|
||||
-Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self -Wstack-protector \
|
||||
-Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \
|
||||
-Wformat=2 -Wimport \
|
||||
-Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \
|
||||
-Wmissing-include-dirs -Wpacked -Wredundant-decls -Winline \
|
||||
-Wswitch-default -Wswitch-enum -Wuninitialized -Wvariadic-macros \
|
||||
-Wlogical-op -Wnoexcept -Wmissing-noreturn -Wpointer-arith\
|
||||
-Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3 \
|
||||
-ftrapv
|
||||
}
|
||||
} else {
|
||||
*-g++{#Don't use additional GCC keys on Windows system.
|
||||
QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic
|
||||
}
|
||||
}
|
||||
}else{
|
||||
# Release
|
||||
*-g++{
|
||||
QMAKE_CXXFLAGS += -O2
|
||||
}
|
||||
|
||||
DEFINES += QT_NO_DEBUG_OUTPUT
|
||||
}
|
||||
|
||||
message(Qt version: $$[QT_VERSION])
|
||||
message(Qt is installed in $$[QT_INSTALL_PREFIX])
|
||||
message(Qt resources can be found in the following locations:)
|
||||
message(Documentation: $$[QT_INSTALL_DOCS])
|
||||
message(Header files: $$[QT_INSTALL_HEADERS])
|
||||
message(Libraries: $$[QT_INSTALL_LIBS])
|
||||
message(Binary files (executables): $$[QT_INSTALL_BINS])
|
||||
message(Plugins: $$[QT_INSTALL_PLUGINS])
|
||||
message(Data files: $$[QT_INSTALL_DATA])
|
||||
message(Translation files: $$[QT_INSTALL_TRANSLATIONS])
|
||||
message(Settings: $$[QT_INSTALL_SETTINGS])
|
||||
message(Examples: $$[QT_INSTALL_EXAMPLES])
|
||||
|
||||
win32:RC_FILE = share/resources/valentina.rc
|
||||
|
||||
# Remove generated files at cleaning
|
||||
QMAKE_DISTCLEAN += $${DESTDIR}/* \
|
||||
$${OBJECTS_DIR}/* \
|
||||
$${UI_DIR}/* \
|
||||
$${MOC_DIR}/* \
|
||||
$${RCC_DIR}/* \
|
||||
$$PWD/share/translations/valentina_*.qm
|
||||
|
||||
INSTALL_TRANSLATIONS += share/translations/valentina_ru.qm \
|
||||
share/translations/valentina_uk.qm \
|
||||
share/translations/valentina_de.qm \
|
||||
share/translations/valentina_cs.qm \
|
||||
share/translations/valentina_he_IL.qm \
|
||||
share/translations/valentina_fr.qm
|
||||
|
||||
INSTALL_STANDARD_MEASHUREMENTS += share/tables/standard/GOST_man_ru.vst
|
||||
|
||||
INSTALL_INDIVIDUAL_MEASHUREMENTS += share/tables/individual/indivindual_ru.vit
|
||||
|
||||
unix {
|
||||
#VARIABLES
|
||||
isEmpty(PREFIX) {
|
||||
PREFIX = /usr
|
||||
}
|
||||
BINDIR = $$PREFIX/bin
|
||||
DATADIR =$$PREFIX/share
|
||||
DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\"
|
||||
#MAKE INSTALL
|
||||
target.path = $$BINDIR
|
||||
desktop.path = $$DATADIR/applications/
|
||||
desktop.files += dist/$${TARGET}.desktop
|
||||
pixmaps.path = $$DATADIR/pixmaps/
|
||||
pixmaps.files += dist/$${TARGET}.png
|
||||
translations.path = $$DATADIR/$${TARGET}/translations/
|
||||
translations.files = $$INSTALL_TRANSLATIONS
|
||||
standard.path = $$DATADIR/$${TARGET}/tables/standard/
|
||||
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS
|
||||
individual.path = $$DATADIR/$${TARGET}/tables/individual/
|
||||
individual.files = $$INSTALL_INDIVIDUAL_MEASHUREMENTS
|
||||
INSTALLS += target \
|
||||
desktop \
|
||||
pixmaps \
|
||||
translations \
|
||||
standard \
|
||||
individual
|
||||
}
|
||||
|
||||
!isEmpty(TRANSLATIONS): {
|
||||
for(_translation_name, TRANSLATIONS) {
|
||||
_translation_name_qm = $$section(_translation_name,".", 0, 0).qm
|
||||
|
||||
system($$shell_path($$[QT_INSTALL_BINS]/lrelease) $$shell_path($$PWD/$$_translation_name) -qm $$shell_path($$PWD/$$_translation_name_qm))
|
||||
}
|
||||
}
|
||||
|
||||
# Copies the given files to the destination directory
|
||||
defineTest(copyToDestdir) {
|
||||
files = $$1
|
||||
DDIR = $$2
|
||||
mkpath($$DDIR)
|
||||
|
||||
for(FILE, files) {
|
||||
|
||||
# Replace slashes in paths with backslashes for Windows
|
||||
win32{
|
||||
FILE ~= s,/,\\,g
|
||||
DDIR ~= s,/,\\,g
|
||||
}
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
|
||||
}
|
||||
|
||||
export(QMAKE_POST_LINK)
|
||||
}
|
||||
|
||||
for(DIR, INSTALL_TRANSLATIONS) {
|
||||
#add these absolute paths to a variable which
|
||||
#ends up as 'mkcommands = path1 path2 path3 ...'
|
||||
tr_path += $$PWD/$$DIR
|
||||
}
|
||||
|
||||
copyToDestdir($$tr_path, $$shell_path($$OUT_PWD/$$DESTDIR/translations))
|
||||
|
||||
for(DIR, INSTALL_STANDARD_MEASHUREMENTS) {
|
||||
#add these absolute paths to a variable which
|
||||
#ends up as 'mkcommands = path1 path2 path3 ...'
|
||||
st_path += $$PWD/$$DIR
|
||||
}
|
||||
|
||||
copyToDestdir($$st_path, $$shell_path($$OUT_PWD/$$DESTDIR/tables/standard))
|
||||
|
||||
for(DIR, INSTALL_INDIVIDUAL_MEASHUREMENTS) {
|
||||
#add these absolute paths to a variable which
|
||||
#ends up as 'mkcommands = path1 path2 path3 ...'
|
||||
ind_path += $$PWD/$$DIR
|
||||
}
|
||||
|
||||
copyToDestdir($$ind_path, $$shell_path($$OUT_PWD/$$DESTDIR/tables/individual))
|
||||
|
||||
win32:CONFIG(release, debug|release): LIBS += -L../libs/qmuparser/bin -lqmuparser
|
||||
else:win32:CONFIG(debug, debug|release): LIBS += -L../libs/qmuparser/bin -lqmuparser
|
||||
else:unix: LIBS += -L../libs/qmuparser/bin -lqmuparser
|
||||
|
||||
INCLUDEPATH += ../libs/qmuparser
|
||||
DEPENDPATH += ../libs/qmuparser
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file calculator.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -38,6 +38,7 @@
|
|||
#define FINISHED 10
|
||||
#define EOL 9
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal Calculator::eval(QString prog, QString *errorMsg)
|
||||
{
|
||||
this->errorMsg = errorMsg;
|
||||
|
@ -53,6 +54,7 @@ qreal Calculator::eval(QString prog, QString *errorMsg)
|
|||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal Calculator::get_exp()
|
||||
{
|
||||
qreal result = 0;
|
||||
|
@ -67,7 +69,7 @@ qreal Calculator::get_exp()
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level2(qreal *result)
|
||||
{
|
||||
QChar op;
|
||||
|
@ -82,6 +84,7 @@ void Calculator::level2(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level3(qreal *result)
|
||||
{
|
||||
QChar op;
|
||||
|
@ -97,6 +100,7 @@ void Calculator::level3(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level4(qreal *result)
|
||||
{
|
||||
qreal hold;
|
||||
|
@ -110,6 +114,7 @@ void Calculator::level4(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level5(qreal *result)
|
||||
{
|
||||
QChar op;
|
||||
|
@ -127,6 +132,7 @@ void Calculator::level5(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level6(qreal *result)
|
||||
{
|
||||
if ((token[0] == '(') && (token_type == DELIMITER))
|
||||
|
@ -142,6 +148,7 @@ void Calculator::level6(qreal *result)
|
|||
primitive(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::primitive(qreal *result)
|
||||
{
|
||||
QString str;
|
||||
|
@ -164,6 +171,7 @@ void Calculator::primitive(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::arith(QChar o, qreal *r, qreal *h)
|
||||
{
|
||||
qreal t;//, ex;
|
||||
|
@ -194,6 +202,7 @@ void Calculator::arith(QChar o, qreal *r, qreal *h)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::unary(QChar o, qreal *r)
|
||||
{
|
||||
if (o=='-')
|
||||
|
@ -202,6 +211,7 @@ void Calculator::unary(QChar o, qreal *r)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal Calculator::find_var(QString s)
|
||||
{
|
||||
bool ok = false;
|
||||
|
@ -215,6 +225,7 @@ qreal Calculator::find_var(QString s)
|
|||
return value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::serror(qint32 error)
|
||||
{
|
||||
QString e[]=
|
||||
|
@ -230,6 +241,7 @@ void Calculator::serror(qint32 error)
|
|||
qDebug()<<e[error];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
char Calculator::look_up(QString s)
|
||||
{
|
||||
QString p;
|
||||
|
@ -240,6 +252,7 @@ char Calculator::look_up(QString s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool Calculator::isdelim(QChar c)
|
||||
{
|
||||
if (StrChr(" ;,+-<>/*%^=()", c) || c=='\n' || c=='\r' || c=='\0')
|
||||
|
@ -249,6 +262,7 @@ bool Calculator::isdelim(QChar c)
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool Calculator::iswhite(QChar c)
|
||||
{
|
||||
if (c==' ' || c=='\t')
|
||||
|
@ -261,6 +275,7 @@ bool Calculator::iswhite(QChar c)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::get_token()
|
||||
{
|
||||
QString *temp;
|
||||
|
@ -355,11 +370,13 @@ void Calculator::get_token()
|
|||
return;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool Calculator::StrChr(QString string, QChar c)
|
||||
{
|
||||
return string.contains(c, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::putback()
|
||||
{
|
||||
QString t;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file calculator.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
11
src/app/container/container.pri
Normal file
11
src/app/container/container.pri
Normal file
|
@ -0,0 +1,11 @@
|
|||
SOURCES += \
|
||||
container/vcontainer.cpp \
|
||||
container/calculator.cpp \
|
||||
container/vmeasurement.cpp \
|
||||
container/vincrement.cpp
|
||||
|
||||
HEADERS += \
|
||||
container/vcontainer.h \
|
||||
container/calculator.h \
|
||||
container/vmeasurement.h \
|
||||
container/vincrement.h
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vcontainer.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -34,20 +34,22 @@
|
|||
|
||||
quint32 VContainer::_id = 0;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContainer::VContainer()
|
||||
:_size(50), sizeName("Сг"), _height(176), heightName("P"), gObjects(QHash<quint32, VGObject *>()),
|
||||
measurements(QHash<QString, VMeasurement>()), increments(QHash<QString, VIncrement>()),
|
||||
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), lengthSplines(QHash<QString, qreal>()),
|
||||
lengthArcs(QHash<QString, qreal>()), details(QHash<quint32, VDetail>())
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContainer &VContainer::operator =(const VContainer &data)
|
||||
{
|
||||
setData(data);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContainer::VContainer(const VContainer &data)
|
||||
:_size(50), sizeName("Сг"), _height(176), heightName("P"), gObjects(QHash<quint32, VGObject *>()),
|
||||
measurements(QHash<QString, VMeasurement>()), increments(QHash<QString, VIncrement>()),
|
||||
|
@ -57,12 +59,14 @@ VContainer::VContainer(const VContainer &data)
|
|||
setData(data);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContainer::~VContainer()
|
||||
{
|
||||
qDeleteAll(gObjects);
|
||||
gObjects.clear();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::setData(const VContainer &data)
|
||||
{
|
||||
_size = data.size();
|
||||
|
@ -106,11 +110,14 @@ void VContainer::setData(const VContainer &data)
|
|||
details = *data.DataDetails();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
// cppcheck-suppress unusedFunction
|
||||
const VGObject *VContainer::GetGObject(quint32 id)const
|
||||
{
|
||||
return GetObject(gObjects, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename key, typename val>
|
||||
const val VContainer::GetObject(const QHash<key, val> &obj, key id) const
|
||||
{
|
||||
|
@ -124,6 +131,7 @@ const val VContainer::GetObject(const QHash<key, val> &obj, key id) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename key, typename val>
|
||||
val VContainer::GetVariable(const QHash<key, val> &obj, key id) const
|
||||
{
|
||||
|
@ -137,52 +145,61 @@ val VContainer::GetVariable(const QHash<key, val> &obj, key id) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const VMeasurement VContainer::GetMeasurement(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(measurements, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const VIncrement VContainer::GetIncrement(const QString& name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(increments, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetLine(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(lengthLines, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetLengthArc(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(lengthArcs, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetLengthSpline(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(lengthSplines, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetLineAngle(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(lineAngles, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const VDetail VContainer::GetDetail(quint32 id) const
|
||||
{
|
||||
return GetVariable(details, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VContainer::AddGObject(VGObject *obj)
|
||||
{
|
||||
return AddObject(gObjects, obj);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VContainer::AddDetail(VDetail detail)
|
||||
{
|
||||
quint32 id = getNextId();
|
||||
|
@ -190,17 +207,20 @@ quint32 VContainer::AddDetail(VDetail detail)
|
|||
return id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddIncrement(const QString &name, VIncrement incr)
|
||||
{
|
||||
increments[name] = incr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VContainer::getNextId()
|
||||
{
|
||||
_id++;
|
||||
return _id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::UpdateId(quint32 newId)
|
||||
{
|
||||
if (newId > _id)
|
||||
|
@ -209,6 +229,7 @@ void VContainer::UpdateId(quint32 newId)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename val>
|
||||
void VContainer::UpdateObject(QHash<quint32, val> &obj, const quint32 &id, val point)
|
||||
{
|
||||
|
@ -224,24 +245,28 @@ void VContainer::UpdateObject(QHash<quint32, val> &obj, const quint32 &id, val p
|
|||
UpdateId(id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLengthSpline(const QString &name, const qreal &value)
|
||||
{
|
||||
Q_ASSERT(name.isEmpty() == false);
|
||||
lengthSplines[name] = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLengthArc(const quint32 &id)
|
||||
{
|
||||
const VArc * arc = GeometricObject<const VArc *>(id);
|
||||
lengthArcs[arc->name()] = qApp->fromPixel(arc->GetLength());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLineAngle(const QString &name, const qreal &value)
|
||||
{
|
||||
Q_ASSERT(name.isEmpty() == false);
|
||||
lineAngles[name] = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetValueStandardTableRow(const QString& name) const
|
||||
{
|
||||
const VMeasurement m = GetMeasurement(name);
|
||||
|
@ -255,6 +280,7 @@ qreal VContainer::GetValueStandardTableRow(const QString& name) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetValueIncrementTableRow(const QString& name) const
|
||||
{
|
||||
const VIncrement icr = GetIncrement(name);
|
||||
|
@ -268,6 +294,7 @@ qreal VContainer::GetValueIncrementTableRow(const QString& name) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::Clear()
|
||||
{
|
||||
_id = 0;
|
||||
|
@ -281,6 +308,7 @@ void VContainer::Clear()
|
|||
ClearGObjects();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::ClearGObjects()
|
||||
{
|
||||
if (gObjects.size()>0)
|
||||
|
@ -290,6 +318,7 @@ void VContainer::ClearGObjects()
|
|||
gObjects.clear();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::ClearCalculationGObjects()
|
||||
{
|
||||
if (gObjects.size()>0)
|
||||
|
@ -307,6 +336,7 @@ void VContainer::ClearCalculationGObjects()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::FindVar(const QString &name, bool *ok)const
|
||||
{
|
||||
if (sizeName == name)
|
||||
|
@ -353,6 +383,7 @@ qreal VContainer::FindVar(const QString &name, bool *ok)const
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPointId)
|
||||
{
|
||||
QString nameLine = GetNameLine(firstPointId, secondPointId);
|
||||
|
@ -363,6 +394,7 @@ void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPoint
|
|||
AddLineAngle(nameLine, QLineF(first->toQPointF(), second->toQPointF()).angle());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename key, typename val>
|
||||
quint32 VContainer::AddObject(QHash<key, val> &obj, val value)
|
||||
{
|
||||
|
@ -373,6 +405,7 @@ quint32 VContainer::AddObject(QHash<key, val> &obj, val value)
|
|||
return id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VContainer::GetNameLine(const quint32 &firstPoint, const quint32 &secondPoint) const
|
||||
{
|
||||
const VPointF *first = GeometricObject<const VPointF *>(firstPoint);
|
||||
|
@ -381,6 +414,7 @@ QString VContainer::GetNameLine(const quint32 &firstPoint, const quint32 &second
|
|||
return QString("Line_%1_%2").arg(first->name(), second->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VContainer::GetNameLineAngle(const quint32 &firstPoint, const quint32 &secondPoint) const
|
||||
{
|
||||
const VPointF *first = GeometricObject<const VPointF *>(firstPoint);
|
||||
|
@ -389,11 +423,13 @@ QString VContainer::GetNameLineAngle(const quint32 &firstPoint, const quint32 &s
|
|||
return QString("AngleLine_%1_%2").arg(first->name(), second->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::UpdateGObject(quint32 id, VGObject* obj)
|
||||
{
|
||||
UpdateObject(gObjects, id, obj);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::UpdateDetail(quint32 id, const VDetail &detail)
|
||||
{
|
||||
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
|
||||
|
@ -401,6 +437,7 @@ void VContainer::UpdateDetail(quint32 id, const VDetail &detail)
|
|||
UpdateId(id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLengthLine(const QString &name, const qreal &value)
|
||||
{
|
||||
Q_ASSERT(name.isEmpty() == false);
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vcontainer.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vincrementtablerow.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -28,17 +28,21 @@
|
|||
|
||||
#include "vincrement.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VIncrement::VIncrement()
|
||||
:id(0), base(0), ksize(50.0), kheight(176.0), description(QString()){}
|
||||
|
||||
VIncrement::VIncrement(quint32 id, qreal base, qreal ksize, qreal kheight, QString description)
|
||||
:id(id), base(base), ksize(ksize), kheight(kheight), description(description){}
|
||||
:id(id), base(base), ksize(ksize), kheight(kheight), description(description)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VIncrement::GetValue() const
|
||||
{
|
||||
return base;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VIncrement::GetValue(const qreal &size, const qreal &height) const
|
||||
{
|
||||
const qreal k_size = ( size - 50.0 ) / 2.0;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vincrementtablerow.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vstandardtablecell.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -28,40 +28,35 @@
|
|||
|
||||
#include "vmeasurement.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMeasurement::VMeasurement()
|
||||
:base(0), ksize(50.0), kheight(176.0), gui_text(QString()), number(QString()), virtualM(false),
|
||||
_tagName(QString())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMeasurement::VMeasurement(const qreal &base, const qreal &ksize, const qreal &kgrowth,
|
||||
const QString &gui_text, const QString &number, const QString &tagName)
|
||||
:base(base), ksize(ksize), kheight(kgrowth), gui_text(gui_text), number(number), virtualM(false),
|
||||
_tagName(tagName)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMeasurement::VMeasurement(const qreal &base, const QString &gui_text, const QString &number, const QString &tagName)
|
||||
:base(base), ksize(50.0), kheight(176.0), gui_text(gui_text), number(number), virtualM(false),
|
||||
_tagName(tagName)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VMeasurement::GetValue() const
|
||||
{
|
||||
return base;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VMeasurement::GetValue(const qreal &size, const qreal &height) const
|
||||
{
|
||||
const qreal k_size = ( size - 50.0 ) / 2.0;
|
||||
const qreal k_height = ( height - 176.0 ) / 6.0;
|
||||
return base + k_size * ksize + k_height * kheight;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file vstandardtablecell.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -37,23 +37,23 @@
|
|||
class VMeasurement
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief VStandardTableRow create empty row
|
||||
*/
|
||||
VMeasurement();
|
||||
/**
|
||||
* @brief VStandardTableRow create row
|
||||
* @param base value in base size and growth
|
||||
* @param ksize increment in sizes
|
||||
* @param kgrowth increment in growths
|
||||
* @param description description of increment
|
||||
*/
|
||||
VMeasurement(const qreal &base, const qreal &ksize, const qreal &kheight,
|
||||
const QString &gui_text = QString(), const QString &number = QString(),
|
||||
const QString &TagName = QString());
|
||||
VMeasurement(const qreal &base, const QString &gui_text = QString(),
|
||||
const QString &number = QString(), const QString &TagName = QString());
|
||||
~VMeasurement(){}
|
||||
/**
|
||||
* @brief VStandardTableRow create empty row
|
||||
*/
|
||||
VMeasurement();
|
||||
/**
|
||||
* @brief VStandardTableRow create row
|
||||
* @param base value in base size and growth
|
||||
* @param ksize increment in sizes
|
||||
* @param kgrowth increment in growths
|
||||
* @param description description of increment
|
||||
*/
|
||||
VMeasurement(const qreal &base, const qreal &ksize, const qreal &kheight,
|
||||
const QString &gui_text = QString(), const QString &number = QString(),
|
||||
const QString &TagName = QString());
|
||||
VMeasurement(const qreal &base, const QString &gui_text = QString(),
|
||||
const QString &number = QString(), const QString &TagName = QString());
|
||||
~VMeasurement(){}
|
||||
/**
|
||||
* @brief GetBase return value in base size and growth
|
||||
* @return value
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file configdialog.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 12 2, 2014
|
||||
**
|
||||
** @brief
|
||||
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "configdialog.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
ConfigDialog::ConfigDialog(QWidget *parent) :
|
||||
QDialog(parent), contentsWidget(nullptr), pagesWidget(nullptr), configurationPage(nullptr), patternPage(nullptr)
|
||||
{
|
||||
|
@ -76,6 +77,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) :
|
|||
setWindowTitle(tr("Config Dialog"));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
|
||||
{
|
||||
if (current == false)
|
||||
|
@ -85,6 +87,7 @@ void ConfigDialog::changePage(QListWidgetItem *current, QListWidgetItem *previou
|
|||
pagesWidget->setCurrentIndex(contentsWidget->row(current));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (result() == QDialog::Accepted)
|
||||
|
@ -94,6 +97,7 @@ void ConfigDialog::closeEvent(QCloseEvent *event)
|
|||
event->accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::createIcons()
|
||||
{
|
||||
QListWidgetItem *configButton = new QListWidgetItem(contentsWidget);
|
||||
|
@ -111,6 +115,7 @@ void ConfigDialog::createIcons()
|
|||
connect(contentsWidget, &QListWidget::currentItemChanged, this, &ConfigDialog::changePage);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::Apply()
|
||||
{
|
||||
switch (contentsWidget->currentRow())
|
||||
|
@ -127,6 +132,7 @@ void ConfigDialog::Apply()
|
|||
setResult(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::Ok()
|
||||
{
|
||||
Apply();
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file configdialog.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 12 2, 2014
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialoghistory.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -38,6 +38,7 @@
|
|||
#include <QDebug>
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogHistory), doc(doc), cursorRow(0),
|
||||
cursorToolRecordRow(0)
|
||||
|
@ -55,11 +56,13 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
|||
ShowPoint();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogHistory::~DialogHistory()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::DialogAccepted()
|
||||
{
|
||||
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
|
||||
|
@ -68,6 +71,7 @@ void DialogHistory::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::cellClicked(int row, int column)
|
||||
{
|
||||
if (column == 0)
|
||||
|
@ -96,6 +100,7 @@ void DialogHistory::cellClicked(int row, int column)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::ChangedCursor(quint32 id)
|
||||
{
|
||||
for (qint32 i = 0; i< ui->tableWidget->rowCount(); ++i)
|
||||
|
@ -112,12 +117,14 @@ void DialogHistory::ChangedCursor(quint32 id)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::UpdateHistory()
|
||||
{
|
||||
FillTable();
|
||||
InitialTable();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::FillTable()
|
||||
{
|
||||
ui->tableWidget->clear();
|
||||
|
@ -165,6 +172,7 @@ void DialogHistory::FillTable()
|
|||
ui->tableWidget->verticalHeader()->setDefaultSectionSize(20);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString DialogHistory::Record(const VToolRecord &tool)
|
||||
{
|
||||
const QDomElement domElement = doc->elementById(QString().setNum(tool.getId()));
|
||||
|
@ -407,6 +415,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
return QString();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::InitialTable()
|
||||
{
|
||||
ui->tableWidget->setSortingEnabled(false);
|
||||
|
@ -414,6 +423,7 @@ void DialogHistory::InitialTable()
|
|||
ui->tableWidget->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Tool")));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::ShowPoint()
|
||||
{
|
||||
QVector<VToolRecord> *history = doc->getHistory();
|
||||
|
@ -428,6 +438,7 @@ void DialogHistory::ShowPoint()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialoghistory.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogincrements.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -40,6 +40,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogIncrements), data(data), doc(doc), row(0), column(0), m(nullptr)
|
||||
{
|
||||
|
@ -54,7 +55,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
m = new VIndividualMeasurements(data);
|
||||
m->setContent(filePath);
|
||||
}
|
||||
catch(VException &e)
|
||||
catch (VException &e)
|
||||
{
|
||||
e.CriticalMessageBox(tr("File error."), this);
|
||||
emit DialogClosed(QDialog::Rejected);
|
||||
|
@ -101,8 +102,8 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
ui->lineEditGivenName->setText(m->GivenName());
|
||||
ui->lineEditFamilyName->setText(m->FamilyName());
|
||||
|
||||
ui->comboBoxSex->addItem(tr("male"),QVariant(m->GenderToStr(VIndividualMeasurements::Male)));
|
||||
ui->comboBoxSex->addItem(tr("female"),QVariant(m->GenderToStr(VIndividualMeasurements::Female)));
|
||||
ui->comboBoxSex->addItem(tr("male"), QVariant(m->GenderToStr(VIndividualMeasurements::Male)));
|
||||
ui->comboBoxSex->addItem(tr("female"), QVariant(m->GenderToStr(VIndividualMeasurements::Female)));
|
||||
qint32 index = ui->comboBoxSex->findData(m->GenderToStr(m->Sex()));
|
||||
if (index != -1)
|
||||
{
|
||||
|
@ -135,6 +136,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
connect(ui->toolButtonOpenMeasurements, &QToolButton::clicked, this, &DialogIncrements::OpenTable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillMeasurements()
|
||||
{
|
||||
const QHash<QString, VMeasurement> *table = data->DataMeasurements();
|
||||
|
@ -212,6 +214,7 @@ void DialogIncrements::FillMeasurements()
|
|||
ui->tableWidgetMeasurements->resizeRowsToContents();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillIncrements()
|
||||
{
|
||||
const QHash<QString, VIncrement> *increments = data->DataIncrements();
|
||||
|
@ -279,6 +282,7 @@ void DialogIncrements::FillIncrements()
|
|||
ui->tableWidgetIncrement->setCurrentCell( row, column );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillLengthLines()
|
||||
{
|
||||
const QHash<QString, qreal> *linesTable = data->DataLengthLines();
|
||||
|
@ -314,6 +318,7 @@ void DialogIncrements::FillLengthLines()
|
|||
ui->tableWidgetLines->verticalHeader()->setDefaultSectionSize(20);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillLengthSplines()
|
||||
{
|
||||
const QHash<QString, qreal> *splinesTable = data->DataLengthSplines();
|
||||
|
@ -349,6 +354,7 @@ void DialogIncrements::FillLengthSplines()
|
|||
ui->tableWidgetSplines->verticalHeader()->setDefaultSectionSize(20);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillLengthArcs()
|
||||
{
|
||||
const QHash<QString, qreal> *arcsTable = data->DataLengthArcs();
|
||||
|
@ -384,6 +390,7 @@ void DialogIncrements::FillLengthArcs()
|
|||
ui->tableWidgetArcs->resizeRowsToContents();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FullUpdateFromFile()
|
||||
{
|
||||
disconnect(ui->tableWidgetMeasurements, &QTableWidget::cellChanged, this, &DialogIncrements::MeasurementChanged);
|
||||
|
@ -406,6 +413,7 @@ void DialogIncrements::FullUpdateFromFile()
|
|||
FillLengthArcs();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveGivenName()
|
||||
{
|
||||
m->setGivenName(ui->lineEditGivenName->text());
|
||||
|
@ -415,6 +423,7 @@ void DialogIncrements::SaveGivenName()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveFamilyName()
|
||||
{
|
||||
|
||||
|
@ -425,6 +434,7 @@ void DialogIncrements::SaveFamilyName()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveEmail()
|
||||
{
|
||||
m->setMail(ui->lineEditMail->text());
|
||||
|
@ -434,6 +444,7 @@ void DialogIncrements::SaveEmail()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveSex(int index)
|
||||
{
|
||||
m->setSex(m->StrToGender(ui->comboBoxSex->itemData(index).toString()));
|
||||
|
@ -443,6 +454,7 @@ void DialogIncrements::SaveSex(int index)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveBirthDate(const QDate & date)
|
||||
{
|
||||
m->setBirthDate(date);
|
||||
|
@ -452,6 +464,7 @@ void DialogIncrements::SaveBirthDate(const QDate & date)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::OpenTable()
|
||||
{
|
||||
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
|
||||
|
@ -473,7 +486,7 @@ void DialogIncrements::OpenTable()
|
|||
m1 = new VIndividualMeasurements(data);
|
||||
m1->setContent(filePath);
|
||||
}
|
||||
catch(VException &e)
|
||||
catch (VException &e)
|
||||
{
|
||||
e.CriticalMessageBox(tr("File error."), this);
|
||||
delete m1;
|
||||
|
@ -529,7 +542,7 @@ void DialogIncrements::OpenTable()
|
|||
doc->SetPath(filePath);
|
||||
emit haveLiteChange();
|
||||
}
|
||||
catch(VException &e)
|
||||
catch (VException &e)
|
||||
{
|
||||
e.CriticalMessageBox(tr("File error."), this);
|
||||
delete m1;
|
||||
|
@ -539,6 +552,7 @@ void DialogIncrements::OpenTable()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::clickedToolButtonAdd()
|
||||
{
|
||||
ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason);
|
||||
|
@ -599,6 +613,7 @@ void DialogIncrements::clickedToolButtonAdd()
|
|||
emit haveLiteChange();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::clickedToolButtonRemove()
|
||||
{
|
||||
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
|
||||
|
@ -624,6 +639,7 @@ void DialogIncrements::clickedToolButtonRemove()
|
|||
emit haveLiteChange();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, const qreal &ksize,
|
||||
const qreal &kheight, const QString &description)
|
||||
{
|
||||
|
@ -640,6 +656,7 @@ void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name
|
|||
list.at(0).appendChild(element);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::IncrementChanged ( qint32 row, qint32 column )
|
||||
{
|
||||
|
||||
|
@ -694,6 +711,7 @@ void DialogIncrements::IncrementChanged ( qint32 row, qint32 column )
|
|||
emit haveLiteChange();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
|
||||
{
|
||||
switch (column)
|
||||
|
@ -740,12 +758,14 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
emit DialogClosed(QDialog::Accepted);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogIncrements::~DialogIncrements()
|
||||
{
|
||||
delete ui;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogincrements.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogindividualmeasurements.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 22 2, 2014
|
||||
**
|
||||
** @brief
|
||||
|
@ -36,6 +36,7 @@
|
|||
#include "../../widgets/vapplication.h"
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, const QString &patternPieceName,
|
||||
QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogIndividualMeasurements), _name(patternPieceName), _tablePath(QString()),
|
||||
|
@ -67,11 +68,13 @@ DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, con
|
|||
connect(ui->toolButtonOpenNew, &QToolButton::clicked, this, &DialogIndividualMeasurements::NewTable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogIndividualMeasurements::~DialogIndividualMeasurements()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::DialogAccepted()
|
||||
{
|
||||
_name = ui->lineEditName->text();
|
||||
|
@ -116,7 +119,7 @@ void DialogIndividualMeasurements::DialogAccepted()
|
|||
iMeasur.close();
|
||||
}
|
||||
}
|
||||
catch(VException &e)
|
||||
catch (VException &e)
|
||||
{
|
||||
e.CriticalMessageBox(tr("File error."), this);
|
||||
qDebug()<<"File error."<<e.ErrorMessage()<<e.DetailedInformation()<<Q_FUNC_INFO;
|
||||
|
@ -125,6 +128,7 @@ void DialogIndividualMeasurements::DialogAccepted()
|
|||
accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::DialogRejected()
|
||||
{
|
||||
_name.clear();
|
||||
|
@ -132,6 +136,7 @@ void DialogIndividualMeasurements::DialogRejected()
|
|||
reject();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::CheckState()
|
||||
{
|
||||
bool flagName = false;
|
||||
|
@ -187,6 +192,7 @@ void DialogIndividualMeasurements::CheckState()
|
|||
bOk->setEnabled(flagName && flagPath && flagLang);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::LoadIndividualTables()
|
||||
{
|
||||
QStringList filters;
|
||||
|
@ -214,7 +220,7 @@ void DialogIndividualMeasurements::LoadIndividualTables()
|
|||
const QString lang = QLocale(m.Language()).nativeLanguageName();
|
||||
ui->comboBoxLang->addItem(lang, QVariant(fi.absoluteFilePath()));
|
||||
}
|
||||
catch(VException &e)
|
||||
catch (VException &e)
|
||||
{
|
||||
qDebug()<<"File error."<<e.ErrorMessage()<<e.DetailedInformation()<<Q_FUNC_INFO;
|
||||
continue;
|
||||
|
@ -236,6 +242,7 @@ void DialogIndividualMeasurements::LoadIndividualTables()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::OpenTable()
|
||||
{
|
||||
const QString filter(tr("Individual measurements (*.vit)"));
|
||||
|
@ -249,7 +256,7 @@ void DialogIndividualMeasurements::OpenTable()
|
|||
{
|
||||
VDomDocument::ValidateXML("://schema/individual_measurements.xsd", fileName);
|
||||
}
|
||||
catch(VException &e)
|
||||
catch (VException &e)
|
||||
{
|
||||
e.CriticalMessageBox(tr("File error."), this);
|
||||
fileName.clear();
|
||||
|
@ -259,6 +266,7 @@ void DialogIndividualMeasurements::OpenTable()
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::NewTable()
|
||||
{
|
||||
QString dir = QDir::homePath()+"/measurements.vit";
|
||||
|
@ -281,6 +289,7 @@ void DialogIndividualMeasurements::NewTable()
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::InitUnits()
|
||||
{
|
||||
ui->comboBoxUnits->addItem(tr("centimeter"), QVariant(VDomDocument::UnitsToStr(Valentina::Cm)));
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogindividualmeasurements.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 22 2, 2014
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogpatterntype.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 21 2, 2014
|
||||
**
|
||||
** @brief
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include "dialogmeasurements.h"
|
||||
#include "ui_dialogmeasurements.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogMeasurements::DialogMeasurements(QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogMeasurements), result(Measurements::Individual)
|
||||
{
|
||||
|
@ -37,22 +38,26 @@ DialogMeasurements::DialogMeasurements(QWidget *parent) :
|
|||
connect(ui->toolButtonIndividual, &QToolButton::clicked, this, &DialogMeasurements::IndividualMeasurements);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogMeasurements::~DialogMeasurements()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
Measurements::Type DialogMeasurements::type() const
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogMeasurements::StandardMeasurements()
|
||||
{
|
||||
result = Measurements::Standard;
|
||||
accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogMeasurements::IndividualMeasurements()
|
||||
{
|
||||
result = Measurements::Individual;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogpatterntype.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 21 2, 2014
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogpatternproperties.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 18 2, 2014
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
#include <QSettings>
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogPatternProperties), doc(doc)
|
||||
{
|
||||
|
@ -61,11 +62,13 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent)
|
|||
connect(this, &DialogPatternProperties::haveChange, this->doc, &VPattern::haveLiteChange);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPatternProperties::~DialogPatternProperties()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPatternProperties::Apply()
|
||||
{
|
||||
Write("notes", ui->plainTextEditTechNotes->document()->toPlainText());
|
||||
|
@ -75,6 +78,7 @@ void DialogPatternProperties::Apply()
|
|||
close();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPatternProperties::Write(const QString &tagName, const QString &text) const
|
||||
{
|
||||
QDomNodeList nodeList = doc->elementsByTagName(tagName);
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogpatternproperties.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 18 2, 2014
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogstandardmeasurements.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 21 2, 2014
|
||||
**
|
||||
** @brief
|
||||
|
@ -33,6 +33,7 @@
|
|||
#include "../../widgets/vapplication.h"
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const QString &patternPieceName,
|
||||
QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogStandardMeasurements), data(data), _name(patternPieceName), _tablePath(QString())
|
||||
|
@ -58,21 +59,25 @@ DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const Q
|
|||
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogStandardMeasurements::CheckState);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogStandardMeasurements::~DialogStandardMeasurements()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString DialogStandardMeasurements::name() const
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString DialogStandardMeasurements::tablePath() const
|
||||
{
|
||||
return _tablePath;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogStandardMeasurements::DialogAccepted()
|
||||
{
|
||||
_name = ui->lineEditName->text();
|
||||
|
@ -86,7 +91,7 @@ void DialogStandardMeasurements::DialogAccepted()
|
|||
m.setContent(_tablePath);
|
||||
qApp->setPatternUnit(m.Unit());
|
||||
}
|
||||
catch(VException &e)
|
||||
catch (VException &e)
|
||||
{
|
||||
e.CriticalMessageBox(tr("File error."), this);
|
||||
qDebug()<<"File error."<<e.ErrorMessage()<<e.DetailedInformation()<<Q_FUNC_INFO;
|
||||
|
@ -96,6 +101,7 @@ void DialogStandardMeasurements::DialogAccepted()
|
|||
accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogStandardMeasurements::DialogRejected()
|
||||
{
|
||||
_name.clear();
|
||||
|
@ -103,6 +109,7 @@ void DialogStandardMeasurements::DialogRejected()
|
|||
reject();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogStandardMeasurements::CheckState()
|
||||
{
|
||||
bool flagName = false;
|
||||
|
@ -126,6 +133,7 @@ void DialogStandardMeasurements::CheckState()
|
|||
bOk->setEnabled(flagTable && flagName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogStandardMeasurements::LoadStandardTables()
|
||||
{
|
||||
QStringList filters;
|
||||
|
@ -152,7 +160,7 @@ void DialogStandardMeasurements::LoadStandardTables()
|
|||
m.setContent(fi.absoluteFilePath());
|
||||
ui->comboBoxTables->addItem(m.Description(), QVariant(fi.absoluteFilePath()));
|
||||
}
|
||||
catch(VException &e)
|
||||
catch (VException &e)
|
||||
{
|
||||
qDebug()<<"File error."<<e.ErrorMessage()<<e.DetailedInformation()<<Q_FUNC_INFO;
|
||||
continue;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogstandardmeasurements.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 21 2, 2014
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file pages.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 12 2, 2014
|
||||
**
|
||||
** @brief
|
||||
|
@ -30,6 +30,7 @@
|
|||
#include "../../options.h"
|
||||
#include "../../widgets/vapplication.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
ConfigurationPage::ConfigurationPage(QWidget *parent):
|
||||
QWidget(parent), autoSaveCheck(0), autoTime(0), langCombo(0), osOptionCheck(0), langChanged(false)
|
||||
{
|
||||
|
@ -43,6 +44,7 @@ ConfigurationPage::ConfigurationPage(QWidget *parent):
|
|||
setLayout(mainLayout);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigurationPage::Apply()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -61,11 +63,13 @@ void ConfigurationPage::Apply()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigurationPage::LangChenged()
|
||||
{
|
||||
langChanged = true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *ConfigurationPage::SaveGroup()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -101,6 +105,7 @@ QGroupBox *ConfigurationPage::SaveGroup()
|
|||
return saveGroup;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *ConfigurationPage::LangGroup()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -168,7 +173,7 @@ QGroupBox *ConfigurationPage::LangGroup()
|
|||
return langGroup;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
PatternPage::PatternPage(QWidget *parent):
|
||||
QWidget(parent), userName(0), graphOutputCheck(0), undoneCount(0)
|
||||
{
|
||||
|
@ -184,6 +189,7 @@ PatternPage::PatternPage(QWidget *parent):
|
|||
setLayout(mainLayout);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void PatternPage::Apply()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -193,6 +199,7 @@ void PatternPage::Apply()
|
|||
settings.setValue("pattern/undone", undoneCount->value());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *PatternPage::UserGroup()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -219,6 +226,7 @@ QGroupBox *PatternPage::UserGroup()
|
|||
return userGroup;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *PatternPage::GraphOutputGroup()
|
||||
{
|
||||
// QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -240,6 +248,7 @@ QGroupBox *PatternPage::GraphOutputGroup()
|
|||
return graphOutputGroup;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *PatternPage::UndoneGroup()
|
||||
{
|
||||
// QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file pages.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 12 2, 2014
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogs.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
90
src/app/dialogs/dialogs.pri
Normal file
90
src/app/dialogs/dialogs.pri
Normal file
|
@ -0,0 +1,90 @@
|
|||
HEADERS += \
|
||||
dialogs/dialogs.h \
|
||||
dialogs/tools/dialogtriangle.h \
|
||||
dialogs/tools/dialogtool.h \
|
||||
dialogs/tools/dialogsplinepath.h \
|
||||
dialogs/tools/dialogspline.h \
|
||||
dialogs/tools/dialogsinglepoint.h \
|
||||
dialogs/tools/dialogshoulderpoint.h \
|
||||
dialogs/tools/dialogpointofintersection.h \
|
||||
dialogs/tools/dialogpointofcontact.h \
|
||||
dialogs/tools/dialognormal.h \
|
||||
dialogs/tools/dialoglineintersect.h \
|
||||
dialogs/tools/dialogline.h \
|
||||
dialogs/tools/dialogheight.h \
|
||||
dialogs/tools/dialogendline.h \
|
||||
dialogs/tools/dialogdetail.h \
|
||||
dialogs/tools/dialogbisector.h \
|
||||
dialogs/tools/dialogarc.h \
|
||||
dialogs/tools/dialogalongline.h \
|
||||
dialogs/tools/dialogcutspline.h \
|
||||
dialogs/tools/dialogcutsplinepath.h \
|
||||
dialogs/tools/dialoguniondetails.h \
|
||||
dialogs/tools/dialogcutarc.h \
|
||||
dialogs/app/dialogincrements.h \
|
||||
dialogs/app/dialoghistory.h \
|
||||
dialogs/app/configdialog.h \
|
||||
dialogs/app/pages.h \
|
||||
dialogs/app/dialogpatternproperties.h \
|
||||
dialogs/app/dialogmeasurements.h \
|
||||
dialogs/app/dialogstandardmeasurements.h \
|
||||
dialogs/app/dialogindividualmeasurements.h
|
||||
|
||||
SOURCES += \
|
||||
dialogs/tools/dialogtriangle.cpp \
|
||||
dialogs/tools/dialogtool.cpp \
|
||||
dialogs/tools/dialogsplinepath.cpp \
|
||||
dialogs/tools/dialogspline.cpp \
|
||||
dialogs/tools/dialogsinglepoint.cpp \
|
||||
dialogs/tools/dialogshoulderpoint.cpp \
|
||||
dialogs/tools/dialogpointofintersection.cpp \
|
||||
dialogs/tools/dialogpointofcontact.cpp \
|
||||
dialogs/tools/dialognormal.cpp \
|
||||
dialogs/tools/dialoglineintersect.cpp \
|
||||
dialogs/tools/dialogline.cpp \
|
||||
dialogs/tools/dialogheight.cpp \
|
||||
dialogs/tools/dialogendline.cpp \
|
||||
dialogs/tools/dialogdetail.cpp \
|
||||
dialogs/tools/dialogbisector.cpp \
|
||||
dialogs/tools/dialogarc.cpp \
|
||||
dialogs/tools/dialogalongline.cpp \
|
||||
dialogs/tools/dialogcutspline.cpp \
|
||||
dialogs/tools/dialogcutsplinepath.cpp \
|
||||
dialogs/tools/dialoguniondetails.cpp \
|
||||
dialogs/tools/dialogcutarc.cpp \
|
||||
dialogs/app/dialogincrements.cpp \
|
||||
dialogs/app/dialoghistory.cpp \
|
||||
dialogs/app/configdialog.cpp \
|
||||
dialogs/app/pages.cpp \
|
||||
dialogs/app/dialogpatternproperties.cpp \
|
||||
dialogs/app/dialogmeasurements.cpp \
|
||||
dialogs/app/dialogstandardmeasurements.cpp \
|
||||
dialogs/app/dialogindividualmeasurements.cpp
|
||||
|
||||
FORMS += \
|
||||
dialogs/tools/dialogtriangle.ui \
|
||||
dialogs/tools/dialogsplinepath.ui \
|
||||
dialogs/tools/dialogspline.ui \
|
||||
dialogs/tools/dialogsinglepoint.ui \
|
||||
dialogs/tools/dialogshoulderpoint.ui \
|
||||
dialogs/tools/dialogpointofintersection.ui \
|
||||
dialogs/tools/dialogpointofcontact.ui \
|
||||
dialogs/tools/dialognormal.ui \
|
||||
dialogs/tools/dialoglineintersect.ui \
|
||||
dialogs/tools/dialogline.ui \
|
||||
dialogs/tools/dialogheight.ui \
|
||||
dialogs/tools/dialogendline.ui \
|
||||
dialogs/tools/dialogdetail.ui \
|
||||
dialogs/tools/dialogbisector.ui \
|
||||
dialogs/tools/dialogarc.ui \
|
||||
dialogs/tools/dialogalongline.ui \
|
||||
dialogs/tools/dialogcutspline.ui \
|
||||
dialogs/tools/dialogcutsplinepath.ui \
|
||||
dialogs/tools/dialoguniondetails.ui \
|
||||
dialogs/tools/dialogcutarc.ui \
|
||||
dialogs/app/dialogincrements.ui \
|
||||
dialogs/app/dialoghistory.ui \
|
||||
dialogs/app/dialogpatternproperties.ui \
|
||||
dialogs/app/dialogmeasurements.ui \
|
||||
dialogs/app/dialogstandardmeasurements.ui \
|
||||
dialogs/app/dialogindividualmeasurements.ui
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogalongline.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()),
|
||||
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0)
|
||||
|
@ -59,11 +60,13 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent)
|
|||
connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogTool::PutVal);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogAlongLine::~DialogAlongLine()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -90,6 +93,7 @@ void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -100,28 +104,33 @@ void DialogAlongLine::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogalongline.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogarc.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QtWidgets>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogArc::DialogArc(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false),
|
||||
timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(0), radius(QString()), f1(QString()), f2(QString())
|
||||
|
@ -68,35 +69,41 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditF2, &QLineEdit::textChanged, this, &DialogArc::F2Changed);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogArc::~DialogArc()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::SetCenter(const quint32 &value)
|
||||
{
|
||||
center = value;
|
||||
ChangeCurrentData(ui->comboBoxBasePoint, center);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::SetF2(const QString &value)
|
||||
{
|
||||
f2 = value;
|
||||
ui->lineEditF2->setText(f2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::SetF1(const QString &value)
|
||||
{
|
||||
f1 = value;
|
||||
ui->lineEditF1->setText(f1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::SetRadius(const QString &value)
|
||||
{
|
||||
radius = value;
|
||||
ui->lineEditRadius->setText(radius);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -109,6 +116,7 @@ void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::DialogAccepted()
|
||||
{
|
||||
radius = ui->lineEditRadius->text();
|
||||
|
@ -118,6 +126,7 @@ void DialogArc::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::ValChenged(int row)
|
||||
{
|
||||
if (ui->listWidget->count() == 0)
|
||||
|
@ -135,68 +144,80 @@ void DialogArc::ValChenged(int row)
|
|||
DialogTool::ValChenged(row);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::PutRadius()
|
||||
{
|
||||
PutValHere(ui->lineEditRadius, ui->listWidget);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::PutF1()
|
||||
{
|
||||
PutValHere(ui->lineEditF1, ui->listWidget);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::PutF2()
|
||||
{
|
||||
PutValHere(ui->lineEditF2, ui->listWidget);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::LineAngles()
|
||||
{
|
||||
ShowLineAngles();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::RadiusChanged()
|
||||
{
|
||||
labelEditFormula = ui->labelEditRadius;
|
||||
ValFormulaChanged(flagRadius, ui->lineEditRadius, timerRadius);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::F1Changed()
|
||||
{
|
||||
labelEditFormula = ui->labelEditF1;
|
||||
ValFormulaChanged(flagF1, ui->lineEditF1, timerF1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::F2Changed()
|
||||
{
|
||||
labelEditFormula = ui->labelEditF2;
|
||||
ValFormulaChanged(flagF2, ui->lineEditF2, timerF2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::CheckState()
|
||||
{
|
||||
Q_CHECK_PTR(bOk);
|
||||
bOk->setEnabled(flagRadius && flagF1 && flagF2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::EvalRadius()
|
||||
{
|
||||
labelEditFormula = ui->labelEditRadius;
|
||||
Eval(ui->lineEditRadius, flagRadius, timerRadius, ui->labelResultRadius);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::EvalF1()
|
||||
{
|
||||
labelEditFormula = ui->labelEditF1;
|
||||
Eval(ui->lineEditF1, flagF1, timerF1, ui->labelResultF1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::EvalF2()
|
||||
{
|
||||
labelEditFormula = ui->labelEditF2;
|
||||
Eval(ui->lineEditF2, flagF2, timerF2, ui->labelResultF2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::ShowLineAngles()
|
||||
{
|
||||
disconnect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogArc::ValChenged);
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogarc.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogbisector.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()),
|
||||
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0)
|
||||
|
@ -59,11 +60,13 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogBisector::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogBisector::~DialogBisector()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -108,39 +111,46 @@ void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setThirdPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxThirdPoint, thirdPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogbisector.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogcutarc.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 7 1, 2014
|
||||
**
|
||||
** @brief
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include "dialogcutarc.h"
|
||||
#include "ui_dialogcutarc.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent) :
|
||||
DialogTool(data, parent), ui(new Ui::DialogCutArc), pointName(QString()), formula(QString()), arcId(0)
|
||||
{
|
||||
|
@ -54,11 +55,13 @@ DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent) :
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutArc::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutArc::~DialogCutArc()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Arc)
|
||||
|
@ -70,6 +73,7 @@ void DialogCutArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -78,17 +82,20 @@ void DialogCutArc::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::setArcId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentArcId(ui->comboBoxArc, arcId, value, id, ComboMode::CutArc);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogcutarc.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 7 1, 2014
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogcutspline.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 15 12, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include "dialogcutspline.h"
|
||||
#include "ui_dialogcutspline.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0)
|
||||
{
|
||||
|
@ -53,28 +54,33 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSpline::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutSpline::~DialogCutSpline()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboMode::CutSpline);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Spline)
|
||||
|
@ -86,6 +92,7 @@ void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogcutspline.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 15 12, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogcutsplinrpath.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 15 12, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include "dialogcutsplinepath.h"
|
||||
#include "ui_dialogcutsplinepath.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogCutSplinePath), pointName(QString()), formula(QString()),
|
||||
splinePathId(0)
|
||||
|
@ -54,28 +55,33 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutSplinePath::~DialogCutSplinePath()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboMode::CutSpline);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::SplinePath)
|
||||
|
@ -87,6 +93,7 @@ void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &typ
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogcutsplinrpath.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 15 12, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogdetail.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QDebug>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(), details(VDetail()), supplement(true), closed(true)
|
||||
{
|
||||
|
@ -62,6 +63,7 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
|||
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type != Valentina::Line && type != Valentina::Detail)
|
||||
|
@ -89,6 +91,7 @@ void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::DialogAccepted()
|
||||
{
|
||||
details.Clear();
|
||||
|
@ -105,8 +108,9 @@ void DialogDetail::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode, qreal mx,
|
||||
qreal my)
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
||||
qreal mx, qreal my)
|
||||
{
|
||||
QString name;
|
||||
switch (typeTool)
|
||||
|
@ -158,6 +162,7 @@ void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const N
|
|||
this, &DialogDetail::BiasYChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::setDetails(const VDetail &value)
|
||||
{
|
||||
details = value;
|
||||
|
@ -178,6 +183,7 @@ void DialogDetail::setDetails(const VDetail &value)
|
|||
ui.toolButtonDelete->setEnabled(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::BiasXChanged(qreal d)
|
||||
{
|
||||
qint32 row = ui.listWidget->currentRow();
|
||||
|
@ -188,6 +194,7 @@ void DialogDetail::BiasXChanged(qreal d)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::BiasYChanged(qreal d)
|
||||
{
|
||||
qint32 row = ui.listWidget->currentRow();
|
||||
|
@ -198,6 +205,7 @@ void DialogDetail::BiasYChanged(qreal d)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ClickedSeams(bool checked)
|
||||
{
|
||||
supplement = checked;
|
||||
|
@ -205,11 +213,13 @@ void DialogDetail::ClickedSeams(bool checked)
|
|||
ui.spinBoxSeams->setEnabled(checked);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ClickedClosed(bool checked)
|
||||
{
|
||||
closed = checked;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ObjectChanged(int row)
|
||||
{
|
||||
if (ui.listWidget->count() == 0)
|
||||
|
@ -222,6 +232,7 @@ void DialogDetail::ObjectChanged(int row)
|
|||
ui.spinBoxBiasY->setValue(static_cast<qint32>(qApp->fromPixel(node.getMy())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::DeleteItem()
|
||||
{
|
||||
qint32 row = ui.listWidget->currentRow();
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogdetail.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogendline.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()),
|
||||
formula(QString()), angle(0), basePointId(0)
|
||||
|
@ -59,6 +60,7 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEndLine::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -70,35 +72,41 @@ void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setAngle(const qreal &value)
|
||||
{
|
||||
angle = value;
|
||||
ui->doubleSpinBoxAngle->setValue(angle);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setBasePointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxBasePoint, basePointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -109,6 +117,7 @@ void DialogEndLine::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogEndLine::~DialogEndLine()
|
||||
{
|
||||
delete ui;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogendline.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogheight.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogHeight::DialogHeight(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogHeight), number(0), pointName(QString()),
|
||||
typeLine(QString()), basePointId(0), p1LineId(0), p2LineId(0)
|
||||
|
@ -48,41 +49,48 @@ DialogHeight::DialogHeight(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogHeight::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogHeight::~DialogHeight()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setBasePointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
basePointId = value;
|
||||
setCurrentPointId(ui->comboBoxBasePoint, basePointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setP1LineId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
p1LineId = value;
|
||||
setCurrentPointId(ui->comboBoxP1Line, p1LineId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
p2LineId = value;
|
||||
setCurrentPointId(ui->comboBoxP2Line, p2LineId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -115,6 +123,7 @@ void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogheight.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogline.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLine::DialogLine(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogLine), number(0), firstPoint(0), secondPoint(0), typeLine(QString())
|
||||
{
|
||||
|
@ -44,11 +45,13 @@ DialogLine::DialogLine(const VContainer *data, QWidget *parent)
|
|||
number = 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLine::~DialogLine()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::setSecondPoint(const quint32 &value)
|
||||
{
|
||||
secondPoint = value;
|
||||
|
@ -60,12 +63,14 @@ void DialogLine::setSecondPoint(const quint32 &value)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::setFirstPoint(const quint32 &value)
|
||||
{
|
||||
firstPoint = value;
|
||||
|
@ -77,7 +82,7 @@ void DialogLine::setFirstPoint(const quint32 &value)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::DialogAccepted()
|
||||
{
|
||||
qint32 index = ui->comboBoxFirstPoint->currentIndex();
|
||||
|
@ -88,6 +93,7 @@ void DialogLine::DialogAccepted()
|
|||
DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogline.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialoglineintersect.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLineIntersect::DialogLineIntersect(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogLineIntersect), number(0), pointName(QString()),
|
||||
p1Line1(0), p2Line1(0), p1Line2(0), p2Line2(0), flagPoint(true)
|
||||
|
@ -49,11 +50,13 @@ DialogLineIntersect::DialogLineIntersect(const VContainer *data, QWidget *parent
|
|||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogLineIntersect::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLineIntersect::~DialogLineIntersect()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -127,6 +130,7 @@ void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &typ
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -137,6 +141,7 @@ void DialogLineIntersect::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::P1Line1Changed( int index)
|
||||
{
|
||||
p1Line1 = qvariant_cast<quint32>(ui->comboBoxP1Line1->itemData(index));
|
||||
|
@ -144,6 +149,7 @@ void DialogLineIntersect::P1Line1Changed( int index)
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::P2Line1Changed(int index)
|
||||
{
|
||||
p2Line1 = qvariant_cast<quint32>(ui->comboBoxP2Line1->itemData(index));
|
||||
|
@ -151,6 +157,7 @@ void DialogLineIntersect::P2Line1Changed(int index)
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::P1Line2Changed(int index)
|
||||
{
|
||||
p1Line2 = qvariant_cast<quint32>(ui->comboBoxP1Line2->itemData(index));
|
||||
|
@ -158,6 +165,7 @@ void DialogLineIntersect::P1Line2Changed(int index)
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::P2Line2Changed(int index)
|
||||
{
|
||||
p2Line2 = qvariant_cast<quint32>(ui->comboBoxP2Line2->itemData(index));
|
||||
|
@ -165,12 +173,14 @@ void DialogLineIntersect::P2Line2Changed(int index)
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::CheckState()
|
||||
{
|
||||
Q_CHECK_PTR(bOk);
|
||||
bOk->setEnabled(flagName && flagPoint);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool DialogLineIntersect::CheckIntersecion()
|
||||
{
|
||||
const VPointF *p1L1 = data->GeometricObject<const VPointF *>(p1Line1);
|
||||
|
@ -192,30 +202,35 @@ bool DialogLineIntersect::CheckIntersecion()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setP2Line2(const quint32 &value)
|
||||
{
|
||||
p2Line2 = value;
|
||||
ChangeCurrentData(ui->comboBoxP2Line2, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setP1Line2(const quint32 &value)
|
||||
{
|
||||
p1Line2 = value;
|
||||
ChangeCurrentData(ui->comboBoxP1Line2, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setP2Line1(const quint32 &value)
|
||||
{
|
||||
p2Line1 = value;
|
||||
ChangeCurrentData(ui->comboBoxP2Line1, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setP1Line1(const quint32 &value)
|
||||
{
|
||||
p1Line1 = value;
|
||||
ChangeCurrentData(ui->comboBoxP1Line1, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialoglineintersect.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialognormal.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogNormal::DialogNormal(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()),
|
||||
typeLine(QString()), formula(QString()), angle(0), firstPointId(0), secondPointId(0)
|
||||
|
@ -60,11 +61,13 @@ DialogNormal::DialogNormal(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogNormal::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogNormal::~DialogNormal()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -91,6 +94,7 @@ void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -102,34 +106,40 @@ void DialogNormal::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setAngle(const qreal &value)
|
||||
{
|
||||
angle = value;
|
||||
ui->doubleSpinBoxAngle->setValue(angle);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialognormal.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogpointofcontact.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(), number(0), pointName(QString()), radius(QString()), center(0),
|
||||
firstPoint(0), secondPoint(0)
|
||||
|
@ -87,6 +88,7 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
|
|||
connect(ui.lineEditFormula, &QLineEdit::textChanged, this, &DialogPointOfContact::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -131,6 +133,7 @@ void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &ty
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::DialogAccepted()
|
||||
{
|
||||
pointName = ui.lineEditNamePoint->text();
|
||||
|
@ -141,28 +144,33 @@ void DialogPointOfContact::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setSecondPoint(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui.comboBoxSecondPoint, secondPoint, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setFirstPoint(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui.comboBoxFirstPoint, firstPoint, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setCenter(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui.comboBoxCenter, center, value, id);
|
||||
center = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setRadius(const QString &value)
|
||||
{
|
||||
radius = value;
|
||||
ui.lineEditFormula->setText(radius);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogpointofcontact.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogpointofintersection.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogPointOfIntersection), number(0), pointName(QString()),
|
||||
firstPointId(0), secondPointId(0)
|
||||
|
@ -47,17 +48,20 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, QWi
|
|||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersection::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPointOfIntersection::~DialogPointOfIntersection()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
secondPointId = value;
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -91,6 +95,7 @@ void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scene
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -99,12 +104,14 @@ void DialogPointOfIntersection::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
firstPointId = value;
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogpointofintersection.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogshoulderpoint.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()),
|
||||
typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0)
|
||||
|
@ -60,11 +61,13 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogShoulderPoint::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogShoulderPoint::~DialogShoulderPoint()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -109,6 +112,7 @@ void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &typ
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -120,33 +124,39 @@ void DialogShoulderPoint::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setPShoulder(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxPShoulder, pShoulder, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setP2Line(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxP2Line, p2Line, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setP1Line(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxP1Line, p1Line, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogshoulderpoint.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogsinglepoint.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogSinglePoint), name(QString()),
|
||||
point(QPointF())
|
||||
|
@ -47,6 +48,7 @@ DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogSinglePoint::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSinglePoint::mousePress(const QPointF &scenePos)
|
||||
{
|
||||
if (isInitialized == false)
|
||||
|
@ -62,6 +64,7 @@ void DialogSinglePoint::mousePress(const QPointF &scenePos)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSinglePoint::DialogAccepted()
|
||||
{
|
||||
point = QPointF(qApp->toPixel(ui->doubleSpinBoxX->value()), qApp->toPixel(ui->doubleSpinBoxY->value()));
|
||||
|
@ -69,6 +72,7 @@ void DialogSinglePoint::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSinglePoint::setData(const QString &name, const QPointF &point)
|
||||
{
|
||||
this->name = name;
|
||||
|
@ -79,6 +83,7 @@ void DialogSinglePoint::setData(const QString &name, const QPointF &point)
|
|||
ui->doubleSpinBoxY->setValue(qApp->fromPixel(point.y()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSinglePoint::~DialogSinglePoint()
|
||||
{
|
||||
delete ui;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogsinglepoint.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogspline.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSpline::DialogSpline(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0),
|
||||
kAsm1(1), kAsm2(1), kCurve(1)
|
||||
|
@ -42,16 +43,19 @@ DialogSpline::DialogSpline(const VContainer *data, QWidget *parent)
|
|||
FillComboBoxPoints(ui->comboBoxP4);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSpline::~DialogSpline()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 DialogSpline::getP1() const
|
||||
{
|
||||
return p1;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -93,6 +97,7 @@ void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::DialogAccepted()
|
||||
{
|
||||
p1 = getCurrentObjectId(ui->comboBoxP1);
|
||||
|
@ -105,48 +110,56 @@ void DialogSpline::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setKCurve(const qreal &value)
|
||||
{
|
||||
kCurve = value;
|
||||
ui->doubleSpinBoxKcurve->setValue(value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setKAsm2(const qreal &value)
|
||||
{
|
||||
kAsm2 = value;
|
||||
ui->doubleSpinBoxKasm2->setValue(value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setKAsm1(const qreal &value)
|
||||
{
|
||||
kAsm1 = value;
|
||||
ui->doubleSpinBoxKasm1->setValue(value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setAngle2(const qreal &value)
|
||||
{
|
||||
angle2 = value;
|
||||
ui->spinBoxAngle2->setValue(static_cast<qint32>(value));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setAngle1(const qreal &value)
|
||||
{
|
||||
angle1 = value;
|
||||
ui->spinBoxAngle1->setValue(static_cast<qint32>(value));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setP4(const quint32 &value)
|
||||
{
|
||||
p4 = value;
|
||||
ChangeCurrentData(ui->comboBoxP4, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setP1(const quint32 &value)
|
||||
{
|
||||
p1 = value;
|
||||
ChangeCurrentData(ui->comboBoxP1, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 DialogSpline::getP4() const
|
||||
{
|
||||
return p4;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogspline.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogsplinepath.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSplinePath::DialogSplinePath(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogSplinePath), path(VSplinePath())
|
||||
{
|
||||
|
@ -54,11 +55,13 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, QWidget *parent)
|
|||
this, &DialogSplinePath::KAsm2Changed);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSplinePath::~DialogSplinePath()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::SetPath(const VSplinePath &value)
|
||||
{
|
||||
this->path = value;
|
||||
|
@ -71,7 +74,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
|
|||
ui->doubleSpinBoxKcurve->setValue(path.getKCurve());
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -82,6 +85,7 @@ void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::DialogAccepted()
|
||||
{
|
||||
path.Clear();
|
||||
|
@ -95,6 +99,7 @@ void DialogSplinePath::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::PointChanged(int row)
|
||||
{
|
||||
if (ui->listWidget->count() == 0)
|
||||
|
@ -107,6 +112,7 @@ void DialogSplinePath::PointChanged(int row)
|
|||
EnableFields();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::currentPointChanged(int index)
|
||||
{
|
||||
quint32 id = qvariant_cast<quint32>(ui->comboBoxPoint->itemData(index));
|
||||
|
@ -120,6 +126,7 @@ void DialogSplinePath::currentPointChanged(int index)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::Angle1Changed(qreal index)
|
||||
{
|
||||
qint32 row = ui->listWidget->currentRow();
|
||||
|
@ -131,6 +138,7 @@ void DialogSplinePath::Angle1Changed(qreal index)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::Angle2Changed(qreal index)
|
||||
{
|
||||
qint32 row = ui->listWidget->currentRow();
|
||||
|
@ -142,6 +150,7 @@ void DialogSplinePath::Angle2Changed(qreal index)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::KAsm1Changed(qreal d)
|
||||
{
|
||||
qint32 row = ui->listWidget->currentRow();
|
||||
|
@ -151,6 +160,7 @@ void DialogSplinePath::KAsm1Changed(qreal d)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::KAsm2Changed(qreal d)
|
||||
{
|
||||
qint32 row = ui->listWidget->currentRow();
|
||||
|
@ -160,6 +170,7 @@ void DialogSplinePath::KAsm2Changed(qreal d)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
|
@ -178,6 +189,7 @@ void DialogSplinePath::NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm
|
|||
EnableFields();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
||||
{
|
||||
disconnect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
|
@ -209,6 +221,7 @@ void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kA
|
|||
this, &DialogSplinePath::KAsm2Changed);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::EnableFields()
|
||||
{
|
||||
ui->doubleSpinBoxKasm1->setEnabled(true);
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogsplinepath.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogtool.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <QtWidgets>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogTool::DialogTool(const VContainer *data, QWidget *parent)
|
||||
:QDialog(parent), data(data), isInitialized(false), flagName(true), flagFormula(true), timerFormula(nullptr),
|
||||
bOk(nullptr), spinBoxAngle(nullptr), lineEditFormula(nullptr), listWidget(nullptr),
|
||||
|
@ -51,12 +52,14 @@ DialogTool::DialogTool(const VContainer *data, QWidget *parent)
|
|||
setWindowFlags(flags | Qt::WindowStaysOnTopHint);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
DialogClosed(QDialog::Rejected);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::showEvent(QShowEvent *event)
|
||||
{
|
||||
QDialog::showEvent( event );
|
||||
|
@ -71,6 +74,7 @@ void DialogTool::showEvent(QShowEvent *event)
|
|||
isInitialized = true;//first show windows are held
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -93,6 +97,7 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const
|
|||
FillList(box, list);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutArc cut) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -130,6 +135,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
|||
FillList(box, list);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -167,6 +173,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
|||
FillList(box, list);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -204,6 +211,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb
|
|||
FillList(box, list);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxTypeLine(QComboBox *box) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -211,6 +219,7 @@ void DialogTool::FillComboBoxTypeLine(QComboBox *box) const
|
|||
box->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString DialogTool::GetTypeLine(const QComboBox *box) const
|
||||
{
|
||||
switch (lineStyles.indexOf(box->currentText()))
|
||||
|
@ -239,6 +248,7 @@ QString DialogTool::GetTypeLine(const QComboBox *box) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::SetupTypeLine(QComboBox *box, const QString &value)
|
||||
{
|
||||
QStringList styles = VAbstractTool::Styles();
|
||||
|
@ -249,6 +259,7 @@ void DialogTool::SetupTypeLine(QComboBox *box, const QString &value)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ChangeCurrentText(QComboBox *box, const QString &value)
|
||||
{
|
||||
qint32 index = box->findText(value);
|
||||
|
@ -262,6 +273,7 @@ void DialogTool::ChangeCurrentText(QComboBox *box, const QString &value)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const
|
||||
{
|
||||
qint32 index = box->findData(value);
|
||||
|
@ -271,6 +283,7 @@ void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
|
||||
{
|
||||
Q_CHECK_PTR(lineEdit);
|
||||
|
@ -283,6 +296,7 @@ void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
|
|||
lineEdit->setCursorPosition(pos + item->text().size());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer)
|
||||
{
|
||||
Q_CHECK_PTR(edit);
|
||||
|
@ -300,6 +314,7 @@ void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer)
|
|||
timer->start(1000);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
||||
{
|
||||
Q_CHECK_PTR(edit);
|
||||
|
@ -335,6 +350,7 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
|||
labelEditFormula->setPalette(palette);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -343,6 +359,7 @@ void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint
|
|||
ChangeCurrentData(box, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
||||
ComboMode::ComboBoxCutSpline cut) const
|
||||
{
|
||||
|
@ -352,6 +369,7 @@ void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const qui
|
|||
ChangeCurrentData(box, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
||||
ComboMode::ComboBoxCutArc cut) const
|
||||
{
|
||||
|
@ -361,6 +379,7 @@ void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &
|
|||
ChangeCurrentData(box, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
||||
const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||
{
|
||||
|
@ -370,6 +389,7 @@ void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, c
|
|||
ChangeCurrentData(box, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 DialogTool::getCurrentObjectId(QComboBox *box) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -385,6 +405,7 @@ quint32 DialogTool::getCurrentObjectId(QComboBox *box) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool DialogTool::ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip)
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -400,6 +421,7 @@ bool DialogTool::ChoosedPoint(const quint32 &id, QComboBox *box, const QString &
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillList(QComboBox *box, const QMap<QString, quint32> &list) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -413,18 +435,21 @@ void DialogTool::FillList(QComboBox *box, const QMap<QString, quint32> &list) co
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::CheckState()
|
||||
{
|
||||
Q_CHECK_PTR(bOk);
|
||||
bOk->setEnabled(flagFormula && flagName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
Q_UNUSED(id);
|
||||
Q_UNUSED(type);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::NamePointChanged()
|
||||
{
|
||||
Q_CHECK_PTR(labelEditNamePoint);
|
||||
|
@ -450,16 +475,19 @@ void DialogTool::NamePointChanged()
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::DialogAccepted()
|
||||
{
|
||||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::DialogRejected()
|
||||
{
|
||||
emit DialogClosed(QDialog::Rejected);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FormulaChanged()
|
||||
{
|
||||
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
|
||||
|
@ -469,54 +497,63 @@ void DialogTool::FormulaChanged()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowUp()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(90);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowDown()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(270);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowLeft()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(180);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowRight()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowLeftUp()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(135);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowLeftDown()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(225);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowRightUp()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(45);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowRightDown()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(315);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::EvalFormula()
|
||||
{
|
||||
Q_CHECK_PTR(lineEditFormula);
|
||||
|
@ -524,6 +561,7 @@ void DialogTool::EvalFormula()
|
|||
Eval(lineEditFormula, flagFormula, timerFormula, labelResultCalculation);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::SizeHeight()
|
||||
{
|
||||
Q_CHECK_PTR(listWidget);
|
||||
|
@ -544,36 +582,43 @@ void DialogTool::SizeHeight()
|
|||
listWidget->setCurrentRow (0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::Measurements()
|
||||
{
|
||||
ShowVariable(data->DataMeasurements());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::LengthLines()
|
||||
{
|
||||
ShowVariable(data->DataLengthLines());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::LengthArcs()
|
||||
{
|
||||
ShowVariable(data->DataLengthArcs());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::LengthCurves()
|
||||
{
|
||||
ShowVariable(data->DataLengthSplines());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::Increments()
|
||||
{
|
||||
ShowVariable(data->DataIncrements());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::PutHere()
|
||||
{
|
||||
PutValHere(lineEditFormula, listWidget);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::PutVal(QListWidgetItem *item)
|
||||
{
|
||||
Q_CHECK_PTR(lineEditFormula);
|
||||
|
@ -585,6 +630,7 @@ void DialogTool::PutVal(QListWidgetItem *item)
|
|||
lineEditFormula->setCursorPosition(pos + item->text().size());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ValChenged(int row)
|
||||
{
|
||||
Q_CHECK_PTR(listWidget);
|
||||
|
@ -653,6 +699,7 @@ void DialogTool::ValChenged(int row)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::UpdateList()
|
||||
{
|
||||
Q_CHECK_PTR(radioButtonSizeGrowth);
|
||||
|
@ -688,6 +735,7 @@ void DialogTool::UpdateList()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <class key, class val>
|
||||
void DialogTool::ShowVariable(const QHash<key, val> *var)
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogtool.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogtriangle.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogTriangle::DialogTriangle(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogTriangle), number(0), pointName(QString()), axisP1Id(0),
|
||||
axisP2Id(0), firstPointId(0), secondPointId(0)
|
||||
|
@ -49,11 +50,13 @@ DialogTriangle::DialogTriangle(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogTriangle::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogTriangle::~DialogTriangle()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -91,6 +94,7 @@ void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -101,30 +105,35 @@ void DialogTriangle::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
secondPointId = value;
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
firstPointId = value;
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setAxisP2Id(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
axisP2Id = value;
|
||||
setCurrentPointId(ui->comboBoxAxisP2, axisP2Id, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setAxisP1Id(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
axisP1Id = value;
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialogtriangle.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date November 15, 2013
|
||||
**
|
||||
** @brief
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialoguniondetails.cpp
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 23 12, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include "dialoguniondetails.h"
|
||||
#include "ui_dialoguniondetails.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogUnionDetails::DialogUnionDetails(const VContainer *data, QWidget *parent) :
|
||||
DialogTool(data, parent), ui(new Ui::DialogUnionDetails), indexD1(0), indexD2(0), d1(0), d2(0), numberD(0),
|
||||
numberP(0), p1(0), p2(0)
|
||||
|
@ -37,11 +38,13 @@ DialogUnionDetails::DialogUnionDetails(const VContainer *data, QWidget *parent)
|
|||
InitOkCansel(ui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogUnionDetails::~DialogUnionDetails()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (numberD == 0)
|
||||
|
@ -54,11 +57,13 @@ void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogUnionDetails::DialogAccepted()
|
||||
{
|
||||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail) const
|
||||
{
|
||||
if (idDetail == 0)
|
||||
|
@ -69,6 +74,7 @@ bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail)
|
|||
return det.Containes(id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
||||
ptrdiff_t &index)
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************
|
||||
**
|
||||
** @file dialoguniondetails.h
|
||||
** @author Roman Telezhinsky <dismine@gmail.com>
|
||||
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||
** @date 23 12, 2013
|
||||
**
|
||||
** @brief
|
||||
|
@ -133,7 +133,8 @@ private:
|
|||
* @param idDetail id detail
|
||||
* @param index index of edge
|
||||
*/
|
||||
void ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail, ptrdiff_t &index);
|
||||
void ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
||||
ptrdiff_t &index);
|
||||
};
|
||||
|
||||
inline quint32 DialogUnionDetails::getD1() const
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user