23 #include <QVBoxLayout>
25 #include <QDialogButtonBox>
33 QVBoxLayout *commentLayout =
new QVBoxLayout();
34 commentLayout->addWidget(
new QLabel( tr(
"Title" ) ) );
35 mCommentEdit =
new QTextEdit();
36 mCommentEdit->setAcceptRichText(
false );
37 mCommentEdit->setText( box.description() );
38 commentLayout->addWidget( mCommentEdit, 1 );
40 QHBoxLayout *hl =
new QHBoxLayout();
41 hl->setContentsMargins( 0, 0, 0, 0 );
42 hl->addWidget(
new QLabel( tr(
"Color" ) ) );
45 mCommentColorButton->setWindowTitle( tr(
"Comment Color" ) );
46 mCommentColorButton->
setShowNull(
true, tr(
"Default" ) );
48 if ( box.color().isValid() )
49 mCommentColorButton->
setColor( box.color() );
53 hl->addWidget( mCommentColorButton );
54 commentLayout->addLayout( hl );
56 QDialogButtonBox *bbox =
new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Ok );
57 connect( bbox, &QDialogButtonBox::accepted,
this, &QgsModelGroupBoxDefinitionDialog::accept );
58 connect( bbox, &QDialogButtonBox::rejected,
this, &QgsModelGroupBoxDefinitionDialog::reject );
60 commentLayout->addWidget( bbox );
61 setLayout( commentLayout );
62 setWindowTitle( tr(
"Group Box Properties" ) );
63 setObjectName( QStringLiteral(
"QgsModelGroupBoxDefinitionWidget" ) );
66 mCommentEdit->setFocus();
67 mCommentEdit->selectAll();
72 QgsProcessingModelGroupBox box = mBox;
73 box.setColor( mCommentColorButton->
isNull() ? QColor() : mCommentColorButton->
color() );
74 box.setDescription( mCommentEdit->toPlainText() );
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
QgsModelGroupBoxDefinitionDialog(const QgsProcessingModelGroupBox &box, QWidget *parent=nullptr)
Constructor for QgsModelGroupBoxDefinitionWidget, for the specified group box.
QgsProcessingModelGroupBox groupBox() const
Returns a new instance of the group box, using the current settings defined in the dialog.