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 );
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...
MessageType
message can be in plain text or in html format
void setCheckBoxQgsSettingsLabel(const QString &label)
void setTitle(const QString &title) override
Sets title for the messages.
void setCheckBoxVisible(bool visible)
void setMessageAsPlainText(const QString &msg)
void setCheckBoxState(Qt::CheckState state)
void setMessage(const QString &message, MessageType msgType) override
Sets message, it won't be displayed until.
void showMessage(bool blocking=true) override
display the message to the user and deletes itself
void setMessageAsHtml(const QString &msg)
QgsMessageViewer(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, bool deleteOnClose=true)
void setCheckBoxText(const QString &text)
Qt::CheckState checkBoxState()
void appendMessage(const QString &message) override
message to be appended to the current text
This class is a composition of two QSettings instances:
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
Temporarily removes all cursor overrides for the QApplication for the lifetime of the object.