|
Last change
on this file since 176 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.2 KB
|
| Line | |
|---|
| 1 | /****************************************************************************
|
|---|
| 2 | ** $Id: main.cpp 160 2006-12-11 20:15:57Z dmik $
|
|---|
| 3 | **
|
|---|
| 4 | ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
|
|---|
| 5 | **
|
|---|
| 6 | ** This file is part of an example program for Qt. This example
|
|---|
| 7 | ** program may be used, distributed and modified without limitation.
|
|---|
| 8 | **
|
|---|
| 9 | *****************************************************************************/
|
|---|
| 10 |
|
|---|
| 11 | #include <qapplication.h>
|
|---|
| 12 | #include <qstylefactory.h>
|
|---|
| 13 | #include "widgets.h"
|
|---|
| 14 |
|
|---|
| 15 | class MyWidgetView : public WidgetView
|
|---|
| 16 | {
|
|---|
| 17 | int s;
|
|---|
| 18 | public:
|
|---|
| 19 | MyWidgetView( QWidget *parent=0, const char *name=0 )
|
|---|
| 20 | :WidgetView(parent, name), s(0)
|
|---|
| 21 | {
|
|---|
| 22 | setToolBarsMovable( TRUE );
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | void button1Clicked()
|
|---|
| 26 | {
|
|---|
| 27 | QStringList styles = QStyleFactory::keys();
|
|---|
| 28 |
|
|---|
| 29 | s = (++s)%styles.count();
|
|---|
| 30 | qApp->setStyle( styles[ s] );
|
|---|
| 31 | WidgetView::button1Clicked();
|
|---|
| 32 | }
|
|---|
| 33 | };
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 | //
|
|---|
| 37 | // Create and display our WidgetView.
|
|---|
| 38 | //
|
|---|
| 39 |
|
|---|
| 40 | int main( int argc, char **argv )
|
|---|
| 41 | {
|
|---|
| 42 | QApplication::setColorSpec( QApplication::CustomColor );
|
|---|
| 43 | QApplication a( argc, argv );
|
|---|
| 44 |
|
|---|
| 45 | MyWidgetView* w = new MyWidgetView;
|
|---|
| 46 | a.setMainWidget( w );
|
|---|
| 47 |
|
|---|
| 48 | w->show();
|
|---|
| 49 | int res = a.exec();
|
|---|
| 50 | delete w;
|
|---|
| 51 | return res;
|
|---|
| 52 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.