~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to demos/sqlbrowser/main.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 **
 
3
 ** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
 **
 
5
 ** This file is an example program for the Qt SQL module.
 
6
 ** EDITIONS: NOLIMITS
 
7
 **
 
8
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
9
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
10
 **
 
11
 ****************************************************************************/
 
12
 
 
13
#include <qapplication.h>
 
14
#include <qmainwindow.h>
 
15
#include <qmenu.h>
 
16
#include <qmenubar.h>
 
17
#include <qstatusbar.h>
 
18
 
 
19
#include "browser.h"
 
20
 
 
21
 
 
22
int main(int argc, char *argv[])
 
23
{
 
24
    QApplication app(argc, argv);
 
25
 
 
26
    QMainWindow mainWin;
 
27
    mainWin.setWindowTitle(QObject::tr("Qt SQL Browser"));
 
28
 
 
29
    Browser browser(&mainWin);
 
30
    mainWin.setCentralWidget(&browser);
 
31
 
 
32
    QMenu *menu = mainWin.menuBar()->addMenu(QObject::tr("&File"));
 
33
    menu->addAction(QObject::tr("Add &connection"), &browser, SLOT(addConnection()));
 
34
    menu->addSeparator();
 
35
    menu->addAction(QObject::tr("&Quit"), &app, SLOT(quit()));
 
36
 
 
37
    QObject::connect(&browser, SIGNAL(statusMessage(QString)),
 
38
                     mainWin.statusBar(), SLOT(showMessage(QString)));
 
39
    mainWin.show();
 
40
 
 
41
    return app.exec();
 
42
}
 
43