diff options
author | mhengstmengel <mhengstmengel@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-05-19 14:55:06 +0000 |
---|---|---|
committer | mhengstmengel <mhengstmengel@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-05-19 14:55:06 +0000 |
commit | c8a9a32fbefbf1aec0a0f65d4609539f7c34b6aa (patch) | |
tree | f05cc24d7bff1f9a9313e324da493016a3c15c16 /TAO | |
parent | d751d48698853edb34579288376078324155a9dd (diff) | |
download | ATCD-c8a9a32fbefbf1aec0a0f65d4609539f7c34b6aa.tar.gz |
Thu May 19 14:53:55 UTC 2011 Marijke Hengstmengel <mhengstmengel@remedy.nl>
* tests/QtTests/client.cpp:
* tests/QtTests/client.h:
* tests/QtTests/QtTests.mpc:
* tests/QtTests/server.cpp:
* tests/QtTests/test_i.h:
Adapted to qt4.
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/ChangeLog | 9 | ||||
-rw-r--r-- | TAO/tests/QtTests/QtTests.mpc | 6 | ||||
-rw-r--r-- | TAO/tests/QtTests/client.cpp | 21 | ||||
-rw-r--r-- | TAO/tests/QtTests/client.h | 11 | ||||
-rw-r--r-- | TAO/tests/QtTests/server.cpp | 20 | ||||
-rw-r--r-- | TAO/tests/QtTests/test_i.h | 4 |
6 files changed, 45 insertions, 26 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 6aad1f38c5f..1ed9be8031f 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Thu May 19 14:53:55 UTC 2011 Marijke Hengstmengel <mhengstmengel@remedy.nl> + + * tests/QtTests/client.cpp: + * tests/QtTests/client.h: + * tests/QtTests/QtTests.mpc: + * tests/QtTests/server.cpp: + * tests/QtTests/test_i.h: + Adapted to qt4. + Tue May 17 19:20:55 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl> * tests/OBV/Indirection/MessengerServer.cpp: diff --git a/TAO/tests/QtTests/QtTests.mpc b/TAO/tests/QtTests/QtTests.mpc index 95dad19f581..5805f452dcd 100644 --- a/TAO/tests/QtTests/QtTests.mpc +++ b/TAO/tests/QtTests/QtTests.mpc @@ -1,10 +1,10 @@ // -*- MPC -*- // $Id$ -project(*server): taoserver, tao_qtresource { +project(*server): taoserver, tao_qtresource, ace_qt4 { MOC_Files { - test_i.h + test_i.h } Source_Files { @@ -14,7 +14,7 @@ project(*server): taoserver, tao_qtresource { } } -project(*client): taoclient, anytypecode, tao_qtresource { +project(*client): taoclient, anytypecode, tao_qtresource, ace_qt4 { after += *server MOC_Files { diff --git a/TAO/tests/QtTests/client.cpp b/TAO/tests/QtTests/client.cpp index a6b8a2db6e6..d3dd3060694 100644 --- a/TAO/tests/QtTests/client.cpp +++ b/TAO/tests/QtTests/client.cpp @@ -27,7 +27,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) // This may look a bit suspect, but Qt wants the manager widget // as the toplevel widget unlike Xt for display purposes. - app.setMainWidget (&(client.box_)); + app.setActiveWindow (&(client.mainwindow_)); // Show them on Screen client.show (); @@ -96,12 +96,13 @@ void Client::create_widgets (/**/) { // Ewsize the box - this->box_.resize (200,120); + this->mainwindow_.resize (200,120); + this->mainwindow_.setWindowTitle("QtClient"); // Make a pushbutton widget ACE_NEW (this->push_button_, - QPushButton ("Quit", - &this->box_)); + QPushButton ("Quit")); + box_.addWidget(this->push_button_); // Connect the click () SIGNAL routine with the SLOT handler that we // have defined @@ -112,14 +113,15 @@ Client::create_widgets (/**/) // Create a slider widget ACE_NEW (this->slider_, - QSlider (QSlider::Horizontal, - &this->box_, - "Slider")); + QSlider (Qt::Horizontal)); // Add resource for the slider this->slider_->setRange (0, 99); this->slider_->setValue (0); + box_.addWidget(this->slider_); + + // Connect the valuechanged SIGNAL routine with the slot that we // have defined. THe slot routine would invoke the remote call. QObject::connect (this->slider_, @@ -127,12 +129,15 @@ Client::create_widgets (/**/) this, SLOT (remote_call (int))); + this->mainwindow_.setlayout(&box); + + } void Client::show (void) { - this->box_.show (); + this->mainwindow_.show (); } void diff --git a/TAO/tests/QtTests/client.h b/TAO/tests/QtTests/client.h index c127b30a509..f496b7d43a6 100644 --- a/TAO/tests/QtTests/client.h +++ b/TAO/tests/QtTests/client.h @@ -15,10 +15,10 @@ #include "testC.h" -#include <qapplication.h> -#include <qvbox.h> -#include <qslider.h> -#include <qpushbutton.h> +#include <QtCore/qapplication.h> +#include <QtGui/qboxlayout.h> +#include <QtGui/qslider.h> +#include <QtGui/qpushbutton.h> class Client : public QObject { @@ -40,7 +40,8 @@ public: void parse_args (int argc, ACE_TCHAR *argv[]); /// A box widget.. - QVBox box_; + QHBoxLayout box_; + QWidget mainwindow_; public slots: /// Two slot handlers for the two widgets that we have diff --git a/TAO/tests/QtTests/server.cpp b/TAO/tests/QtTests/server.cpp index 14e8ab57a81..6552506e4b8 100644 --- a/TAO/tests/QtTests/server.cpp +++ b/TAO/tests/QtTests/server.cpp @@ -8,9 +8,9 @@ #undef index #endif #include "tao/QtResource/QtResource_Loader.h" -#include <qlcdnumber.h> -#include <qvbox.h> -#include <qslider.h> +#include <QtGui/qlcdnumber.h> +#include <QtGui/qboxlayout.h> +#include <QtGui/qslider.h> #include "ace/OS_NS_stdio.h" @@ -87,10 +87,13 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) LCD_Display::_narrow (object.in ()); // Create the LCD after the QVbox is created. - QVBox box; + QWidget mainwindow_; + mainwindow_.resize (145, 100); + mainwindow_.setWindowTitle("QtServer"); - box.resize (145, 100); - QLCDNumber lcd (2, &box, "lcd_display"); + QVBoxLayout *box = new QVBoxLayout(); + QLCDNumber lcd (2); + box->addWidget(&lcd); // Connect the signal from the hosted servant with the public // SLOT method display () for the LCD Widget. @@ -100,8 +103,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) &lcd, SLOT (display (int))); - app.setMainWidget(&box); - box.show (); + mainwindow_.setLayout(box); + app.setActiveWindow(&(mainwindow_)); + mainwindow_.show (); // End of QT specific stuff.. diff --git a/TAO/tests/QtTests/test_i.h b/TAO/tests/QtTests/test_i.h index 4c61fc41305..193e6e5655e 100644 --- a/TAO/tests/QtTests/test_i.h +++ b/TAO/tests/QtTests/test_i.h @@ -14,8 +14,8 @@ #include "testS.h" -#include <qapplication.h> -#include <qobject.h> +#include <QtGui/qapplication.h> +#include <QtCore/qobject.h> class LCD_Display_imp : public QObject, public POA_LCD_Display |