akonadi/clients
mainwindow.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "mainwindow.h"
00023 #include "mainwidget.h"
00024
00025 #include <QtGui/QGridLayout>
00026 #include <QtGui/QToolBar>
00027 #include <QtGui/QDialog>
00028
00029 #include <KCModuleLoader>
00030
00031 MainWindow::MainWindow( QWidget* parent )
00032 : QMainWindow( parent )
00033 {
00034 QToolBar *toolBar = new QToolBar( QLatin1String( "Main toolbar" ), this );
00035 toolBar->addAction( "Configure ...", this, SLOT( configure() ) );
00036 addToolBar( toolBar );
00037
00038 setCentralWidget( new MainWidget( this ) );
00039 resize( 700, 500 );
00040 }
00041
00042 void MainWindow::configure()
00043 {
00044 QDialog *configDialog = new QDialog( this );
00045 QGridLayout *layout = new QGridLayout();
00046 QWidget *kcmWidget = KCModuleLoader::loadModule( "kcm_akonadi_resources",
00047 KCModuleLoader::Inline, configDialog, QStringList( "text/calendar" ) );
00048 layout->addWidget( kcmWidget );
00049 configDialog->setLayout( layout );
00050 configDialog->show();
00051 }