source: trunk/examples/demo/widgets/widgetsbase_pro.ui.h

Last change on this file was 160, checked in by dmik, 19 years ago

Imported table and iconview modules and a bunch of dependent examples from the official release 3.3.1 from Trolltech.

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