source: trunk/examples/widgets/widgets.h@ 203

Last change on this file since 203 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: 2.7 KB
Line 
1/****************************************************************************
2** $Id: widgets.h 160 2006-12-11 20:15:57Z dmik $
3**
4** Definition of something or other
5**
6** Created : 979899
7**
8** Copyright (C) 1997 by Trolltech AS. All rights reserved.
9**
10** This file is part of an example program for Qt. This example
11** program may be used, distributed and modified without limitation.
12**
13*****************************************************************************/
14
15#ifndef WIDGETS_H
16#define WIDGETS_H
17
18#include <qmainwindow.h>
19#include <qmovie.h>
20#include <qlistview.h>
21class QLabel;
22class QCheckBox;
23class QProgressBar;
24class QTabWidget;
25class QGroupBox;
26class QMultiLineEdit;
27class QPopupMenu;
28
29class MyListView : public QListView
30{
31 Q_OBJECT
32public:
33 MyListView( QWidget * parent = 0, const char *name = 0 )
34 : QListView( parent, name ), selected(0)
35 {}
36 ~MyListView()
37 {}
38protected:
39
40 void contentsMousePressEvent( QMouseEvent * e )
41 {
42 selected = selectedItem();
43 QListView::contentsMousePressEvent( e );
44 }
45 void contentsMouseReleaseEvent( QMouseEvent * e )
46 {
47 QListView::contentsMouseReleaseEvent( e );
48 if ( selectedItem() != selected ) {
49 emit mySelectionChanged( selectedItem() );
50 emit mySelectionChanged();
51 }
52 }
53
54signals:
55 void mySelectionChanged();
56 void mySelectionChanged( QListViewItem* );
57
58private:
59 QListViewItem* selected;
60
61};
62//
63// WidgetView contains lots of Qt widgets.
64//
65
66class WidgetView : public QMainWindow
67{
68 Q_OBJECT
69public:
70 WidgetView( QWidget *parent=0, const char *name=0 );
71
72public slots:
73 void setStatus(const QString&);
74 void selectionChanged();
75 void selectionChanged( QListViewItem* );
76 void clicked( QListViewItem* );
77 void mySelectionChanged( QListViewItem* );
78
79protected slots:
80 virtual void button1Clicked();
81private slots:
82 void checkBoxClicked( int );
83 void radioButtonClicked( int );
84 void sliderValueChanged( int );
85 void listBoxItemSelected( int );
86 void comboBoxItemActivated( int );
87 void edComboBoxItemActivated( const QString& );
88 void lineEditTextChanged( const QString& );
89 void movieStatus( int );
90 void movieUpdate( const QRect& );
91 void spinBoxValueChanged( const QString& );
92 void popupSelected( int );
93
94 void open();
95 void dummy();
96 void showProperties();
97
98private:
99 bool eventFilter( QObject *, QEvent * );
100 QLabel *msg;
101 QCheckBox *cb[3];
102 QGroupBox* bg;
103 QLabel *movielabel;
104 QMovie movie;
105 QWidget *central;
106 QProgressBar *prog;
107 int progress;
108 QTabWidget* tabs;
109 QMultiLineEdit* edit;
110 QPopupMenu *textStylePopup;
111 int plainStyleID;
112 QWidget* bla;
113};
114
115#endif
Note: See TracBrowser for help on using the repository browser.