1 | #include <qobjectlist.h>
|
---|
2 |
|
---|
3 | void WidgetsBase::init()
|
---|
4 | {
|
---|
5 | timeEdit->setTime( QTime::currentTime() );
|
---|
6 | dateEdit->setDate( QDate::currentDate() );
|
---|
7 | }
|
---|
8 |
|
---|
9 | void WidgetsBase::destroy()
|
---|
10 | {
|
---|
11 |
|
---|
12 | }
|
---|
13 |
|
---|
14 | void WidgetsBase::resetColors()
|
---|
15 | {
|
---|
16 | groupBox->setPalette( palette(), FALSE );
|
---|
17 | QObjectList *chldn = groupBox->queryList();
|
---|
18 | if ( chldn ) {
|
---|
19 | for(QObject *obj=chldn->first(); obj; obj = chldn->next()) {
|
---|
20 | if(obj->isWidgetType()) {
|
---|
21 | QWidget *w = (QWidget *)obj;
|
---|
22 | if(!w->isTopLevel())
|
---|
23 | w->setPalette(palette(), FALSE);
|
---|
24 | }
|
---|
25 | }
|
---|
26 | }
|
---|
27 | }
|
---|
28 |
|
---|
29 | void WidgetsBase::setColor( const QString & color )
|
---|
30 | {
|
---|
31 | groupBox->setPalette( QColor( color ), FALSE );
|
---|
32 | QObjectList *chldn = groupBox->queryList();
|
---|
33 | if ( chldn ) {
|
---|
34 | for(QObject *obj=chldn->first(); obj; obj = chldn->next()) {
|
---|
35 | if(obj->isWidgetType()) {
|
---|
36 | QWidget *w = (QWidget *)obj;
|
---|
37 | if(!w->isTopLevel())
|
---|
38 | w->setPalette(QColor(color), FALSE);
|
---|
39 | }
|
---|
40 | }
|
---|
41 | }
|
---|
42 | }
|
---|
43 |
|
---|
44 | void WidgetsBase::setColor()
|
---|
45 | {
|
---|
46 | setColor( lineEdit->text() );
|
---|
47 | }
|
---|
48 |
|
---|
49 | void WidgetsBase::updateClock()
|
---|
50 | {
|
---|
51 | clock->setTime( timeEdit->time() );
|
---|
52 | }
|
---|
53 |
|
---|
54 | void WidgetsBase::updateColorTest( const QString & color )
|
---|
55 | {
|
---|
56 | colorTest->setPalette( QColor( color ), TRUE);
|
---|
57 | }
|
---|
58 |
|
---|
59 | void WidgetsBase::updateDateTimeString()
|
---|
60 | {
|
---|
61 | QDateTime dt;
|
---|
62 | dt.setDate( dateEdit->date() );
|
---|
63 | dt.setTime( timeEdit->time() );
|
---|
64 | dateTimeLabel->setText( dt.toString() );
|
---|
65 | }
|
---|
66 |
|
---|