diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 (patch) | |
tree | 5ac38a06f3dde268dc7927dc155896926aaf7012 /kdeui/tests/kdocktest.cpp | |
download | tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.tar.gz tdelibs-ce4a32fe52ef09d8f5ff1dd22c001110902b60a2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui/tests/kdocktest.cpp')
-rw-r--r-- | kdeui/tests/kdocktest.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/kdeui/tests/kdocktest.cpp b/kdeui/tests/kdocktest.cpp new file mode 100644 index 000000000..c6df63ddb --- /dev/null +++ b/kdeui/tests/kdocktest.cpp @@ -0,0 +1,65 @@ +#include "kdocktest.h" + +#include <kapplication.h> +#include <kiconloader.h> + +#include <qwidget.h> +#include <qstring.h> + +DockTest::DockTest( QWidget* parent ) + : KDockArea( parent ) +{ + m_blueDock = createDockWidget( "Blue Widget", SmallIcon("mail") ); + //m_blueDock->setDetachable( false ); + m_blueDock->setEnableDocking( KDockWidget::DockFullSite ); + KDockWidgetHeader *header = new KDockWidgetHeader( m_blueDock, "Blue Header" ); + header->forceCloseButtonHidden(); + m_blueDock->setHeader( header ); + m_blueDock->setCaption( "Blue" ); + m_blueDock->setGeometry( 50, 50, 100, 100 ); + QWidget *l = new QWidget( m_blueDock ); + l->setBackgroundColor( Qt::blue ); + l->setMinimumSize( 100,100 ); + m_blueDock->setWidget( l ); + + setMainDockWidget( m_blueDock ); + + m_redDock = createDockWidget( "Red Widget", SmallIcon("news") ); + m_redDock->setEnableDocking( KDockWidget::DockFullSite ); + //m_redDock->setDetachable( false ); + header = new KDockWidgetHeader( m_redDock, "Red kHeader" ); + m_redDock->setHeader( header ); + m_redDock->setCaption( "Red" ); + m_redDock->setGeometry( 50, 50, 100, 100 ); + l = new QWidget( m_redDock ); + l->setBackgroundColor( Qt::red ); + l->setMinimumSize( 100,100 ); + m_redDock->setWidget( l ); + m_redDock->manualDock( m_blueDock, KDockWidget::DockLeft, 3000 ); + + m_yellowDock = createDockWidget( "Yellow Widget", SmallIcon("web") ); + m_yellowDock->setEnableDocking( KDockWidget::DockFullSite ); + //m_yellowDock->setDetachable( false ); +// header = new KDockWidgetHeader( m_yellowDock, "Yellow Header" ); + // m_yellowDock->setHeader( header ); + m_yellowDock->setCaption( "Yellow" ); + m_yellowDock->setGeometry( 50, 50, 100, 100 ); + l = new QWidget( m_yellowDock ); + l->setBackgroundColor( Qt::yellow ); + l->setMinimumSize( 100,100 ); + m_yellowDock->setWidget( l ); + m_yellowDock->manualDock( m_blueDock, KDockWidget::DockTop, 5000 ); +} + +int +main( int argc, char** argv ) +{ + KApplication a( argc,argv, "docktest" ); + DockTest* ap = new DockTest(); + ap->setCaption("DockWidget demo"); + a.setMainWidget( ap ); + ap->show(); + return a.exec(); +} + +#include "kdocktest.moc" |