contactengine/mainwindow.cpp
changeset 30 33e489bb7487
parent 25 adbe71832e2b
child 34 93c5a58496b6
equal deleted inserted replaced
29:a9f1d0e21384 30:33e489bb7487
     1 #include <QComboBox>
     1 #include <QComboBox>
       
     2 #include <QMenuBar>
     2 #include <QMessageBox>
     3 #include <QMessageBox>
     3 
     4 
     4 #include <QDebug>
     5 #include <QDebug>
     5 
     6 
     6 #include "mainwindow.h"
     7 #include "mainwindow.h"
    22 
    23 
    23     this->ce->createManager();
    24     this->ce->createManager();
    24 
    25 
    25     ui->comboBox->addItems(this->ce->dataSources());
    26     ui->comboBox->addItems(this->ce->dataSources());
    26     ui->listView->setModel(this->ce);
    27     ui->listView->setModel(this->ce);
       
    28 
       
    29     this->createMenus();
       
    30 }
       
    31 
       
    32 void MainWindow::createMenus()
       
    33     {
       
    34         verAction = new QAction(tr("&Version"),this);
       
    35         menuBar()->addAction(verAction);
       
    36         connect(verAction, SIGNAL(triggered()),this, SLOT(displayVersion()));
       
    37 
       
    38         exitAction = new QAction(tr("&Exit"),this);
       
    39         menuBar()->addAction(exitAction);
       
    40         connect(exitAction, SIGNAL(triggered()),this, SLOT(close()));
       
    41     }
       
    42 
       
    43 void MainWindow::displayVersion()
       
    44 {
       
    45     QMessageBox::information(this,"Qt Version", qVersion());
    27 }
    46 }
    28 
    47 
    29 void MainWindow::errorOccurred(QString errMsg)
    48 void MainWindow::errorOccurred(QString errMsg)
    30 {
    49 {
    31     QMessageBox::warning(this,"Err Routed",errMsg);
    50     QMessageBox::information(this,"Err Routed",errMsg);
    32     qDebug() << errMsg << endl;
    51     qDebug() << errMsg << endl;
    33 }
    52 }
    34 
    53 
    35 MainWindow::~MainWindow()
    54 MainWindow::~MainWindow()
    36 {
    55 {