summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/ofileselectormain.cpp
blob: dd3b08cc44578d1a9063b0ebb856dcea22e2ce0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <qwidgetstack.h>
#include <qlayout.h>

#include "ofileselectormain.h"

OFileSelectorMain::OFileSelectorMain( QWidget* parent )
    : QWidget( parent ),   m_tool(0)
{
    m_lay = 0;
    init();
}
OFileSelectorMain::~OFileSelectorMain() {

}
void OFileSelectorMain::setToolbar( QWidget* tool ) {
    delete m_tool;
    m_tool = tool;
    add();
}
void OFileSelectorMain::setWidget( QWidget* wid ) {
    static int i = 0;
    m_stack->addWidget( wid, i );
    m_stack->raiseWidget( i );
    i++;
}
void OFileSelectorMain::add() {
    qWarning("adding items ");
    if (m_tool )
        m_lay->addWidget( m_tool, 0, 0 );

}
void OFileSelectorMain::init() {
    delete m_lay;

    m_lay = new QGridLayout( this, 2, 1 );
    m_lay->setRowStretch( 0,  1 );
    m_lay->setRowStretch( 1,  500 );

    m_stack = new QWidgetStack( this );
    m_lay->addWidget( m_stack, 1, 0 );
}