29 mLayout =
new QHBoxLayout();
30 mLayout->setMargin( 0 );
31 mLayout->setContentsMargins( 2, 0, 2, 0 );
32 mLayout->setSpacing( 6 );
34 mLineEdit =
new QLineEdit( QString() );
35 mLineEdit->setDisabled(
true );
36 mLineEdit->setFrame(
false );
37 mLineEdit->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
38 QPalette palette = mLineEdit->palette();
39 palette.setColor( QPalette::Disabled, QPalette::Text, QPalette::WindowText );
40 mLineEdit->setPalette( palette );
41 mLineEdit->setStyleSheet( QStringLiteral(
"* { border: 0; background-color: rgba(0, 0, 0, 0); }" ) );
42 mLayout->addWidget( mLineEdit, 10 );
51 mLayout->insertWidget( 0, widget, stretch, Qt::AlignLeft );
55 mLayout->addWidget( widget, stretch, Qt::AlignLeft );
62 mLayout->removeWidget( widget );
67 return mLineEdit->text();
72 mLineEdit->setText( text );
73 mLineEdit->setCursorPosition( 0 );
76 if ( !mTempMessageTimer )
78 mTempMessageTimer =
new QTimer(
this );
81 mTempMessageTimer->start( timeout );
83 else if ( mTempMessageTimer )
85 delete mTempMessageTimer;
86 mTempMessageTimer =
nullptr;
92 mLineEdit->setText( QString() );
97 if ( mParentStatusBar )
98 mParentStatusBar->disconnect( mShowMessageConnection );
100 mParentStatusBar = statusBar;
102 if ( mParentStatusBar )
103 mShowMessageConnection = connect( mParentStatusBar, &QStatusBar::messageChanged,
this, [
this](
const QString & message ) {
showMessage( message ); } );
108 QWidget::changeEvent( event );
110 if ( event->type() == QEvent::FontChange )
112 mLineEdit->setFont( font() );