Seamly2D
Code documentation
DialogTrueDarts Class Reference

#include <dialogtruedarts.h>

Inheritance diagram for DialogTrueDarts:
Collaboration diagram for DialogTrueDarts:

Public Slots

virtual void ChosenObject (quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
 
virtual void PointNameChanged () Q_DECL_OVERRIDE
 
void NameDartPoint1Changed ()
 
void NameDartPoint2Changed ()
 
- Public Slots inherited from DialogTool
virtual void ChosenObject (quint32 id, const SceneObject &type)
 ChosenObject gets id and type of selected object. Save right data and ignore wrong. More...
 
virtual void SelectedObject (bool selected, quint32 object, quint32 tool)
 
void NamePointChanged ()
 NamePointChanged check name of point. More...
 
virtual void DialogAccepted ()
 DialogAccepted save data and emit signal about closed dialog. More...
 
virtual void DialogApply ()
 DialogApply save data and emit signal DialogApplied. More...
 
virtual void DialogRejected ()
 DialogRejected emit signal dialog rejected. More...
 
void FormulaChanged ()
 formula check formula More...
 
void FormulaChangedPlainText ()
 FormulaChangedPlainText check formula (plain text editor editor) More...
 
void ArrowUp ()
 ArrowUp set angle value 90 degree. More...
 
void ArrowDown ()
 ArrowDown set angle value 270 degree. More...
 
void ArrowLeft ()
 ArrowLeft set angle value 180 degree. More...
 
void ArrowRight ()
 ArrowRight set angle value 0 degree. More...
 
void ArrowLeftUp ()
 ArrowLeftUp set angle value 135 degree. More...
 
void ArrowLeftDown ()
 ArrowLeftDown set angle value 225 degree. More...
 
void ArrowRightUp ()
 ArrowRightUp set angle value 45 degree. More...
 
void ArrowRightDown ()
 ArrowRightDown set angle value 315 degree. More...
 
virtual void EvalFormula ()
 EvalFormula evaluate formula. More...
 
virtual void PointNameChanged ()
 

Public Member Functions

 DialogTrueDarts (const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
 
 ~DialogTrueDarts ()
 
QString GetFirstNewDartPointName ()
 
QString GetSecondNewDartPointName ()
 
void SetNewDartPointNames (const QString &firstPoint, const QString &secondPoint)
 
quint32 GetFirstBasePointId () const
 
void SetFirstBasePointId (const quint32 &value)
 
quint32 GetSecondBasePointId () const
 
void SetSecondBasePointId (const quint32 &value)
 
quint32 GetFirstDartPointId () const
 
void SetFirstDartPointId (const quint32 &value)
 
quint32 GetSecondDartPointId () const
 
void SetSecondDartPointId (const quint32 &value)
 
quint32 GetThirdDartPointId () const
 
void SetThirdDartPointId (const quint32 &value)
 
void SetChildrenId (const quint32 &ch1, const quint32 &ch2)
 
- Public Member Functions inherited from DialogTool
 DialogTool (const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
 DialogTool create dialog. More...
 
virtual ~DialogTool () Q_DECL_OVERRIDE
 
VAbstractToolGetAssociatedTool ()
 
void SetAssociatedTool (VAbstractTool *tool)
 
virtual void ShowDialog (bool click)
 
virtual void Build (const Tool &type)
 
virtual void SetPiecesList (const QVector< quint32 > &list)
 
quint32 GetToolId () const
 
void SetToolId (const quint32 &value)
 
QString getPointName () const
 

Protected Member Functions

virtual void ShowVisualization () Q_DECL_OVERRIDE
 
virtual void SaveData () Q_DECL_OVERRIDE
 SaveData Put dialog data in local variables. More...
 
virtual void CheckState () Q_DECL_FINAL
 CheckState enable, when all is correct, or disable, when something wrong, button ok. More...
 
- Protected Member Functions inherited from DialogTool
virtual void keyPressEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 
virtual void closeEvent (QCloseEvent *event) Q_DECL_OVERRIDE
 closeEvent handle when dialog cloded More...
 
virtual void showEvent (QShowEvent *event) Q_DECL_OVERRIDE
 showEvent handle when window show More...
 
void FillComboBoxPiecesList (QComboBox *box, const QVector< quint32 > &list)
 
void FillComboBoxPoints (QComboBox *box, FillComboBox rule=FillComboBox::Whole, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
 FillComboBoxPoints fill comboBox list of points. More...
 
void FillComboBoxArcs (QComboBox *box, FillComboBox rule=FillComboBox::Whole, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
 
void FillComboBoxSplines (QComboBox *box) const
 
void FillComboBoxSplinesPath (QComboBox *box) const
 
void FillComboBoxCurves (QComboBox *box) const
 
void FillComboBoxTypeLine (QComboBox *box, const QMap< QString, QIcon > &stylesPics) const
 FillComboBoxTypeLine fill comboBox list of type lines. More...
 
void FillComboBoxLineColors (QComboBox *box) const
 
void FillComboBoxCrossCirclesPoints (QComboBox *box) const
 
void FillComboBoxVCrossCurvesPoint (QComboBox *box) const
 
void FillComboBoxHCrossCurvesPoint (QComboBox *box) const
 
QString GetComboBoxCurrentData (const QComboBox *box, const QString &def) const
 
void ChangeCurrentData (QComboBox *box, const QVariant &value) const
 ChangeCurrentData select item in combobox by id. More...
 
void ValFormulaChanged (bool &flag, QLineEdit *edit, QTimer *timer, const QString &postfix=QString())
 ValFormulaChanged handle change formula. More...
 
void ValFormulaChanged (bool &flag, QPlainTextEdit *edit, QTimer *timer, const QString &postfix=QString())
 
qreal Eval (const QString &text, bool &flag, QLabel *label, const QString &postfix, bool checkZero=true, bool checkLessThanZero=false)
 Eval evaluate formula and show result. More...
 
qreal normalize (const qreal value, const qreal start, const qreal end)
 
void setCurrentPointId (QComboBox *box, const quint32 &value, FillComboBox rule=FillComboBox::NoChildren, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
 
void setCurrentSplineId (QComboBox *box, const quint32 &value) const
 setCurrentSplineId set current spline id in combobox More...
 
void setCurrentArcId (QComboBox *box, const quint32 &value, FillComboBox rule=FillComboBox::NoChildren, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
 setCurrentArcId More...
 
void setCurrentSplinePathId (QComboBox *box, const quint32 &value) const
 setCurrentSplinePathId set current splinePath id in combobox More...
 
void setCurrentCurveId (QComboBox *box, const quint32 &value) const
 
quint32 getCurrentObjectId (QComboBox *box) const
 getCurrentPointId return current point id stored in combobox More...
 
template<typename T >
getCurrentCrossPoint (QComboBox *box) const
 
bool SetObject (const quint32 &id, QComboBox *box, const QString &toolTip)
 
void DeployFormula (QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight)
 
template<typename T >
void initializeOkCancelApply (T *ui)
 initializeOkCancelApply initialize OK / Cancel and Apply buttons More...
 
template<typename T >
void initializeOkCancel (T *ui)
 initializeOkCancel initialize OK and Cancel buttons More...
 
template<typename T >
void initializeFormulaUi (T *ui)
 initializeFormulaUi initialize ui object for the formula field More...
 
template<typename T >
void AddVisualization ()
 
template<typename T >
QVector< T > GetListInternals (const QListWidget *list) const
 
void ChangeColor (QWidget *widget, const QColor &color)
 
void MoveCursorToEnd (QPlainTextEdit *plainTextEdit) const
 
virtual bool eventFilter (QObject *object, QEvent *event) Q_DECL_OVERRIDE
 
quint32 DNumber (const QString &baseName) const
 
NodeInfo getNodeInfo (const VPieceNode &node, bool showNotch=false) const
 
void newNodeItem (QListWidget *listWidget, const VPieceNode &node, bool nodeExcluded=true, bool isDuplicate=false)
 
void initializeNodeAngles (QComboBox *box)
 

Private Member Functions

void NameChanged (QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name, QLineEdit *secondPointName, bool &flagName)
 
void FillComboBoxs (const quint32 &ch1, const quint32 &ch2)
 
void CheckName (QLineEdit *edit, QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name, QLineEdit *secondPointName, bool &flagName)
 

Private Attributes

Ui::DialogTrueDarts * ui
 
QString d1PointName
 
QString d2PointName
 
quint32 ch1
 
quint32 ch2
 
bool flagName1
 
bool flagName2
 

Additional Inherited Members

- Signals inherited from DialogTool
void DialogClosed (int result)
 DialogClosed signal dialog closed. More...
 
void DialogApplied ()
 DialogApplied emit signal dialog apply changes. More...
 
void ToolTip (const QString &toolTip)
 ToolTip emit tooltipe for tool. More...
 
- Static Public Member Functions inherited from DialogTool
static void moveListRowTop (QListWidget *list)
 
static void moveListRowUp (QListWidget *list)
 
static void moveListRowDown (QListWidget *list)
 
static void moveListRowBottom (QListWidget *list)
 
- Static Protected Member Functions inherited from DialogTool
static int FindNotExcludedNodeDown (QListWidget *listWidget, int candidate)
 
static int FindNotExcludedNodeUp (QListWidget *listWidget, int candidate)
 
static bool isFirstPointSameAsLast (QListWidget *listWidget)
 
static bool doublePointsExist (QListWidget *listWidget)
 
static bool isEachPointNameUnique (QListWidget *listWidget)
 
static QString DialogWarningIcon ()
 
static QFont NodeFont (bool nodeExcluded)
 
- Protected Attributes inherited from DialogTool
const VContainerdata
 data container with data More...
 
bool isInitialized
 isInitialized true if window is initialized More...
 
bool flagName
 flagName true if name is correct More...
 
bool flagFormula
 flagFormula true if formula correct More...
 
bool flagError
 flagError use this flag if for you do not enought More...
 
QTimer * timerFormula
 timerFormula timer for check formula More...
 
QPushButton * ok_Button
 ok_Button button ok More...
 
QPushButton * apply_Button
 apply_Button button apply More...
 
QDoubleSpinBox * spinBoxAngle
 spinBoxAngle spinbox for angle More...
 
QPlainTextEdit * plainTextEditFormula
 plainTextEditFormula formula More...
 
QLabel * labelResultCalculation
 labelResultCalculation label with result of calculation More...
 
QLabel * labelEditNamePoint
 labelEditNamePoint label used when need show wrong name of point More...
 
QLabel * labelEditFormula
 labelEditFormula label used when need show wrong formula More...
 
const QColor okColor
 
const QColor errorColor
 
VAbstractToolassociatedTool
 associatedTool vdrawtool associated with opened dialog. More...
 
quint32 toolId
 
bool prepare
 prepare show if we prepare. Show dialog after finish working with visual part of tool More...
 
QString pointName
 pointName name of point More...
 
qint32 number
 number number of handled objects More...
 
QPointer< Visualizationvis
 

Detailed Description

Definition at line 69 of file dialogtruedarts.h.

Constructor & Destructor Documentation

◆ DialogTrueDarts()

DialogTrueDarts::DialogTrueDarts ( const VContainer data,
const quint32 &  toolId,
QWidget *  parent = nullptr 
)

◆ ~DialogTrueDarts()

DialogTrueDarts::~DialogTrueDarts ( )

Definition at line 115 of file dialogtruedarts.cpp.

References ui.

Member Function Documentation

◆ CheckName()

void DialogTrueDarts::CheckName ( QLineEdit *  edit,
QLabel *  labelEditNamePoint,
const QString &  pointD1Name,
const QString &  pointD2Name,
QLineEdit *  secondPointName,
bool &  flagName 
)
private

◆ CheckState()

void DialogTrueDarts::CheckState ( )
protectedvirtual

CheckState enable, when all is correct, or disable, when something wrong, button ok.

Reimplemented from DialogTool.

Definition at line 401 of file dialogtruedarts.cpp.

References DialogTool::apply_Button, DialogTool::flagError, flagName1, flagName2, DialogTool::ok_Button, and SCASSERT.

Referenced by DialogTrueDarts(), NameChanged(), and PointNameChanged().

◆ ChosenObject

◆ FillComboBoxs()

void DialogTrueDarts::FillComboBoxs ( const quint32 &  ch1,
const quint32 &  ch2 
)
private

Definition at line 427 of file dialogtruedarts.cpp.

References ch1, ch2, DialogTool::FillComboBoxPoints(), NoChildren, and ui.

Referenced by DialogTrueDarts(), and SetChildrenId().

◆ GetFirstBasePointId()

quint32 DialogTrueDarts::GetFirstBasePointId ( ) const

Definition at line 154 of file dialogtruedarts.cpp.

References DialogTool::getCurrentObjectId(), and ui.

Referenced by SaveData().

◆ GetFirstDartPointId()

quint32 DialogTrueDarts::GetFirstDartPointId ( ) const

Definition at line 186 of file dialogtruedarts.cpp.

References DialogTool::getCurrentObjectId(), and ui.

Referenced by SaveData().

◆ GetFirstNewDartPointName()

QString DialogTrueDarts::GetFirstNewDartPointName ( )

Definition at line 121 of file dialogtruedarts.cpp.

References d1PointName.

◆ GetSecondBasePointId()

quint32 DialogTrueDarts::GetSecondBasePointId ( ) const

Definition at line 170 of file dialogtruedarts.cpp.

References DialogTool::getCurrentObjectId(), and ui.

Referenced by SaveData().

◆ GetSecondDartPointId()

quint32 DialogTrueDarts::GetSecondDartPointId ( ) const

Definition at line 202 of file dialogtruedarts.cpp.

References DialogTool::getCurrentObjectId(), and ui.

Referenced by SaveData().

◆ GetSecondNewDartPointName()

QString DialogTrueDarts::GetSecondNewDartPointName ( )

Definition at line 127 of file dialogtruedarts.cpp.

References d2PointName.

◆ GetThirdDartPointId()

quint32 DialogTrueDarts::GetThirdDartPointId ( ) const

Definition at line 218 of file dialogtruedarts.cpp.

References DialogTool::getCurrentObjectId(), and ui.

Referenced by SaveData().

◆ NameChanged()

void DialogTrueDarts::NameChanged ( QLabel *  labelEditNamePoint,
const QString &  pointD1Name,
const QString &  pointD2Name,
QLineEdit *  secondPointName,
bool &  flagName 
)
private

◆ NameDartPoint1Changed

void DialogTrueDarts::NameDartPoint1Changed ( )
slot

Definition at line 366 of file dialogtruedarts.cpp.

References d1PointName, d2PointName, flagName1, NameChanged(), and ui.

Referenced by DialogTrueDarts().

◆ NameDartPoint2Changed

void DialogTrueDarts::NameDartPoint2Changed ( )
slot

Definition at line 372 of file dialogtruedarts.cpp.

References d1PointName, d2PointName, flagName2, NameChanged(), and ui.

Referenced by DialogTrueDarts().

◆ PointNameChanged

void DialogTrueDarts::PointNameChanged ( )
virtualslot

◆ SaveData()

◆ SetChildrenId()

void DialogTrueDarts::SetChildrenId ( const quint32 &  ch1,
const quint32 &  ch2 
)

Definition at line 234 of file dialogtruedarts.cpp.

References ch1, ch2, and FillComboBoxs().

◆ SetFirstBasePointId()

void DialogTrueDarts::SetFirstBasePointId ( const quint32 &  value)

◆ SetFirstDartPointId()

void DialogTrueDarts::SetFirstDartPointId ( const quint32 &  value)

◆ SetNewDartPointNames()

void DialogTrueDarts::SetNewDartPointNames ( const QString &  firstPoint,
const QString &  secondPoint 
)

Definition at line 133 of file dialogtruedarts.cpp.

References CheckName(), d1PointName, d2PointName, flagName1, flagName2, and ui.

◆ SetSecondBasePointId()

void DialogTrueDarts::SetSecondBasePointId ( const quint32 &  value)

◆ SetSecondDartPointId()

void DialogTrueDarts::SetSecondDartPointId ( const quint32 &  value)

◆ SetThirdDartPointId()

void DialogTrueDarts::SetThirdDartPointId ( const quint32 &  value)

◆ ShowVisualization()

void DialogTrueDarts::ShowVisualization ( )
protectedvirtual

Reimplemented from DialogTool.

Definition at line 378 of file dialogtruedarts.cpp.

Member Data Documentation

◆ ch1

◆ ch2

◆ d1PointName

QString DialogTrueDarts::d1PointName
private

◆ d2PointName

QString DialogTrueDarts::d2PointName
private

◆ flagName1

bool DialogTrueDarts::flagName1
private

Definition at line 120 of file dialogtruedarts.h.

Referenced by CheckState(), NameDartPoint1Changed(), and SetNewDartPointNames().

◆ flagName2

bool DialogTrueDarts::flagName2
private

Definition at line 121 of file dialogtruedarts.h.

Referenced by CheckState(), NameDartPoint2Changed(), and SetNewDartPointNames().

◆ ui


The documentation for this class was generated from the following files: