mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Added setReadOnly() methods to the title block template editor classes.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1473 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -26,7 +26,8 @@
|
||||
*/
|
||||
TitleBlockDimensionWidget::TitleBlockDimensionWidget(bool complete, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
complete_(complete)
|
||||
complete_(complete),
|
||||
read_only_(false)
|
||||
{
|
||||
initWidgets();
|
||||
initLayouts();
|
||||
@@ -85,6 +86,30 @@ void TitleBlockDimensionWidget::setValue(const TitleBlockDimension &dim) {
|
||||
updateSpinBoxSuffix();
|
||||
}
|
||||
|
||||
/**
|
||||
@return Whether or not this widget should allow edition of the displayed
|
||||
dimension.
|
||||
*/
|
||||
bool TitleBlockDimensionWidget::isReadOnly() const {
|
||||
return(read_only_);
|
||||
}
|
||||
|
||||
/**
|
||||
@param read_only Whether or not this widget should allow edition of the
|
||||
displayed dimension.
|
||||
*/
|
||||
void TitleBlockDimensionWidget::setReadOnly(bool read_only) {
|
||||
if (read_only_ == read_only) return;
|
||||
read_only_ = read_only;
|
||||
|
||||
spinbox_ -> setReadOnly(read_only_);
|
||||
if (complete_) {
|
||||
absolute_button_ -> setEnabled(!read_only_);
|
||||
relative_button_ -> setEnabled(!read_only_);
|
||||
remaining_button_ -> setEnabled(!read_only_);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Initialize the widgets composing the dialog.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user