From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/sql/sqloutputwidget.cpp | 70 +++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'languages/sql/sqloutputwidget.cpp') diff --git a/languages/sql/sqloutputwidget.cpp b/languages/sql/sqloutputwidget.cpp index a0d7368d..f7d84fde 100644 --- a/languages/sql/sqloutputwidget.cpp +++ b/languages/sql/sqloutputwidget.cpp @@ -9,16 +9,16 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include @@ -27,56 +27,56 @@ class QCustomSqlCursor: public QSqlCursor { public: - QCustomSqlCursor( const QString & query = QString::null, bool autopopulate = TRUE, QSqlDatabase* db = 0 ) : - QSqlCursor( QString::null, autopopulate, db ) + QCustomSqlCursor( const TQString & query = TQString::null, bool autopopulate = TRUE, TQSqlDatabase* db = 0 ) : + TQSqlCursor( TQString::null, autopopulate, db ) { exec( query ); if ( isSelect() && autopopulate ) { - QSqlRecordInfo inf = ((QSqlQuery*)this)->driver()->recordInfo( *(QSqlQuery*)this ); - for ( QSqlRecordInfo::iterator it = inf.begin(); it != inf.end(); ++it ) { + TQSqlRecordInfo inf = ((TQSqlQuery*)this)->driver()->recordInfo( *(TQSqlQuery*)this ); + for ( TQSqlRecordInfo::iterator it = inf.begin(); it != inf.end(); ++it ) { append( *it ); } } - setMode( QSqlCursor::ReadOnly ); + setMode( TQSqlCursor::ReadOnly ); } - QCustomSqlCursor( const QCustomSqlCursor & other ): QSqlCursor( other ) {} - bool select( const QString & /*filter*/, const QSqlIndex & /*sort*/ = QSqlIndex() ) + QCustomSqlCursor( const QCustomSqlCursor & other ): TQSqlCursor( other ) {} + bool select( const TQString & /*filter*/, const TQSqlIndex & /*sort*/ = TQSqlIndex() ) { return exec( lastQuery() ); } - QSqlIndex primaryIndex( bool /*prime*/ = TRUE ) const - { return QSqlIndex(); } + TQSqlIndex primaryIndex( bool /*prime*/ = TRUE ) const + { return TQSqlIndex(); } int insert( bool /*invalidate*/ = TRUE ) { return FALSE; } int update( bool /*invalidate*/ = TRUE ) { return FALSE; } int del( bool /*invalidate*/ = TRUE ) { return FALSE; } - void setName( const QString& /*name*/, bool /*autopopulate*/ = TRUE ) {} + void setName( const TQString& /*name*/, bool /*autopopulate*/ = TRUE ) {} }; -SqlOutputWidget::SqlOutputWidget ( QWidget* parent, const char* name ) : - QWidget( parent, name ) +SqlOutputWidget::SqlOutputWidget ( TQWidget* parent, const char* name ) : + TQWidget( parent, name ) { - m_stack = new QWidgetStack( this ); - m_table = new QDataTable( this ); - m_textEdit = new QTextEdit( this ); + m_stack = new TQWidgetStack( this ); + m_table = new TQDataTable( this ); + m_textEdit = new TQTextEdit( this ); - m_textEdit->setTextFormat( QTextEdit::RichText ); + m_textEdit->setTextFormat( TQTextEdit::RichText ); m_textEdit->setReadOnly( true ); m_stack->addWidget( m_textEdit ); m_stack->addWidget( m_table ); - QVBoxLayout* layout = new QVBoxLayout( this ); + TQVBoxLayout* layout = new TQVBoxLayout( this ); layout->addWidget( m_stack ); } SqlOutputWidget::~SqlOutputWidget() {} -void SqlOutputWidget::showQuery( const QString& connectionName, const QString& query ) +void SqlOutputWidget::showQuery( const TQString& connectionName, const TQString& query ) { - QSqlDatabase* db = QSqlDatabase::database( connectionName, true ); + TQSqlDatabase* db = TQSqlDatabase::database( connectionName, true ); if ( !db ) { showError( i18n("No such connection: %1").arg( connectionName ) ); return; @@ -86,12 +86,12 @@ void SqlOutputWidget::showQuery( const QString& connectionName, const QString& q return; } - QSqlCursor* cur = new QCustomSqlCursor( query, true, db ); + TQSqlCursor* cur = new QCustomSqlCursor( query, true, db ); if ( !cur->isActive() ) { showError( cur->lastError() ); } else if ( cur->isSelect() ) { m_table->setSqlCursor( cur, true, true ); - m_table->refresh( QDataTable::RefreshAll ); + m_table->refresh( TQDataTable::RefreshAll ); m_stack->raiseWidget( m_table ); } else { showSuccess( cur->numRowsAffected() ); @@ -105,21 +105,21 @@ void SqlOutputWidget::showSuccess( int rowsAffected ) m_stack->raiseWidget( m_textEdit ); } -void SqlOutputWidget::showError( const QString& message ) +void SqlOutputWidget::showError( const TQString& message ) { m_textEdit->clear(); m_textEdit->setText( "

" + i18n("An error occurred:") + "

\n" + message ); m_stack->raiseWidget( m_textEdit ); } -void SqlOutputWidget::showError( const QSqlError& message ) +void SqlOutputWidget::showError( const TQSqlError& message ) { m_textEdit->clear(); m_textEdit->setText( "

" + i18n("An error occurred:") + "

\n

" + i18n("Driver") + ": " + - QStyleSheet::escape( message.driverText() ) + + TQStyleSheet::escape( message.driverText() ) + "
" + i18n("Database") + ":: " + - QStyleSheet::escape( message.databaseText() ) ); + TQStyleSheet::escape( message.databaseText() ) ); m_stack->raiseWidget( m_textEdit ); } -- cgit v1.2.3