1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
|
19 * |
|
20 */ |
|
21 |
|
22 #include <QDebug> |
|
23 #include <xqservicelog.h> |
|
24 #include <QApplication> |
|
25 #include <QKeyEvent> |
|
26 #include <QLabel> |
|
27 #include <QVBoxLayout> |
|
28 #include <QStackedWidget> |
|
29 #include <QImageReader> |
|
30 #include <QDebug> |
|
31 #include <QTimer> |
|
32 #include <QPushButton> |
|
33 #include <QLineEdit> |
|
34 #include <QDebug> |
|
35 #include <QString> |
|
36 #include <QCheckBox> |
|
37 |
|
38 #include <QListView> |
|
39 |
|
40 #include "testapp4.h" |
|
41 #include "testdll.h" |
|
42 |
|
43 |
|
44 TestApp4Widget::TestApp4Widget( QWidget *parent, Qt::WFlags f ) : QWidget( parent,f ) |
|
45 { |
|
46 td = new TestDll(); |
|
47 qDebug() << "[QTH] [TestApp4] TestApp4Widget: START"; |
|
48 QPalette p = qApp->palette(); |
|
49 QColor color(80,20,20); |
|
50 QColor bg(256,20,20); |
|
51 p.setColor(QPalette::Highlight, color.lighter(200)); |
|
52 p.setColor(QPalette::Text, Qt::white); |
|
53 p.setColor(QPalette::Base, bg); |
|
54 p.setColor(QPalette::WindowText, Qt::white); |
|
55 p.setColor(QPalette::Window, bg); |
|
56 p.setColor(QPalette::ButtonText, Qt::white); |
|
57 p.setColor(QPalette::Button, color.lighter(150)); |
|
58 p.setColor(QPalette::Link, QColor(240,40,40)); |
|
59 |
|
60 qApp->setPalette(p); |
|
61 |
|
62 QPushButton *quitButton = new QPushButton(tr("quit")); |
|
63 connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); |
|
64 |
|
65 QPushButton *sendButton = new QPushButton(tr("asynsend 10 times")); |
|
66 connect(sendButton, SIGNAL(clicked()), td, SLOT(asyncsend())); |
|
67 |
|
68 label = new QLabel("Test App4"); |
|
69 |
|
70 QVBoxLayout *vl = new QVBoxLayout; |
|
71 vl->setMargin(0); |
|
72 vl->setSpacing(0); |
|
73 |
|
74 vl->addWidget(label); |
|
75 vl->addWidget(sendButton); |
|
76 vl->addWidget(quitButton); |
|
77 |
|
78 setLayout(vl); |
|
79 |
|
80 showFullScreen(); |
|
81 |
|
82 i = 0; |
|
83 request = NULL; |
|
84 td->asyncsend(); |
|
85 qDebug() << "[QTH] [TestApp4] TestApp4Widget: END"; |
|
86 } |
|
87 |
|
88 int main(int argc, char* argv[]) |
|
89 { |
|
90 qInstallMsgHandler(XQSERVICEMESSAGEHANDLER); |
|
91 qDebug() << "[QTH] [TestApp4] main START"; |
|
92 QApplication a(argc, argv); |
|
93 TestDll* td = new TestDll(&a); |
|
94 td->asyncsend(); |
|
95 |
|
96 //TestApp4Widget* t4 = new TestApp4Widget(); |
|
97 |
|
98 int rv = a.exec(); |
|
99 //delete td; |
|
100 qDebug() << "[QTH] [TestApp4] exits"; |
|
101 qDebug() << "[QTH] [TestApp4] main END"; |
|
102 return rv; |
|
103 } |
|
104 |
|