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:
@@ -28,7 +28,7 @@
|
||||
*/
|
||||
TitleBlockTemplateCellWidget::TitleBlockTemplateCellWidget(TitleBlockTemplate *parent_template, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
read_only(false)
|
||||
read_only_(false)
|
||||
{
|
||||
initWidgets();
|
||||
updateLogosComboBox(parent_template);
|
||||
@@ -316,6 +316,25 @@ void TitleBlockTemplateCellWidget::updateLogosComboBox(const TitleBlockTemplate
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@param read_only whether this edition widget should be read only
|
||||
*/
|
||||
void TitleBlockTemplateCellWidget::setReadOnly(bool read_only) {
|
||||
if (read_only_ == read_only) return;
|
||||
read_only_ = read_only;
|
||||
|
||||
cell_type_input_ -> setEnabled(!read_only_);
|
||||
logo_input_ -> setEnabled(!read_only_);
|
||||
name_input_ -> setReadOnly(read_only_);
|
||||
label_checkbox_ -> setEnabled(!read_only_);
|
||||
label_edit_ -> setEnabled(!read_only_);
|
||||
value_edit_ -> setEnabled(!read_only_);
|
||||
horiz_align_input_ -> setEnabled(!read_only_);
|
||||
vert_align_input_ -> setEnabled(!read_only_);
|
||||
font_size_input_ -> setReadOnly(read_only_);
|
||||
font_adjust_input_ -> setEnabled(!read_only_);
|
||||
}
|
||||
|
||||
/**
|
||||
Emit a horizontal alignment modification command.
|
||||
@see ModifyTitleBlockCellCommand
|
||||
@@ -339,6 +358,13 @@ int TitleBlockTemplateCellWidget::alignment() const {
|
||||
return(horizontalAlignment() | verticalAlignment());
|
||||
}
|
||||
|
||||
/**
|
||||
@return whether this edition widget is read only
|
||||
*/
|
||||
bool TitleBlockTemplateCellWidget::isReadOnly() const {
|
||||
return(read_only_);
|
||||
}
|
||||
|
||||
/**
|
||||
Allow the user to edit a translatable string (e.g. value or label).
|
||||
If the user modified the string, this method emits a
|
||||
|
||||
Reference in New Issue
Block a user