annotate examples/dialogs/classwizard/main.d @ 282:256ab6cb8e85

Signals look-up andNew syntax for connect. The old one will not work from now on. This will allow for the signals overload. Although changes are done for both D1 and D2 versions, D1 won't work because of compiler bugs. I am tired of waiting for fixes.
author eldar
date Fri, 16 Oct 2009 02:43:59 +0000
parents 8aaa84d48451
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 import qt.gui.QApplication;
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
215
8aaa84d48451 Improve examples.
SokoL_SD
parents: 143
diff changeset
48 version(D_Version2)
8aaa84d48451 Improve examples.
SokoL_SD
parents: 143
diff changeset
49 import classwizard;
8aaa84d48451 Improve examples.
SokoL_SD
parents: 143
diff changeset
50 else
8aaa84d48451 Improve examples.
SokoL_SD
parents: 143
diff changeset
51 import classwizard_d1;
143
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
52
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
53 int main(string[] args)
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
54 {
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
55 scope app = new QApplication(args);
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
56
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
57 string translatorFileName = "qt_";
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
58 translatorFileName ~= QLocale.system().name();
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
59 QTranslator translator = new QTranslator(app);
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
60 if (translator.load(translatorFileName, QLibraryInfo.location(QLibraryInfo.TranslationsPath)))
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
61 app.installTranslator(translator);
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
62
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
63 scope wizard = new ClassWizard;
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
64 wizard.show();
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
65 return app.exec();
d010168e50de add classwizard and standarddialogs example
mandel
parents:
diff changeset
66 }