From c349a93a73451019873a31f7665210b2a17a8b67 Mon Sep 17 00:00:00 2001 From: dismine Date: Sun, 1 Jun 2014 10:35:13 +0300 Subject: [PATCH] Clang's warnings. --HG-- branch : develop --- src/app/app.pro | 384 +++++++++++++++++++++++ src/app/container/vincrement.cpp | 15 +- src/app/container/vincrement.h | 125 ++++---- src/app/container/vmeasurement.cpp | 46 ++- src/app/container/vmeasurement.h | 92 +++--- src/app/dialogs/app/dialogincrements.cpp | 4 +- src/app/dialogs/tools/dialogtool.cpp | 2 +- src/app/geometry/vgobject.cpp | 55 ++++ src/app/geometry/vgobject.h | 92 +----- src/app/geometry/vpointf.cpp | 27 +- src/app/geometry/vpointf.h | 131 ++++---- src/app/stable.h | 2 + 12 files changed, 700 insertions(+), 275 deletions(-) diff --git a/src/app/app.pro b/src/app/app.pro index 94d5eaf1a..e503e877e 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -118,6 +118,390 @@ CONFIG(debug, debug|release){ -Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3 \ -ftrapv } + #Turn on Clang warnings + clang*{ + 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 "/usr/include/qt5/QtXmlPatterns" \ +-isystem "$${UI_DIR}" -isystem "$${MOC_DIR}" -isystem "$${RCC_DIR}" \ +-O0 \ +-fparse-all-comments \ +-Wabi \ +-Wabstract-final-class \ +-Wabstract-vbase-init \ +-Waddress \ +-Waddress-of-array-temporary \ +-Waddress-of-temporary \ +-Waggregate-return \ +-Wall \ +-Wambiguous-macro \ +-Wambiguous-member-template \ +-Wanalyzer-incompatible-plugin \ +-Wanonymous-pack-parens \ +-Warc \ +-Warc-abi \ +-Warc-bridge-casts-disallowed-in-nonarc \ +-Warc-maybe-repeated-use-of-weak \ +-Warc-non-pod-memaccess \ +-Warc-performSelector-leaks \ +-Warc-repeated-use-of-weak \ +-Warc-retain-cycles \ +-Warc-unsafe-retained-assign \ +-Warray-bounds \ +-Warray-bounds-pointer-arithmetic \ +-Wasm \ +-Wasm-operand-widths \ +-Wassign-enum \ +-Watomic-properties \ +-Watomic-property-with-user-defined-accessor \ +-Wattributes \ +-Wauto-import \ +-Wauto-storage-class \ +-Wauto-var-id \ +-Wavailability \ +-Wbackslash-newline-escape \ +-Wbad-array-new-length \ +-Wbad-function-cast \ +-Wbind-to-temporary-copy \ +-Wbitfield-constant-conversion \ +-Wbitwise-op-parentheses \ +-Wbool-conversion \ +-Wbool-conversions \ +-Wbuiltin-macro-redefined \ +-Wbuiltin-requires-header \ +-Wc++-compat \ +-Wc++0x-compat \ +-Wc++0x-extensions \ +-Wc++0x-narrowing \ +-Wc++11-compat \ +-Wc++11-compat-pedantic \ +-Wc++11-compat-reserved-user-defined-literal \ +-Wc++11-extensions \ +-Wc++11-extra-semi \ +-Wc++11-long-long \ +-Wc++11-narrowing \ +-Wc11-extensions \ +-Wcast-align \ +-Wcast-of-sel-type \ +-Wcast-qual \ +-WCFString-literal \ +-Wchar-align \ +-Wchar-subscripts \ +-Wcomment \ +-Wcomments \ +-Wcompare-distinct-pointer-types \ +-Wcomplex-component-init \ +-Wconditional-type-mismatch \ +-Wconditional-uninitialized \ +-Wconfig-macros \ +-Wconstant-conversion \ +-Wconstant-logical-operand \ +-Wconstexpr-not-const \ +-Wconversion \ +-Wconversion-null \ +-Wcovered-switch-default \ +-Wctor-dtor-privacy \ +-Wcustom-atomic-properties \ +-Wdangling-else \ +-Wdangling-field \ +-Wdangling-initializer-list \ +-Wdeclaration-after-statement \ +-Wdelegating-ctor-cycles \ +-Wdelete-incomplete \ +-Wdelete-non-virtual-dtor \ +-Wdeprecated \ +-Wdeprecated-declarations \ +-Wdeprecated-implementations \ +-Wdeprecated-objc-isa-usage \ +-Wdeprecated-objc-pointer-introspection \ +-Wdeprecated-objc-pointer-introspection-performSelector \ +-Wdeprecated-register \ +-Wdeprecated-writable-strings \ +-Wdirect-ivar-access \ +-Wdisabled-macro-expansion \ +-Wdisabled-optimization \ +-Wdiscard-qual \ +-Wdistributed-object-modifiers \ +-Wdiv-by-zero \ +-Wdivision-by-zero \ +-Wdocumentation \ +-Wdocumentation-deprecated-sync \ +-Wdocumentation-html \ +-Wdocumentation-pedantic \ +-Wdocumentation-unknown-command \ +-Wdollar-in-identifier-extension \ +-Wduplicate-decl-specifier \ +-Wduplicate-enum \ +-Wduplicate-method-arg \ +-Wduplicate-method-match \ +-Wdynamic-class-memaccess \ +-Weffc++ \ +-Wembedded-directive \ +-Wempty-body \ +-Wempty-translation-unit \ +-Wendif-labels \ +-Wenum-compare \ +-Wenum-conversion \ +-Wexit-time-destructors \ +-Wexplicit-ownership-type \ +-Wextended-offsetof \ +-Wextern-initializer \ +-Wextra \ +-Wextra-semi \ +-Wextra-tokens \ +-Wflexible-array-extensions \ +-Wfloat-equal \ +-Wformat \ +-Wformat-extra-args \ +-Wformat-invalid-specifier \ +-Wformat-non-iso \ +-Wformat-nonliteral \ +-Wformat-security \ +-Wformat-y2k \ +-Wformat-zero-length \ +-Wformat=2 \ +-Wfour-char-constants \ +-Wgcc-compat \ +-Wglobal-constructors \ +-Wgnu \ +-Wgnu-array-member-paren-init \ +-Wgnu-designator \ +-Wgnu-static-float-init \ +-Wheader-guard \ +-Wheader-hygiene \ +-Widiomatic-parentheses \ +-Wignored-attributes \ +-Wignored-qualifiers \ +-Wimplicit \ +-Wimplicit-atomic-properties \ +-Wimplicit-conversion-floating-point-to-bool \ +-Wimplicit-exception-spec-mismatch \ +-Wimplicit-fallthrough \ +-Wimplicit-fallthrough-per-function \ +-Wimplicit-function-declaration \ +-Wimplicit-int \ +-Wimplicit-retain-self \ +-Wimport \ +-Wimport-preprocessor-directive-pedantic \ +-Wincompatible-library-redeclaration \ +-Wincompatible-pointer-types \ +-Wincompatible-pointer-types-discards-qualifiers \ +-Wincomplete-implementation \ +-Wincomplete-module \ +-Wincomplete-umbrella \ +-Winherited-variadic-ctor \ +-Winit-self \ +-Winitializer-overrides \ +-Winline \ +-Wint-conversion \ +-Wint-conversions \ +-Wint-to-pointer-cast \ +-Wint-to-void-pointer-cast \ +-Winteger-overflow \ +-Winvalid-constexpr \ +-Winvalid-iboutlet \ +-Winvalid-noreturn \ +-Winvalid-offsetof \ +-Winvalid-pch \ +-Winvalid-pp-token \ +-Winvalid-source-encoding \ +-Winvalid-token-paste \ +-Wknr-promoted-parameter \ +-Wlanguage-extension-token \ +-Wlarge-by-value-copy \ +-Wliteral-conversion \ +-Wliteral-range \ +-Wlocal-type-template-args \ +-Wlogical-not-parentheses \ +-Wlogical-op-parentheses \ +-Wlong-long \ +-Wloop-analysis \ +-Wmain \ +-Wmain-return-type \ +-Wmalformed-warning-check \ +-Wmethod-signatures \ +-Wmicrosoft \ +-Wmicrosoft-exists \ +-Wmismatched-parameter-types \ +-Wmismatched-return-types \ +-Wmismatched-tags \ +-Wmissing-braces \ +-Wmissing-declarations \ +-Wmissing-field-initializers \ +-Wmissing-format-attribute \ +-Wmissing-include-dirs \ +-Wmissing-method-return-type \ +-Wmissing-noreturn \ +-Wmissing-prototypes \ +-Wmissing-selector-name \ +-Wmissing-sysroot \ +-Wmissing-variable-declarations \ +-Wmodule-conflict \ +-Wmost \ +-Wmultichar \ +-Wnarrowing \ +-Wnested-anon-types \ +-Wnested-externs \ +-Wnewline-eof \ +-Wnon-gcc \ +-Wnon-literal-null-conversion \ +-Wnon-pod-varargs \ +-Wnon-virtual-dtor \ +-Wnonnull \ +-Wnonportable-cfstrings \ +-WNSObject-attribute \ +-Wnull-arithmetic \ +-Wnull-character \ +-Wnull-conversion \ +-Wnull-dereference \ +-Wodr \ +-Wold-style-cast \ +-Wold-style-definition \ +-Wout-of-line-declaration \ +-Wover-aligned \ +-Woverflow \ +-Woverlength-strings \ +-Woverloaded-shift-op-parentheses \ +-Woverloaded-virtual \ +-Woverriding-method-mismatch \ +-Wpacked \ +-Wpadded \ +-Wparentheses \ +-Wparentheses-equality \ +-Wpedantic \ +-Wpointer-arith \ +-Wpointer-sign \ +-Wpointer-to-int-cast \ +-Wpointer-type-mismatch \ +-Wpredefined-identifier-outside-function \ +-Wprivate-extern \ +-Wprotocol \ +-Wprotocol-property-synthesis-ambiguity \ +-Wreadonly-iboutlet-property \ +-Wreceiver-expr \ +-Wreceiver-forward-class \ +-Wreceiver-is-weak \ +-Wredundant-decls \ +-Wreinterpret-base-class \ +-Wreorder \ +-Wrequires-super-attribute \ +-Wreserved-user-defined-literal \ +-Wreturn-stack-address \ +-Wreturn-type \ +-Wreturn-type-c-linkage \ +-Wsection \ +-Wselector \ +-Wselector-type-mismatch \ +-Wself-assign \ +-Wself-assign-field \ +-Wsemicolon-before-method-body \ +-Wsentinel \ +-Wsequence-point \ +-Wserialized-diagnostics \ +-Wshadow-ivar \ +-Wshift-count-negative \ +-Wshift-count-overflow \ +-Wshift-op-parentheses \ +-Wshift-overflow \ +-Wshift-sign-overflow \ +-Wshorten-64-to-32 \ +-Wsign-compare \ +-Wsign-conversion \ +-Wsign-promo \ +-Wsizeof-array-argument \ +-Wsizeof-array-decay \ +-Wsizeof-pointer-memaccess \ +-Wsometimes-uninitialized \ +-Wsource-uses-openmp \ +-Wstack-protector \ +-Wstatic-float-init \ +-Wstatic-in-inline \ +-Wstatic-local-in-inline \ +-Wstatic-self-init \ +-Wstrict-aliasing \ +-Wstrict-aliasing=0 \ +-Wstrict-aliasing=1 \ +-Wstrict-aliasing=2 \ +-Wstrict-overflow \ +-Wstrict-overflow=0 \ +-Wstrict-overflow=1 \ +-Wstrict-overflow=2 \ +-Wstrict-overflow=3 \ +-Wstrict-overflow=4 \ +-Wstrict-overflow=5 \ +-Wstrict-prototypes \ +-Wstrict-selector-match \ +-Wstring-compare \ +-Wstring-conversion \ +-Wstring-plus-int \ +-Wstrlcpy-strlcat-size \ +-Wstrncat-size \ +-Wsuper-class-method-mismatch \ +-Wswitch \ +-Wswitch-default \ +-Wswitch-enum \ +-Wsynth \ +-Wtautological-compare \ +-Wtautological-constant-out-of-range-compare \ +-Wtentative-definition-incomplete-type \ +-Wthread-safety \ +-Wthread-safety-analysis \ +-Wthread-safety-attributes \ +-Wthread-safety-beta \ +-Wthread-safety-precise \ +-Wtrigraphs \ +-Wtype-limits \ +-Wtype-safety \ +-Wtypedef-redefinition \ +-Wtypename-missing \ +-Wundeclared-selector \ +-Wundef \ +-Wundefined-inline \ +-Wundefined-internal \ +-Wundefined-reinterpret-cast \ +-Wunicode \ +-Wunicode-whitespace \ +-Wuninitialized \ +-Wunknown-pragmas \ +-Wunknown-warning-option \ +-Wunnamed-type-template-args \ +-Wunneeded-internal-declaration \ +-Wunneeded-member-function \ +-Wunreachable-code \ +-Wunsequenced \ +-Wunsupported-visibility \ +-Wunused \ +-Wunused-argument \ +-Wunused-command-line-argument \ +-Wunused-comparison \ +-Wunused-exception-parameter \ +-Wunused-function \ +-Wunused-label \ +-Wunused-member-function \ +-Wunused-parameter \ +-Wunused-private-field \ +-Wunused-result \ +-Wunused-sanitize-argument \ +-Wunused-value \ +-Wunused-variable \ +-Wunused-volatile-lvalue \ +-Wused-but-marked-unused \ +-Wuser-defined-literals \ +-Wvarargs \ +-Wvariadic-macros \ +-Wvector-conversion \ +-Wvector-conversions \ +-Wvexing-parse \ +-Wvisibility \ +-Wvla \ +-Wvla-extension \ +-Wvolatile-register-var \ +-Wweak-template-vtables \ +-Wweak-vtables \ +-Wwrite-strings \ +-Wzero-length-array + } } else { *-g++{#Don't use additional GCC keys on Windows system. QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic diff --git a/src/app/container/vincrement.cpp b/src/app/container/vincrement.cpp index 13f1f6da3..865e7d00e 100644 --- a/src/app/container/vincrement.cpp +++ b/src/app/container/vincrement.cpp @@ -29,9 +29,22 @@ #include "vincrement.h" //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VIncrement create enpty increment + */ VIncrement::VIncrement() - :id(0), base(0), ksize(50.0), kheight(176.0), description(QString()){} + :id(0), base(0), ksize(50.0), kheight(176.0), description(QString()) +{} +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VIncrementTableRow create increment + * @param id id + * @param base value in base size and growth + * @param ksize increment in sizes + * @param kheight increment in heights + * @param description description of increment + */ VIncrement::VIncrement(quint32 id, qreal base, qreal ksize, qreal kheight, QString description) :id(id), base(base), ksize(ksize), kheight(kheight), description(description) {} diff --git a/src/app/container/vincrement.h b/src/app/container/vincrement.h index 4f34a9942..bc787e6bc 100644 --- a/src/app/container/vincrement.h +++ b/src/app/container/vincrement.h @@ -37,139 +37,132 @@ class VIncrement { public: - /** - * @brief VIncrementTableRow create enpty row - */ VIncrement(); - /** - * @brief VIncrementTableRow create row - * @param id id - * @param base value in base size and growth - * @param ksize increment in sizes - * @param kgrowth increment in growths - * @param description description of increment - */ VIncrement(quint32 id, qreal base, qreal ksize, qreal kheight, QString description = QString()); - /** - * @brief getId return id of row - * @return id - */ quint32 getId() const; - /** - * @brief setId set id of row - * @param value id - */ void setId(const quint32 &value); - /** - * @brief getBase return value in base size and growth - * @return value - */ qreal getBase() const; - /** - * @brief setBase set value in base size and growth - * @param value base value - */ void setBase(const qreal &value); - /** - * @brief getKsize return increment in sizes - * @return increment - */ qreal getKsize() const; - /** - * @brief setKsize set increment in sizes - * @param value value of increment - */ void setKsize(const qreal &value); - /** - * @brief getKheight return increment in growths - * @return increment - */ qreal getKheight() const; - /** - * @brief setKheight set increment in growths - * @param value value of increment - */ void setKheight(const qreal &value); - /** - * @brief getDescription return description - * @return description - */ QString getDescription() const; - /** - * @brief setDescription set description for row - * @param value description - */ void setDescription(const QString &value); qreal GetValue() const; qreal GetValue(const qreal &size, const qreal &height) const; private: - /** - * @brief id identificator - */ + /** @brief id identificator */ quint32 id; - /** - * @brief base value in base size and growth - */ + + /** @brief base value in base size and height */ qreal base; - /** - * @brief ksize increment in sizes - */ + + /** @brief ksize increment in sizes */ qreal ksize; - /** - * @brief kgrowth increment in growths - */ + + /** @brief kgrowth increment in growths */ qreal kheight; - /** - * @brief description description of increment - */ + + /** @brief description description of increment */ QString description; }; +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getId return id of row + * @return id + */ inline quint32 VIncrement::getId() const { return id; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setId set id of row + * @param value id + */ inline void VIncrement::setId(const quint32 &value) { id = value; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getBase return value in base size and growth + * @return value + */ inline qreal VIncrement::getBase() const { return base; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setBase set value in base size and growth + * @param value base value + */ inline void VIncrement::setBase(const qreal &value) { base = value; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getKsize return increment in sizes + * @return increment + */ inline qreal VIncrement::getKsize() const { return ksize; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setKsize set increment in sizes + * @param value value of increment + */ inline void VIncrement::setKsize(const qreal &value) { ksize = value; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getKheight return increment in growths + * @return increment + */ inline qreal VIncrement::getKheight() const { return kheight; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setKheight set increment in growths + * @param value value of increment + */ inline void VIncrement::setKheight(const qreal &value) { kheight = value; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getDescription return description + * @return description + */ inline QString VIncrement::getDescription() const { return description; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setDescription set description for row + * @param value description + */ inline void VIncrement::setDescription(const QString &value) { description = value; diff --git a/src/app/container/vmeasurement.cpp b/src/app/container/vmeasurement.cpp index b52b6e858..2697fdea6 100644 --- a/src/app/container/vmeasurement.cpp +++ b/src/app/container/vmeasurement.cpp @@ -29,25 +29,57 @@ #include "vmeasurement.h" //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VMeasurement create empty measurement + */ VMeasurement::VMeasurement() - :base(0), ksize(50.0), kheight(176.0), gui_text(QString()), number(QString()), _tagName(QString()) + :base(0), ksize(50.0), kheight(176.0), gui_text(QString()), description(QString()), _tagName(QString()) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VMeasurement create measurement for standard table + * @param base value in base size and growth + * @param ksize increment in sizes + * @param kheight increment in heights + * @param gui_text shor tooltip for user + * @param description measurement full description + * @param tagName measurement's tag name in file + */ 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), _tagName(tagName) + const QString &gui_text, const QString &description, const QString &tagName) + :base(base), ksize(ksize), kheight(kgrowth), gui_text(gui_text), description(description), _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), _tagName(tagName) +/** + * @brief VMeasurement create measurement for individual table + * @param base value in base size and growth + * @param gui_text shor tooltip for user + * @param description measurement full description + * @param tagName measurement's tag name in file + */ +VMeasurement::VMeasurement(const qreal &base, const QString &gui_text, const QString &description, + const QString &tagName) + :base(base), ksize(50.0), kheight(176.0), gui_text(gui_text), description(description), _tagName(tagName) {} //--------------------------------------------------------------------------------------------------------------------- -qreal VMeasurement::GetValue() const +VMeasurement::VMeasurement(const VMeasurement &m) + :base(m.GetBase()), ksize(m.GetKsize()), kheight(m.GetKheight()), gui_text(m.GetGuiText()), + description(m.GetDescription()), _tagName(m.TagName()) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VMeasurement &VMeasurement::operator=(const VMeasurement &m) { - return base; + this->base = m.GetBase(); + this->ksize = m.GetKsize(); + this->kheight = m.GetKheight(); + this->gui_text = m.GetGuiText(); + this->description = m.GetDescription(); + this->_tagName = m.TagName(); + return *this; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/container/vmeasurement.h b/src/app/container/vmeasurement.h index 00a3f43a2..f6b5beb8d 100644 --- a/src/app/container/vmeasurement.h +++ b/src/app/container/vmeasurement.h @@ -37,105 +37,107 @@ 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 &gui_text = QString(), const QString &description = QString(), const QString &TagName = QString()); VMeasurement(const qreal &base, const QString &gui_text = QString(), - const QString &number = QString(), const QString &TagName = QString()); + const QString &description = QString(), const QString &TagName = QString()); + VMeasurement(const VMeasurement &m); + VMeasurement &operator=(const VMeasurement &m); ~VMeasurement(){} - /** - * @brief GetBase return value in base size and growth - * @return value - */ qreal GetBase() const; void setBase(const qreal &value); - /** - * @brief GetKsize return increment in sizes - * @return increment - */ qreal GetKsize() const; - /** - * @brief GetKgrowth return increment in growths - * @return increment - */ qreal GetKheight() const; - /** - * @brief GetDescription return description - * @return description - */ + QString GetGuiText() const; QString GetDescription() const; - QString GetNumber() const; qreal GetValue() const; qreal GetValue(const qreal &size, const qreal &height) const; QString TagName() const; void setTagName(const QString &TagName); private: - /** - * @brief base value in base size and growth - */ + /** @brief base value in base size and growth */ qreal base; - /** - * @brief ksize increment in sizes - */ + + /** @brief ksize increment in sizes */ qreal ksize; - /** - * @brief kgrowth increment in growths - */ + + /** @brief kgrowth increment in growths */ qreal kheight; - /** - * @brief description description measurement - */ + + /** @brief description description measurement */ QString gui_text; - QString number; + + QString description; QString _tagName; }; +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetBase return value in base size and growth + * @return value + */ inline qreal VMeasurement::GetBase() const { return base; } +//--------------------------------------------------------------------------------------------------------------------- inline void VMeasurement::setBase(const qreal &value) { base = value; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetKsize return increment in sizes + * @return increment + */ inline qreal VMeasurement::GetKsize() const { return ksize; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetKheight return increment in heights + * @return increment + */ inline qreal VMeasurement::GetKheight() const { return kheight; } -inline QString VMeasurement::GetDescription() const +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief GetGuiText measurement name for tooltip + * @return measurement name + */ +inline QString VMeasurement::GetGuiText() const { return gui_text; } -inline QString VMeasurement::GetNumber() const +//--------------------------------------------------------------------------------------------------------------------- +inline QString VMeasurement::GetDescription() const { - return number; + return description; } +//--------------------------------------------------------------------------------------------------------------------- +inline qreal VMeasurement::GetValue() const +{ + return base; +} + +//--------------------------------------------------------------------------------------------------------------------- inline QString VMeasurement::TagName() const { return _tagName; } +//--------------------------------------------------------------------------------------------------------------------- inline void VMeasurement::setTagName(const QString &tagName) { _tagName = tagName; diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index e6e3ae51d..0307bfa67 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -160,7 +160,7 @@ void DialogIncrements::FillMeasurements() QTableWidgetItem *item = new QTableWidgetItem(QString(iMap.key())); item->setTextAlignment(Qt::AlignHCenter); item->setFont(QFont("Times", 12, QFont::Bold)); - item->setToolTip(m.GetDescription()); + item->setToolTip(m.GetGuiText()); // set the item non-editable (view only), and non-selectable Qt::ItemFlags flags = item->flags(); flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable); // reset/clear the flag @@ -202,7 +202,7 @@ void DialogIncrements::FillMeasurements() ui->tableWidgetMeasurements->setItem(currentRow, 4, item); } - item = new QTableWidgetItem(m.GetNumber()); + item = new QTableWidgetItem(m.GetDescription()); item->setTextAlignment(Qt::AlignHCenter); // set the item non-editable (view only), and non-selectable flags = item->flags(); diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 2338b476a..6f000294f 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -688,7 +688,7 @@ void DialogTool::ValChenged(int row) QString name = qApp->VarFromUser(item->text()); VMeasurement stable = data->GetMeasurement(name); QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetValueStandardTableRow(name)) - .arg(stable.GetDescription()); + .arg(stable.GetGuiText()); labelDescription->setText(desc); return; } diff --git a/src/app/geometry/vgobject.cpp b/src/app/geometry/vgobject.cpp index 767dcc217..4ec61a1c3 100644 --- a/src/app/geometry/vgobject.cpp +++ b/src/app/geometry/vgobject.cpp @@ -29,21 +29,39 @@ #include "vgobject.h" //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VGObject default constructor. + */ VGObject::VGObject() :_id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Valentina::Calculation) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VGObject constructor. + * @param type type graphical object. + * @param idObject id parent object. + * @param mode mode creation. Used in modeling mode. + */ VGObject::VGObject(const GObject::Type &type, const quint32 &idObject, const Valentina::Draws &mode) :_id(0), type(type), idObject(idObject), _name(QString()), mode(mode) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VGObject copy constructor. + * @param obj object. + */ VGObject::VGObject(const VGObject &obj) :_id(obj.id()), type(obj.getType()), idObject(obj.getIdObject()), _name(obj.name()), mode(obj.getMode()) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief operator = assignment operator. + * @param obj object + * @return object + */ VGObject &VGObject::operator=(const VGObject &obj) { this->_id = obj.id(); @@ -55,53 +73,90 @@ VGObject &VGObject::operator=(const VGObject &obj) } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getIdObject return parent id. + * @return parent id or 0 if object don't have parent. + */ quint32 VGObject::getIdObject() const { return idObject; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setIdObject set parent id. + * @param value parent id. + */ void VGObject::setIdObject(const quint32 &value) { idObject = value; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief name return name graphical object. + * @return name + */ QString VGObject::name() const { return _name; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setName set name graphical object. + * @param name name graphical object. + */ void VGObject::setName(const QString &name) { _name = name; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getMode return mode creation. + * @return mode. + */ Valentina::Draws VGObject::getMode() const { return mode; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setMode set mode creation. + * @param value mode. + */ void VGObject::setMode(const Valentina::Draws &value) { mode = value; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief getType return object type. + * @return type. + */ GObject::Type VGObject::getType() const { return type; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief id return id object. + * @return id + */ quint32 VGObject::id() const { return _id; } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setId set id object. + * @param id id. + */ void VGObject::setId(const quint32 &id) { _id = id; diff --git a/src/app/geometry/vgobject.h b/src/app/geometry/vgobject.h index c05a73ce0..29a6d71ad 100644 --- a/src/app/geometry/vgobject.h +++ b/src/app/geometry/vgobject.h @@ -51,95 +51,35 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(GObject::Types) class VGObject { public: - /** - * @brief VGObject default constructor. - */ VGObject(); - /** - * @brief VGObject constructor. - * @param type type graphical object. - * @param idObject id parent object. - * @param mode mode creation. Used in modeling mode. - */ VGObject(const GObject::Type &type, const quint32 &idObject = 0, const Valentina::Draws &mode = Valentina::Calculation); - /** - * @brief VGObject copy constructor. - * @param obj object. - */ VGObject(const VGObject &obj); - /** - * @brief operator = assignment operator. - * @param obj object - * @return object - */ VGObject& operator= (const VGObject &obj); virtual ~VGObject(){} - /** - * @brief getIdObject return parent id. - * @return parent id or 0 if object don't have parent. - */ quint32 getIdObject() const; - /** - * @brief setIdObject set parent id. - * @param value parent id. - */ - void setIdObject(const quint32 &value); - /** - * @brief name return name graphical object. - * @return name - */ - virtual QString name() const; - /** - * @brief setName set name graphical object. - * @param name name graphical object. - */ - void setName(const QString &name); - /** - * @brief getMode return mode creation. - * @return mode. - */ - Valentina::Draws getMode() const; - /** - * @brief setMode set mode creation. - * @param value mode. - */ - void setMode(const Valentina::Draws &value); - /** - * @brief getType return object type. - * @return type. - */ - GObject::Type getType() const; - /** - * @brief id return id object. - * @return id - */ + void setIdObject(const quint32 &value); + virtual QString name() const; + void setName(const QString &name); + Valentina::Draws getMode() const; + void setMode(const Valentina::Draws &value); + GObject::Type getType() const; quint32 id() const; - /** - * @brief setId set id object. - * @param id id. - */ - virtual void setId(const quint32 &id); + virtual void setId(const quint32 &id); protected: - /** - * @brief _id id in container. Ned for arcs, spline and spline paths. - */ + /** @brief _id id in container. Ned for arcs, spline and spline paths. */ quint32 _id; - /** - * @brief type type of graphical object - */ + + /** @brief type type of graphical object */ GObject::Type type; - /** - * @brief idObject id of parent object. Only for modeling. All another return 0. - */ + + /** @brief idObject id of parent object. Only for modeling. All another return 0. */ quint32 idObject; - /** - * @brief _name object name - */ + + /** @brief _name object name */ QString _name; - /** - * @brief mode object created in calculation or drawing mode - */ + + /** @brief mode object created in calculation or drawing mode */ Valentina::Draws mode; }; diff --git a/src/app/geometry/vpointf.cpp b/src/app/geometry/vpointf.cpp index c47f9e0d0..059181451 100644 --- a/src/app/geometry/vpointf.cpp +++ b/src/app/geometry/vpointf.cpp @@ -29,6 +29,13 @@ #include "vpointf.h" //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VPointF create new point + * @param x x coordinate + * @param y y coordinate + * @param mx offset name respect to x + * @param my offset name respect to y + */ VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Valentina::Draws mode) :VGObject(GObject::Point, idObject, mode), _mx(mx), _my(my), _x(x), _y(y) { @@ -36,10 +43,17 @@ VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idO } //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VPointF creat empty point + */ VPointF::VPointF() :VGObject(GObject::Point, 0, Valentina::Calculation), _mx(0), _my(0), _x(0), _y(0) {} //--------------------------------------------------------------------------------------------------------------------- +/** + * @brief VPointF copy constructor + * @param point + */ VPointF::VPointF(const VPointF &point) :VGObject(point), _mx(point.mx()), _my(point.my()), _x(point.x()), _y(point.y()) {} @@ -47,7 +61,12 @@ VPointF::VPointF(const VPointF &point) :VGObject(point), _mx(point.mx()), _my(po VPointF::VPointF(const QPointF &point) :VGObject(VPointF()), _mx(0), _my(0), _x(point.x()), _y(point.y()) {} -//--------------------------------------------------------------------------------------------------------------------- + +/** + * @brief operator = assignment operator + * @param point point + * @return point + */ VPointF &VPointF::operator =(const VPointF &point) { VGObject::operator=(point); @@ -57,3 +76,9 @@ VPointF &VPointF::operator =(const VPointF &point) _y = point.y(); return *this; } + +//--------------------------------------------------------------------------------------------------------------------- +QString VPointF::name() const +{ + return _name; +} diff --git a/src/app/geometry/vpointf.h b/src/app/geometry/vpointf.h index 3737f4a75..04955e1ee 100644 --- a/src/app/geometry/vpointf.h +++ b/src/app/geometry/vpointf.h @@ -40,146 +40,125 @@ class VPointF:public VGObject { public: - /** - * @brief VPointF creat empty point - */ VPointF (); - /** - * @brief VPointF copy constructor - * @param point - */ VPointF (const VPointF &point ); VPointF (const QPointF &point ); - /** - * @brief VPointF create new point - * @param x x coordinate - * @param y y coordinate - * @param mx offset name respect to x - * @param my offset name respect to y - */ - VPointF ( qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject = 0, - Valentina::Draws mode = Valentina::Calculation); - ~VPointF(){} - /** - * @brief operator = assignment operator - * @param point point - * @return point - */ + VPointF ( qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject = 0, + Valentina::Draws mode = Valentina::Calculation); + virtual ~VPointF(){} VPointF &operator=(const VPointF &point); - - /** - * @brief mx return offset name respect to x - * @return offset - */ qreal mx() const; - /** - * @brief my return offset name respect to y - * @return offset - */ qreal my() const; - /** - * @brief setMx set offset name respect to x - * @param mx offset - */ void setMx(qreal mx); - /** - * @brief setMy set offset name respect to y - * @param my offset - */ void setMy(qreal my); - /** - * @brief toQPointF convert to QPointF - * @return QPointF point - */ QPointF toQPointF()const; - /** - * @brief x return x coordinate - * @return value - */ qreal x() const; - /** - * @brief setX set x coordinate - * @param value x coordinate - */ void setX(const qreal &value); - /** - * @brief y return y coordinate - * @return value - */ qreal y() const; - /** - * @brief setY set y coordinate - * @param value y coordinate - */ void setY(const qreal &value); virtual QString name() const; private: - /** - * @brief _mx offset name respect to x - */ + /** @brief _mx offset name respect to x */ qreal _mx; - /** - * @brief _my offset name respect to y - */ + + /** @brief _my offset name respect to y */ qreal _my; - /** - * @brief _x x coordinate - */ + + /** @brief _x x coordinate */ qreal _x; - /** - * @brief _y y coordinate - */ + + /** @brief _y y coordinate */ qreal _y; }; +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief mx return offset name respect to x + * @return offset + */ inline qreal VPointF::mx() const { return _mx; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief my return offset name respect to y + * @return offset + */ inline qreal VPointF::my() const { return _my; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setMx set offset name respect to x + * @param mx offset + */ inline void VPointF::setMx(qreal mx) { _mx = mx; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setMy set offset name respect to y + * @param my offset + */ inline void VPointF::setMy(qreal my) { _my = my; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief toQPointF convert to QPointF + * @return QPointF point + */ inline QPointF VPointF::toQPointF() const { return QPointF(_x, _y); } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief x return x coordinate + * @return value + */ inline qreal VPointF::x() const { return _x; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setX set x coordinate + * @param value x coordinate + */ inline void VPointF::setX(const qreal &value) { _x = value; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief y return y coordinate + * @return value + */ inline qreal VPointF::y() const { return _y; } +//--------------------------------------------------------------------------------------------------------------------- +/** + * @brief setY set y coordinate + * @param value y coordinate + */ inline void VPointF::setY(const qreal &value) { _y = value; } -inline QString VPointF::name() const -{ - return _name; -} - #endif // VPOINTF_H diff --git a/src/app/stable.h b/src/app/stable.h index d7f9fa164..5b75d92fd 100644 --- a/src/app/stable.h +++ b/src/app/stable.h @@ -30,7 +30,9 @@ #define STABLE_H /* I like to include this pragma too, so the build log indicates if pre-compiled headers were in use. */ +#ifndef __clang__ #pragma message("Compiling precompiled headers for Valentina.\n") +#endif /* Add C includes here */