Refactoring.

This commit is contained in:
Roman Telezhynskyi 2024-02-17 20:22:56 +02:00
parent ad0d3c1612
commit a3448cde76
6 changed files with 21 additions and 29 deletions

View File

@ -103,20 +103,12 @@ void VPE::VPropertyFormView::setPropertySet(VPropertySet *property_set)
void VPE::VPropertyFormView::rowsRemoved(const QModelIndex &parent, int start, int end) void VPE::VPropertyFormView::rowsRemoved(const QModelIndex &parent, int start, int end)
{ {
// todo: Only rebuild the neccessary parts rowsChanged(parent, start, end);
Q_UNUSED(parent)
Q_UNUSED(start)
Q_UNUSED(end)
updatePropertyList();
} }
void VPE::VPropertyFormView::rowsInserted(const QModelIndex &parent, int start, int end) //-V524 void VPE::VPropertyFormView::rowsInserted(const QModelIndex &parent, int start, int end) //-V524
{ {
// todo: Only rebuild the neccessary parts rowsChanged(parent, start, end);
Q_UNUSED(parent)
Q_UNUSED(start)
Q_UNUSED(end)
updatePropertyList();
} }
void VPE::VPropertyFormView::modelReset() void VPE::VPropertyFormView::modelReset()
@ -219,3 +211,12 @@ void VPE::VPropertyFormView::connectPropertyFormWidget(VPropertyFormWidget *widg
connectPropertyFormWidget(tmpEditorWidget); connectPropertyFormWidget(tmpEditorWidget);
} }
} }
void VPE::VPropertyFormView::rowsChanged(const QModelIndex &parent, int start, int end)
{
// todo: Only rebuild the neccessary parts
Q_UNUSED(parent)
Q_UNUSED(start)
Q_UNUSED(end)
updatePropertyList();
}

View File

@ -103,6 +103,8 @@ protected:
private: private:
Q_DISABLE_COPY_MOVE(VPropertyFormView) // NOLINT Q_DISABLE_COPY_MOVE(VPropertyFormView) // NOLINT
void rowsChanged(const QModelIndex &parent, int start, int end);
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -1620,17 +1620,7 @@ void DialogSeamAllowance::CSAEndPointChanged(int index)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::MirrorLineStartPointChanged(int index) void DialogSeamAllowance::MirrorLinePointChanged(int index)
{
Q_UNUSED(index)
flagMirrorLineIsValid = MirrorLineIsValid();
uiTabPaths->checkBoxShowFullPiece->setEnabled(flagMirrorLineIsValid);
CheckState();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::MirrorLineEndPointChanged(int index)
{ {
Q_UNUSED(index) Q_UNUSED(index)
@ -3827,9 +3817,9 @@ void DialogSeamAllowance::InitMainPathTab()
}); });
connect(uiTabPaths->comboBoxMLStartPoint, QOverload<int>::of(&QComboBox::currentIndexChanged), this, connect(uiTabPaths->comboBoxMLStartPoint, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DialogSeamAllowance::MirrorLineStartPointChanged); &DialogSeamAllowance::MirrorLinePointChanged);
connect(uiTabPaths->comboBoxMLEndPoint, QOverload<int>::of(&QComboBox::currentIndexChanged), this, connect(uiTabPaths->comboBoxMLEndPoint, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
&DialogSeamAllowance::MirrorLineEndPointChanged); &DialogSeamAllowance::MirrorLinePointChanged);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -96,8 +96,7 @@ private slots:
void PassmarkChanged(int index); void PassmarkChanged(int index);
void CSAStartPointChanged(int index); void CSAStartPointChanged(int index);
void CSAEndPointChanged(int index); void CSAEndPointChanged(int index);
void MirrorLineStartPointChanged(int index); void MirrorLinePointChanged(int index);
void MirrorLineEndPointChanged(int index);
void CSAIncludeTypeChanged(int index); void CSAIncludeTypeChanged(int index);
void NodeAngleChanged(int index); void NodeAngleChanged(int index);
void ReturnDefBefore(); void ReturnDefBefore();

View File

@ -1224,7 +1224,7 @@ void ColorPickerButton::focusInEvent(QFocusEvent *e)
{ {
setFrameShadow(Raised); setFrameShadow(Raised);
update(); update();
QFrame::focusOutEvent(e); QFrame::focusInEvent(e);
} }
/*! /*!

View File

@ -64,9 +64,9 @@ class QtColorPicker : public QPushButton
Q_PROPERTY(bool colorDialog READ colorDialogEnabled WRITE setColorDialogEnabled) Q_PROPERTY(bool colorDialog READ colorDialogEnabled WRITE setColorDialogEnabled)
public: public:
QtColorPicker(QWidget *parent = 0, int columns = -1, bool enableColorDialog = true); explicit QtColorPicker(QWidget *parent = 0, int columns = -1, bool enableColorDialog = true);
~QtColorPicker(); ~QtColorPicker() override;
void insertColor(const QColor &color, const QString &text = QString(), int index = -1); void insertColor(const QColor &color, const QString &text = QString(), int index = -1);
@ -90,7 +90,7 @@ Q_SIGNALS:
void colorChanged(const QColor &); void colorChanged(const QColor &);
protected: protected:
void paintEvent(QPaintEvent *e); void paintEvent(QPaintEvent *e) override;
private Q_SLOTS: private Q_SLOTS:
void buttonPressed(bool toggled); void buttonPressed(bool toggled);