summaryrefslogtreecommitdiffstats
path: root/demos/mdiarea/main.cpp
blob: 949d16cf6c8aeb14695119dcd40313c698ee26ba (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
#include <QtGui>
#include <QUiLoader>
#include <webclient.h>

QWidget *loadui(const QString &filename)
{
    QUiLoader loader;
    QFile file(filename);
    bool ok = file.open(QFile::ReadOnly);
    if (!ok)
        qWarning("WARNING: Could not open file %s", filename.toLocal8Bit().constData());
    return loader.load(&file, 0);
}

void addSubWindow(QMdiArea *area, const QString &file)
{
    area->addSubWindow(loadui(file));
}

int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    //app.setStyle("plastique");    

    QMdiArea *area = new QMdiArea();
    addSubWindow(area, "buttons.ui");
    addSubWindow(area, "widgets.ui");
    addSubWindow(area, "helpdialog.ui");
    addSubWindow(area, "gdboptionpage.ui");

 //   area->addSubWindow(new QWidget);
    WebClient server;
    server.setRootWidget(area);
    area->show();    
            
    return app.exec();
}