Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef QTXTREEVIEW_H
00024 #define QTXTREEVIEW_H
00025
00026 #include "Qtx.h"
00027
00028 #ifdef WIN32
00029 #pragma warning( disable:4251 )
00030 #endif
00031
00032 #include <QTreeView>
00033
00034 class QTX_EXPORT QtxTreeView : public QTreeView
00035 {
00036 Q_OBJECT
00037
00038 class Header;
00039
00040 public:
00041 QtxTreeView( QWidget* = 0 );
00042 QtxTreeView( const bool, QWidget* = 0 );
00043 virtual ~QtxTreeView();
00044
00045 void expandLevels( const int );
00046 void collapseLevels( const int );
00047
00048 void expandAll( const QModelIndex& );
00049 void collapseAll( const QModelIndex& );
00050
00051 void setSortMenuEnabled( const bool );
00052 bool sortMenuEnabled() const;
00053
00054 void resizeColumnToEncloseContents( int );
00055
00056 virtual void setModel( QAbstractItemModel* );
00057
00058 protected slots:
00059 void onHeaderClicked( int );
00060 void rowsAboutToBeRemoved( const QModelIndex&, int, int );
00061 void selectionChanged( const QItemSelection&, const QItemSelection& );
00062 void onAppropriate( Qt::Orientation, int, int );
00063
00064 protected:
00065 void setOpened( const QModelIndex&, const int, bool );
00066
00067 signals:
00068 void sortingEnabled( bool );
00069 void selectionChanged();
00070
00071 private:
00072 void emitSortingEnabled( bool );
00073
00074 friend class QtxTreeView::Header;
00075 };
00076
00077 #ifdef WIN32
00078 #pragma warning( default:4251 )
00079 #endif
00080
00081 #endif // QTXTREEVIEW_H