Move icon connection to constructor

This commit is contained in:
Till Frankenbach 2025-06-18 12:43:25 +02:00 committed by Nyall Dawson
parent 79900171f8
commit 89dbd5c71a

View File

@ -41,6 +41,10 @@ QgsMessageLogViewer::QgsMessageLogViewer( QWidget *parent, Qt::WindowFlags fl )
connect( tabWidget, &QTabWidget::tabCloseRequested, this, &QgsMessageLogViewer::closeTab );
connect( tabWidget, &QTabWidget::currentChanged, this, [this]( int index ) {
tabWidget->setTabIcon( index, QIcon() );
} );
mTabBarContextMenu = new QMenu( this );
tabWidget->tabBar()->setContextMenuPolicy( Qt::CustomContextMenu );
connect( tabWidget->tabBar(), &QWidget::customContextMenuRequested, this, &QgsMessageLogViewer::showContextMenuForTabBar );
@ -131,9 +135,6 @@ void QgsMessageLogViewer::logMessage( const QString &message, const QString &tag
w->setReadOnly( true );
w->viewport()->installEventFilter( this );
i = tabWidget->addTab( w, QgsApplication::getThemeIcon( QStringLiteral( "mMessageLog.svg" ) ), cleanedTag );
connect( tabWidget, &QTabWidget::currentChanged, this, [this]( int index ) {
tabWidget->setTabIcon( index, QIcon() );
} );
}
QString levelString;