annotate examples/dialogs/standarddialogs/main.d @ 414:b2a803c73b89 default tip

Declare tabArray const.
author David Nadlinger <code@klickverbot.at>
date Fri, 06 May 2011 13:39:49 +0200
parents ba1abf81d0e0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
143
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
1 /****************************************************************************
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
2 **
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
4 ** Contact: Qt Software Information (qt-info@nokia.com)
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
5 **
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
6 ** This file is part of the examples of the Qt Toolkit.
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
7 **
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
8 ** $QT_BEGIN_LICENSE:LGPL$
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
9 ** Commercial Usage
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
10 ** Licensees holding valid Qt Commercial licenses may use this file in
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
11 ** accordance with the Qt Commercial License Agreement provided with the
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
12 ** Software or, alternatively, in accordance with the terms contained in
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
13 ** a written agreement between you and Nokia.
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
14 **
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
15 ** GNU Lesser General Public License Usage
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
16 ** Alternatively, this file may be used under the terms of the GNU Lesser
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
17 ** General Public License version 2.1 as published by the Free Software
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
18 ** Foundation and appearing in the file LICENSE.LGPL included in the
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
19 ** packaging of this file. Please review the following information to
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
20 ** ensure the GNU Lesser General Public License version 2.1 requirements
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
21 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
22 **
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
23 ** In addition, as a special exception, Nokia gives you certain
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
24 ** additional rights. These rights are described in the Nokia Qt LGPL
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
26 ** package.
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
27 **
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
28 ** GNU General Public License Usage
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
29 ** Alternatively, this file may be used under the terms of the GNU
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
30 ** General Public License version 3.0 as published by the Free Software
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
31 ** Foundation and appearing in the file LICENSE.GPL included in the
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
32 ** packaging of this file. Please review the following information to
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
33 ** ensure the GNU General Public License version 3.0 requirements will be
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
34 ** met: http://www.gnu.org/copyleft/gpl.html.
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
35 **
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
36 ** If you are unsure which license is appropriate for your use, please
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
37 ** contact the sales department at qt-sales@nokia.com.
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
38 ** $QT_END_LICENSE$
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
39 **
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
40 ****************************************************************************/
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
41 module main;
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
42
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
43
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
44 import qt.core.QTranslator;
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
45 import qt.core.QLocale;
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
46 import qt.core.QLibraryInfo;
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
47 import qt.gui.QApplication;
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
48
215
8aaa84d48451 Improve examples.
SokoL_SD
parents: 143
diff changeset
49 version(D_Version2)
8aaa84d48451 Improve examples.
SokoL_SD
parents: 143
diff changeset
50 import dialog;
8aaa84d48451 Improve examples.
SokoL_SD
parents: 143
diff changeset
51 else
8aaa84d48451 Improve examples.
SokoL_SD
parents: 143
diff changeset
52 import dialog_d1;
8aaa84d48451 Improve examples.
SokoL_SD
parents: 143
diff changeset
53
143
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
54
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
55
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
56 int main(string[] args)
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
57 {
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
58 scope app = new QApplication(args);
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
59
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
60 string translatorFileName = "qt_";
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
61 translatorFileName ~= QLocale.system().name();
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
62 QTranslator translator = new QTranslator(app);
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
63 if (translator.load(translatorFileName, QLibraryInfo.location(QLibraryInfo.TranslationsPath)))
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
64 app.installTranslator(translator);
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
65
408
ba1abf81d0e0 fix crash of the example upon exit
Eldar Insafutdinov
parents: 215
diff changeset
66 scope dialog = new Dialog;
143
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
67 return dialog.exec();
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
68 }