From ffe8a83e053396df448e9413828527613ca3bd46 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:46:43 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmdi/test/hello.cpp | 26 +++++++++++------------ kmdi/test/hello.h | 10 ++++----- kmdi/test/main.cpp | 14 ++++++------- kmdi/test/mainwidget.cpp | 54 ++++++++++++++++++++++++------------------------ kmdi/test/mainwidget.h | 18 ++++++++-------- 5 files changed, 61 insertions(+), 61 deletions(-) (limited to 'kmdi/test') diff --git a/kmdi/test/hello.cpp b/kmdi/test/hello.cpp index f3a10f65c..d92233ea6 100644 --- a/kmdi/test/hello.cpp +++ b/kmdi/test/hello.cpp @@ -9,20 +9,20 @@ *****************************************************************************/ #include "hello.h" -#include -#include -#include -#include +#include +#include +#include +#include /* Constructs a Hello widget. Starts a 40 ms animation timer. */ -Hello::Hello( const char *title, const char *text, QWidget *parentWidget ) +Hello::Hello( const char *title, const char *text, TQWidget *parentWidget ) : KMdiChildView(title, parentWidget), t(text), b(0) { - QTimer *timer = new QTimer(this); - QObject::connect( timer, SIGNAL(timeout()), SLOT(animate()) ); + TQTimer *timer = new TQTimer(this); + TQObject::connect( timer, TQT_SIGNAL(timeout()), TQT_SLOT(animate()) ); timer->start( 40 ); resize( 260, 130 ); @@ -47,7 +47,7 @@ void Hello::animate() the widget. */ -void Hello::mouseReleaseEvent( QMouseEvent *e ) +void Hello::mouseReleaseEvent( TQMouseEvent *e ) { if ( rect().contains( e->pos() ) ) emit clicked(); @@ -61,7 +61,7 @@ void Hello::mouseReleaseEvent( QMouseEvent *e ) pixmap is then blt'ed to the screen. */ -void Hello::paintEvent( QPaintEvent * ) +void Hello::paintEvent( TQPaintEvent * ) { static int sin_tbl[16] = { 0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38}; @@ -70,18 +70,18 @@ void Hello::paintEvent( QPaintEvent * ) return; // 1: Compute some sizes, positions etc. - QFontMetrics fm = fontMetrics(); + TQFontMetrics fm = fontMetrics(); int w = fm.width(t) + 20; int h = fm.height() * 2; int pmx = width()/2 - w/2; int pmy = height()/2 - h/2; // 2: Create the pixmap and fill it with the widget's background - QPixmap pm( w, h ); + TQPixmap pm( w, h ); pm.fill( this, pmx, pmy ); // 3: Paint the pixmap. Cool wave effect - QPainter p; + TQPainter p; int x = 10; int y = h/2 + fm.descent(); int i = 0; @@ -89,7 +89,7 @@ void Hello::paintEvent( QPaintEvent * ) p.setFont( font() ); while ( !t[i].isNull() ) { int i16 = (b+i) & 15; - p.setPen( QColor((15-i16)*16,255,255,QColor::Hsv) ); + p.setPen( TQColor((15-i16)*16,255,255,TQColor::Hsv) ); p.drawText( x, y-sin_tbl[i16]*h/800, t.mid(i,1), 1 ); x += fm.width( t[i] ); i++; diff --git a/kmdi/test/hello.h b/kmdi/test/hello.h index 59c18f3f2..bf57d5e04 100644 --- a/kmdi/test/hello.h +++ b/kmdi/test/hello.h @@ -11,7 +11,7 @@ #ifndef HELLO_H #define HELLO_H -#include +#include #include class QWidget; @@ -22,16 +22,16 @@ class Hello : public KMdiChildView { Q_OBJECT public: - Hello( const char *title, const char *text, QWidget* parentWidget = 0 ); + Hello( const char *title, const char *text, TQWidget* parentWidget = 0 ); signals: void clicked(); protected: - void mouseReleaseEvent( QMouseEvent * ); - void paintEvent( QPaintEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void paintEvent( TQPaintEvent * ); private slots: void animate(); private: - QString t; + TQString t; int b; }; diff --git a/kmdi/test/main.cpp b/kmdi/test/main.cpp index 95d9c2f83..768fd087b 100644 --- a/kmdi/test/main.cpp +++ b/kmdi/test/main.cpp @@ -29,8 +29,8 @@ # include KApplication* theApp; #else -# include - QApplication* theApp; +# include + TQApplication* theApp; #endif //#include @@ -44,7 +44,7 @@ int main( int argc, char **argv ) #ifndef NO_KDE KApplication a(argc,argv,"KFourChildren"); #else - QApplication a(argc,argv); + TQApplication a(argc,argv); #endif theApp = &a; @@ -59,7 +59,7 @@ int main( int argc, char **argv ) // SHOW(h1->caption()); // SHOW(h1->tabCaption()); - QWidget* w = new QWidget(mainWdg); + TQWidget* w = new TQWidget(mainWdg); KMdiChildView* h2 = mainWdg->createWrapper(w, "I'm a common but wrapped QWidget!", "Hello2"); mainWdg->addWindow( h2 ); // SHOW(h2->caption()); @@ -67,20 +67,20 @@ int main( int argc, char **argv ) Hello* h3 = new Hello( "Hello3", "Dock me using the taskbar button context menu!", 0); h3->setBackgroundColor( Qt::white ); - h3->setFont( QFont("times",20,QFont::Bold) ); + h3->setFont( TQFont("times",20,TQFont::Bold) ); mainWdg->addWindow( h3, KMdi::Detach ); // undock this! h3->setGeometry( 20, 20, 400, 100); Hello* h4 = new Hello( "Hello4", "Hello world!", mainWdg); h4->setMDICaption("Hello4 both changed"); - h4->setFont( QFont("times",32,QFont::Bold) ); + h4->setFont( TQFont("times",32,TQFont::Bold) ); mainWdg->addWindow( h4); // SHOW(h4->caption()); // SHOW(h4->tabCaption()); Hello* h5 = new Hello( "Hello5", "I'm not a MDI widget :-("); h5->setGeometry(40, 40, 400, 100); - h5->setFont( QFont("times",20,QFont::Bold) ); + h5->setFont( TQFont("times",20,TQFont::Bold) ); h5->setCaption("MDI Test Application"); h5->show(); diff --git a/kmdi/test/mainwidget.cpp b/kmdi/test/mainwidget.cpp index 872f9df27..b7ac2d31d 100644 --- a/kmdi/test/mainwidget.cpp +++ b/kmdi/test/mainwidget.cpp @@ -15,18 +15,18 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include "mainwidget.h" -MainWidget::MainWidget(QDomElement& dockConfig,KMdi::MdiMode mode) +MainWidget::MainWidget(TQDomElement& dockConfig,KMdi::MdiMode mode) : KMdiMainFrm(0L, "theMDIMainFrm",mode) ,m_dockConfig(dockConfig) { @@ -39,43 +39,43 @@ MainWidget::MainWidget(QDomElement& dockConfig,KMdi::MdiMode mode) readDockConfig(m_dockConfig); } - QMultiLineEdit* mle = new QMultiLineEdit(0L,"theMultiLineEditWidget"); - mle->setText("This is a QMultiLineEdit widget."); + TQMultiLineEdit* mle = new TQMultiLineEdit(0L,"theMultiLineEditWidget"); + mle->setText("This is a TQMultiLineEdit widget."); addToolWindow( mle, KDockWidget::DockBottom, m_pMdi, 70); - QMultiLineEdit* mle2 = new QMultiLineEdit(0L,"theMultiLineEditWidget2"); + TQMultiLineEdit* mle2 = new TQMultiLineEdit(0L,"theMultiLineEditWidget2"); addToolWindow( mle2, KDockWidget::DockCenter, mle, 70); - QMultiLineEdit* mle3 = new QMultiLineEdit(0L,"theMultiLineEditWidget3"); + TQMultiLineEdit* mle3 = new TQMultiLineEdit(0L,"theMultiLineEditWidget3"); addToolWindow( mle3, KDockWidget::DockCenter, mle, 70); - QMultiLineEdit* mle4 = new QMultiLineEdit(0L,"theMultiLineEditWidget4"); + TQMultiLineEdit* mle4 = new TQMultiLineEdit(0L,"theMultiLineEditWidget4"); addToolWindow( mle4, KDockWidget::DockCenter, mle, 70); KMdiToolViewAccessor *tva=createToolWindow(); - tva->setWidgetToWrap(new QMultiLineEdit(tva->wrapperWidget(),"theMultiLineEditWidget5")); + tva->setWidgetToWrap(new TQMultiLineEdit(tva->wrapperWidget(),"theMultiLineEditWidget5")); tva->placeAndShow(KDockWidget::DockCenter,mle,70); - QListView* lv = new QListView(0L,"theListViewWidget"); + TQListView* lv = new TQListView(0L,"theListViewWidget"); #include "../res/filenew.xpm" lv->setIcon(filenew); lv->addColumn("Test", 50); lv->addColumn("KMDI", 70); - new QListViewItem(lv,QString("test"),QString("test")); + new TQListViewItem(lv,TQString("test"),TQString("test")); addToolWindow( lv, KDockWidget::DockLeft, m_pMdi, 35, "1"); - QListView* lv2 = new QListView(0L,"theListViewWidget2"); + TQListView* lv2 = new TQListView(0L,"theListViewWidget2"); lv2->setIcon(filenew); lv2->addColumn("Test2", 50); lv2->addColumn("KMDI2", 70); - new QListViewItem(lv,QString("test2"),QString("test2")); + new TQListViewItem(lv,TQString("test2"),TQString("test2")); addToolWindow( lv2, KDockWidget::DockCenter, lv, 35, "2"); - QListView* lv3 = new QListView(0L,"theListViewWidget3"); + TQListView* lv3 = new TQListView(0L,"theListViewWidget3"); lv3->setIcon(filenew); lv3->addColumn("Test3", 50); lv3->addColumn("KMDI3", 70); - new QListViewItem(lv,QString("test3"),QString("test3")); + new TQListViewItem(lv,TQString("test3"),TQString("test3")); addToolWindow( lv3, KDockWidget::DockCenter, lv, 35, "3"); dockManager->finishReadDockConfig(); @@ -86,9 +86,9 @@ MainWidget::MainWidget(QDomElement& dockConfig,KMdi::MdiMode mode) MainWidget::~MainWidget() { writeDockConfig(m_dockConfig); - QDomDocument doc = m_dockConfig.ownerDocument(); - QString s = doc.toString(); - QFile f("/tmp/dc.txt"); + TQDomDocument doc = m_dockConfig.ownerDocument(); + TQString s = doc.toString(); + TQFile f("/tmp/dc.txt"); f.open(IO_ReadWrite); f.writeBlock(s.latin1(), s.length()); f.close(); @@ -101,7 +101,7 @@ void MainWidget::initMenu() } /** additionally fit the system menu button position to the menu position */ -void MainWidget::resizeEvent( QResizeEvent *pRSE) +void MainWidget::resizeEvent( TQResizeEvent *pRSE) { KMdiMainFrm::resizeEvent( pRSE); setSysButtonsAtMenuPosition(); @@ -110,11 +110,11 @@ void MainWidget::resizeEvent( QResizeEvent *pRSE) RestartWidget::RestartWidget():KMainWindow() { mdimode=KMdi::ChildframeMode; - QVBoxLayout* bl = new QVBoxLayout(this); - QLabel* l = new QLabel("This is for the testing of\nKMdiMainFrm::read/writeDockConfig().\n", this); - QCheckBox* b1 = new QCheckBox("KMdiMainFrm close/restart", this); + TQVBoxLayout* bl = new TQVBoxLayout(this); + TQLabel* l = new TQLabel("This is for the testing of\nKMdiMainFrm::read/writeDockConfig().\n", this); + TQCheckBox* b1 = new TQCheckBox("KMdiMainFrm close/restart", this); b1->toggle(); - QObject::connect(b1, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int))); + TQObject::connect(b1, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(onStateChanged(int))); bl->add(l); bl->add(b1); bl->setMargin(10); diff --git a/kmdi/test/mainwidget.h b/kmdi/test/mainwidget.h index d8f61c1cb..022a3b361 100644 --- a/kmdi/test/mainwidget.h +++ b/kmdi/test/mainwidget.h @@ -18,10 +18,10 @@ #ifndef MAINWIDGET_H #define MAINWIDGET_H -#include -#include -#include -#include +#include +#include +#include +#include #include /** @@ -31,14 +31,14 @@ class MainWidget : public KMdiMainFrm { Q_OBJECT public: - MainWidget(QDomElement& dockConfig,KMdi::MdiMode mode); + MainWidget(TQDomElement& dockConfig,KMdi::MdiMode mode); virtual ~MainWidget(); void initMenu(); protected: // Protected methods - virtual void resizeEvent( QResizeEvent *pRSE); + virtual void resizeEvent( TQResizeEvent *pRSE); private: - QDomElement m_dockConfig; + TQDomElement m_dockConfig; }; @@ -61,8 +61,8 @@ private slots: // attributes public: - QDomDocument domDoc; - QDomElement dockConfig; + TQDomDocument domDoc; + TQDomElement dockConfig; KMdi::MdiMode mdimode; private: MainWidget *m_w; -- cgit v1.2.1