QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
23 : QDialog( parent, fl )
28 connect( checkBox, &QCheckBox::toggled,
this, &QgsMessageViewer::checkBox_toggled );
31 setAttribute( Qt::WA_DeleteOnClose );
37 txtMessage->setTextInteractionFlags( Qt::TextBrowserInteraction );
38 txtMessage->setOpenExternalLinks(
true );
43 txtMessage->setHtml( msg );
48 txtMessage->setPlainText( msg );
53 txtMessage->append( msg );
80 setWindowTitle( title );
85 checkBox->setText( text );
90 checkBox->setVisible( visible );
95 checkBox->setCheckState( state );
100 return checkBox->checkState();
105 mCheckBoxQgsSettingsLabel = label;
109 void QgsMessageViewer::checkBox_toggled(
bool toggled )
112 if ( !mCheckBoxQgsSettingsLabel.isEmpty() )
115 if ( checkBox->checkState() == Qt::Checked )
116 settings.
setValue( mCheckBoxQgsSettingsLabel,
false );
118 settings.
setValue( mCheckBoxQgsSettingsLabel,
true );
void appendMessage(const QString &message) override
message to be appended to the current text
void setCheckBoxVisible(bool visible)
void setCheckBoxState(Qt::CheckState state)
Qt::CheckState checkBoxState()
void setMessageAsPlainText(const QString &msg)
void setTitle(const QString &title) override
Sets title for the messages.
void setMessageAsHtml(const QString &msg)
This class is a composition of two QSettings instances:
QgsMessageViewer(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, bool deleteOnClose=true)
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...
void setCheckBoxQgsSettingsLabel(const QString &label)
void setMessage(const QString &message, MessageType msgType) override
Sets message, it won't be displayed until.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
MessageType
message can be in plain text or in html format
void showMessage(bool blocking=true) override
display the message to the user and deletes itself
Temporarily removes all cursor overrides for the QApplication for the lifetime of the object.
void setCheckBoxText(const QString &text)