Diffstat (limited to 'libopie/ofileselector/ofileselectormain.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/ofileselector/ofileselectormain.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libopie/ofileselector/ofileselectormain.cpp b/libopie/ofileselector/ofileselectormain.cpp new file mode 100644 index 0000000..dd3b08c --- a/dev/null +++ b/libopie/ofileselector/ofileselectormain.cpp | |||
@@ -0,0 +1,41 @@ | |||
1 | #include <qwidgetstack.h> | ||
2 | #include <qlayout.h> | ||
3 | |||
4 | #include "ofileselectormain.h" | ||
5 | |||
6 | OFileSelectorMain::OFileSelectorMain( QWidget* parent ) | ||
7 | : QWidget( parent ), m_tool(0) | ||
8 | { | ||
9 | m_lay = 0; | ||
10 | init(); | ||
11 | } | ||
12 | OFileSelectorMain::~OFileSelectorMain() { | ||
13 | |||
14 | } | ||
15 | void OFileSelectorMain::setToolbar( QWidget* tool ) { | ||
16 | delete m_tool; | ||
17 | m_tool = tool; | ||
18 | add(); | ||
19 | } | ||
20 | void OFileSelectorMain::setWidget( QWidget* wid ) { | ||
21 | static int i = 0; | ||
22 | m_stack->addWidget( wid, i ); | ||
23 | m_stack->raiseWidget( i ); | ||
24 | i++; | ||
25 | } | ||
26 | void OFileSelectorMain::add() { | ||
27 | qWarning("adding items "); | ||
28 | if (m_tool ) | ||
29 | m_lay->addWidget( m_tool, 0, 0 ); | ||
30 | |||
31 | } | ||
32 | void OFileSelectorMain::init() { | ||
33 | delete m_lay; | ||
34 | |||
35 | m_lay = new QGridLayout( this, 2, 1 ); | ||
36 | m_lay->setRowStretch( 0, 1 ); | ||
37 | m_lay->setRowStretch( 1, 500 ); | ||
38 | |||
39 | m_stack = new QWidgetStack( this ); | ||
40 | m_lay->addWidget( m_stack, 1, 0 ); | ||
41 | } | ||