[TD]disable crop fields if crop not checked
This commit is contained in:
@@ -62,6 +62,7 @@ TaskActiveView::TaskActiveView(TechDraw::DrawPage* pageFeat)
|
||||
ui->qsbHeight->setUnit(Base::Unit::Length);
|
||||
|
||||
setUiPrimary();
|
||||
connect(ui->cbCrop, &QCheckBox::clicked, this, &TaskActiveView::onCropChanged);
|
||||
}
|
||||
|
||||
TaskActiveView::~TaskActiveView() {}
|
||||
@@ -84,6 +85,8 @@ void TaskActiveView::setUiPrimary()
|
||||
{
|
||||
// Base::Console().Message("TAV::setUiPrimary()\n");
|
||||
setWindowTitle(QObject::tr("ActiveView to TD View"));
|
||||
ui->cbCrop->setChecked(false);
|
||||
enableCrop(false);
|
||||
}
|
||||
|
||||
void TaskActiveView::blockButtons(bool b) { Q_UNUSED(b); }
|
||||
@@ -220,6 +223,17 @@ TechDraw::DrawViewImage* TaskActiveView::createActiveView()
|
||||
return newImg;
|
||||
}
|
||||
|
||||
void TaskActiveView::onCropChanged()
|
||||
{
|
||||
enableCrop(ui->cbCrop->isChecked());
|
||||
}
|
||||
|
||||
void TaskActiveView::enableCrop(bool state)
|
||||
{
|
||||
ui->qsbHeight->setEnabled(state);
|
||||
ui->qsbWidth->setEnabled(state);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
void TaskActiveView::saveButtons(QPushButton* btnOK, QPushButton* btnCancel)
|
||||
|
||||
@@ -70,6 +70,10 @@ protected:
|
||||
void setUiPrimary(void);
|
||||
|
||||
TechDraw::DrawViewImage* createActiveView();
|
||||
void enableCrop(bool state);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onCropChanged();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_TaskActiveView> ui;
|
||||
@@ -80,6 +84,7 @@ private:
|
||||
QPushButton* m_btnOK;
|
||||
QPushButton* m_btnCancel;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user