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:
xavier
2012-01-22 14:35:57 +00:00
parent 0e0e4dfc29
commit 21c8ffbd7b
10 changed files with 152 additions and 10 deletions

View File

@@ -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.
*/