diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-04-22 03:47:54 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@redhat.com> | 2002-04-22 03:47:54 +0000 |
commit | 23d7d60971b8428429f120cbf77f3fcf70304b67 (patch) | |
tree | fbe23e0aca7302112bfbd30a1c0dedde29396c65 /xembed/tests/qt-client.cpp | |
parent | 7bcfe52e21363072766a7ab428a9ab3e8552f6ff (diff) | |
download | xdg-specs-23d7d60971b8428429f120cbf77f3fcf70304b67.tar.xz |
Mon Apr 22 00:05:41 2002 Owen Taylor <otaylor@redhat.com>
* tests/*: Expand the tests to tests recursively
nested embedders.
Diffstat (limited to 'xembed/tests/qt-client.cpp')
-rw-r--r-- | xembed/tests/qt-client.cpp | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/xembed/tests/qt-client.cpp b/xembed/tests/qt-client.cpp index 04f2223..ef40739 100644 --- a/xembed/tests/qt-client.cpp +++ b/xembed/tests/qt-client.cpp @@ -1,4 +1,5 @@ #include <kapp.h> +#include <qhbox.h> #include <qlabel.h> #include <qlineedit.h> #include <qlayout.h> @@ -8,9 +9,10 @@ #include <qxembed.h> #include "qt-client.h" +#include "qt-common.h" -XEmbedQtButtonBox::XEmbedQtButtonBox (XEmbedQtClient *client) - : QWidget (client) +XEmbedQtButtonBox::XEmbedQtButtonBox (QWidget *parent, XEmbedQtClient *client) + : QWidget (parent) { QHBoxLayout *layout = new QHBoxLayout (this); layout->setAutoAdd (TRUE); @@ -27,22 +29,33 @@ XEmbedQtButtonBox::XEmbedQtButtonBox (XEmbedQtClient *client) XEmbedQtClient::XEmbedQtClient () { - QHBoxLayout *layout = new QHBoxLayout (this); + setFrameStyle (QFrame::Box | QFrame::Sunken); + + QVBoxLayout *vlayout = new QVBoxLayout (this); - layout->setAutoAdd (TRUE); + vlayout->setAutoAdd (TRUE); + vlayout->setMargin (5); - new QLabel ("Qt", this); + hbox_ = new QHBox (this); + + new QLabel ("Qt", hbox_); - new QLineEdit (this); + new QLineEdit (hbox_); QPushButton *button; - button = new QPushButton( "&Close", this ); + button = new QPushButton( "&Close", hbox_ ); QObject::connect (button, SIGNAL(clicked()), this, SLOT(close())); - button = new QPushButton( "&Blink", this ); + button = new QPushButton( "&Blink", hbox_ ); QObject::connect (button, SIGNAL(clicked()), this, SLOT(blink())); + button = new QPushButton( "Add >K+", hbox_ ); + QObject::connect (button, SIGNAL(clicked()), this, SLOT(addGtkChild())); + + button = new QPushButton( "Add &Qt", hbox_ ); + QObject::connect (button, SIGNAL(clicked()), this, SLOT(addQtChild())); + addButtons(); } @@ -57,13 +70,24 @@ XEmbedQtClient::blink() } void +XEmbedQtClient::addGtkChild() +{ + new XEmbedQtChildSite (this, FALSE, FALSE); +} + +void +XEmbedQtClient::addQtChild() +{ + new XEmbedQtChildSite (this, FALSE, TRUE); +} + +void XEmbedQtClient::addButtons () { - XEmbedQtButtonBox *box = new XEmbedQtButtonBox (this); + XEmbedQtButtonBox *box = new XEmbedQtButtonBox (hbox_, this); box->show(); } - int main( int argc, char **argv ) { KApplication a( argc, argv, "qt-client" ); |