comparison demos/deform/main.d @ 161:849b66609571

a few fixes
author mwarning
date Wed, 17 Jun 2009 22:39:42 +0000
parents 691e68637348
children ab01453c9d56
comparison
equal deleted inserted replaced
160:624b4a58556e 161:849b66609571
36 ** If you are unsure which license is appropriate for your use, please 36 ** If you are unsure which license is appropriate for your use, please
37 ** contact the sales department at qt-sales@nokia.com. 37 ** contact the sales department at qt-sales@nokia.com.
38 ** $QT_END_LICENSE$ 38 ** $QT_END_LICENSE$
39 ** 39 **
40 ****************************************************************************/ 40 ****************************************************************************/
41 module main;
41 42
42 import 43
43 pathdeform, 44 import qt.gui.QApplication;
44 arthurstyle, 45 import pathdeform;
45 qt.gui.QApplication; 46 import arthurstyle;
46 47
47 48
48 int main(string[] args) 49 int main(string[] args)
49 { 50 {
50 //Q_INIT_RESOURCE(deform); 51 scope app = new QApplication(args);
51 52
52 scope app = new QApplication(args); 53 bool smallScreen = false;
54 foreach (arg; args)
55 {
56 if (arg == "-small-screen")
57 smallScreen = true;
58 }
53 59
54 bool smallScreen = false; 60 scope deformWidget = new PathDeformWidget(null, smallScreen);
55 foreach (arg; args)
56 {
57 if (arg == "-small-screen")
58 smallScreen = true;
59 }
60 61
61 scope deformWidget = new PathDeformWidget(null, smallScreen); 62 QStyle arthurStyle = new ArthurStyle();
63 deformWidget.setWidgetStyle(arthurStyle);
64 QWidget[] widgets; // = qFindChildren!(QWidget)(deformWidget); //TODO
65 foreach (w; widgets)
66 w.setStyle(arthurStyle);
62 67
63 QStyle arthurStyle = new ArthurStyle(); 68 if (smallScreen)
64 deformWidget.setWidgetStyle(arthurStyle); 69 deformWidget.showFullScreen();
65 auto widgets = deformWidget.findChildren!(QWidget); 70 else
66 foreach (w; widgets) 71 deformWidget.show();
67 w.setStyle(arthurStyle);
68 72
69 if (smallScreen) 73 return app.exec();
70 deformWidget.showFullScreen();
71 else
72 deformWidget.show();
73
74 return app.exec();
75 } 74 }