24 #include <QTableWidget>
25 #include <QToolButton>
28 #include <QDockWidget>
29 #include <QPlainTextEdit>
34 : QDialog( parent, fl )
42 connect( tabWidget, SIGNAL( tabCloseRequested(
int ) ),
this, SLOT( closeTab(
int ) ) );
52 tag =
tr(
"General" );
55 for ( i = 0; i < tabWidget->count() && tabWidget->tabText( i ) != tag; i++ )
59 if ( i < tabWidget->count() )
61 w = qobject_cast<QPlainTextEdit *>( tabWidget->widget( i ) );
62 tabWidget->setCurrentIndex( i );
66 w =
new QPlainTextEdit(
this );
67 w->setReadOnly(
true );
68 tabWidget->addTab( w, tag );
69 tabWidget->setCurrentIndex( tabWidget->count() - 1 );
72 QString prefix = QString(
"%1\t%2\t" )
73 .arg( QDateTime::currentDateTime().toString( Qt::ISODate ) )
75 w->appendPlainText( message.prepend( prefix ).replace(
"\n",
"\n\t\t\t" ) );
76 w->verticalScrollBar()->setValue( w->verticalScrollBar()->maximum() );
79 void QgsMessageLogViewer::closeTab(
int index )
81 tabWidget->removeTab( index );