27 mLayout =
new QHBoxLayout();
28 mLayout->setMargin( 0 );
29 mLayout->setContentsMargins( 2, 0, 2, 0 );
30 mLayout->setSpacing( 6 );
32 mLineEdit =
new QLineEdit( QString() );
33 mLineEdit->setDisabled(
true );
34 mLineEdit->setFrame(
false );
35 mLineEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
37 palette.setColor( QPalette::Disabled, QPalette::Text, QPalette::WindowText );
38 mLineEdit->setPalette( palette );
39 mLineEdit->setStyleSheet( QStringLiteral(
"* { background-color: rgba(0, 0, 0, 0); }" ) );
40 mLayout->addWidget( mLineEdit, 10 );
49 mLayout->insertWidget( 0, widget, stretch, Qt::AlignLeft );
53 mLayout->addWidget( widget, stretch, Qt::AlignLeft );
60 mLayout->removeWidget( widget );
65 return mLineEdit->text();
70 mLineEdit->setText( text );
71 mLineEdit->setCursorPosition( 0 );
74 if ( !mTempMessageTimer )
76 mTempMessageTimer =
new QTimer(
this );
79 mTempMessageTimer->start( timeout );
81 else if ( mTempMessageTimer )
83 delete mTempMessageTimer;
84 mTempMessageTimer =
nullptr;
90 mLineEdit->setText( QString() );
Anchor
Placement anchor for widgets.
void clearMessage()
Removes any temporary message being shown.
QString currentMessage() const
Returns the current message shown in the status bar.
void addPermanentWidget(QWidget *widget, int stretch=0, Anchor anchor=AnchorRight)
Adds the given widget permanently to this status bar, reparenting the widget if it isn't already a ch...
Anchor widget to left of status bar.
void showMessage(const QString &message, int timeout=0)
Displays the given message for the specified number of milli-seconds (timeout).
void removeWidget(QWidget *widget)
Removes a widget from the status bar.
Anchor widget to right of status bar.
QgsStatusBar(QWidget *parent=nullptr)
Constructor for QgsStatusBar.