| 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>
|
|---|
| 21 | class QLabel;
|
|---|
| 22 | class QCheckBox;
|
|---|
| 23 | class QProgressBar;
|
|---|
| 24 | class QTabWidget;
|
|---|
| 25 | class QGroupBox;
|
|---|
| 26 | class QMultiLineEdit;
|
|---|
| 27 | class QPopupMenu;
|
|---|
| 28 |
|
|---|
| 29 | class MyListView : public QListView
|
|---|
| 30 | {
|
|---|
| 31 | Q_OBJECT
|
|---|
| 32 | public:
|
|---|
| 33 | MyListView( QWidget * parent = 0, const char *name = 0 )
|
|---|
| 34 | : QListView( parent, name ), selected(0)
|
|---|
| 35 | {}
|
|---|
| 36 | ~MyListView()
|
|---|
| 37 | {}
|
|---|
| 38 | protected:
|
|---|
| 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 |
|
|---|
| 54 | signals:
|
|---|
| 55 | void mySelectionChanged();
|
|---|
| 56 | void mySelectionChanged( QListViewItem* );
|
|---|
| 57 |
|
|---|
| 58 | private:
|
|---|
| 59 | QListViewItem* selected;
|
|---|
| 60 |
|
|---|
| 61 | };
|
|---|
| 62 | //
|
|---|
| 63 | // WidgetView contains lots of Qt widgets.
|
|---|
| 64 | //
|
|---|
| 65 |
|
|---|
| 66 | class WidgetView : public QMainWindow
|
|---|
| 67 | {
|
|---|
| 68 | Q_OBJECT
|
|---|
| 69 | public:
|
|---|
| 70 | WidgetView( QWidget *parent=0, const char *name=0 );
|
|---|
| 71 |
|
|---|
| 72 | public slots:
|
|---|
| 73 | void setStatus(const QString&);
|
|---|
| 74 | void selectionChanged();
|
|---|
| 75 | void selectionChanged( QListViewItem* );
|
|---|
| 76 | void clicked( QListViewItem* );
|
|---|
| 77 | void mySelectionChanged( QListViewItem* );
|
|---|
| 78 |
|
|---|
| 79 | protected slots:
|
|---|
| 80 | virtual void button1Clicked();
|
|---|
| 81 | private 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 |
|
|---|
| 98 | private:
|
|---|
| 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
|
|---|