condorabstractview.h

00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 2004-2006 Trolltech AS. All rights reserved.
00004 **
00005 ** This file is part of the example classes of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ****************************************************************************/
00023 
00034 #ifndef CONDORABSTRACTVIEW_H
00035 #define CONDORABSTRACTVIEW_H
00036 
00037 #include <QDebug>
00038 #include <QTreeView>
00039 #include <QTableView>
00040 #include <QContextMenuEvent>
00041 #include <QStandardItemModel>
00042 #include <QSortFilterProxyModel>
00043 #include <QMenu>
00044 #include <QAction>
00045 #include <QInputDialog>
00046 #include <QHeaderView>
00047 #include <QDialog>
00048 #include <QItemSelectionModel>
00049 #include <QTime>
00050 #include <QSettings>
00051 
00052 #define setClassname0(m_name) \
00053  virtual char *getClassname(){return m_name;} \
00054  virtual bool isInstanceOf(const char *classname) \
00055 {return (strcmp(classname,m_name)==0 ? true : false);}
00056 
00057 #define setClassname1(m_name,parent) \
00058  virtual char *getClassname(){return m_name;} \
00059  virtual bool isInstanceOf(const char *classname) \
00060 {return (strcmp(classname,m_name)==0 ? true : parent::isInstanceOf(classname));}
00061 
00062 
00063 
00064 class CondorAbstractView : public QTreeView
00065 {
00066  Q_OBJECT
00067         public:
00069                 setClassname0("abstractview");
00070                 CondorAbstractView();
00071                 CondorAbstractView(QStandardItemModel *);
00072                 ~CondorAbstractView();
00073                 QStandardItemModel *getStandardModel();
00074                 void setStandardModel(QStandardItemModel *);
00075                 QSortFilterProxyModel *getFilterModel();
00076                 void setFilterModel(QSortFilterProxyModel *);
00077 //              void addAction(QAction *);
00078 //              virtual static bool isInstanceOf(CondorAbstractView *);
00079                 //QMenu getMenu();
00080                 int columnCount();
00081                 void setColumn(int);
00082                 int getColumn();
00083         
00084         public slots:
00085                 virtual void filterDialog();
00086                 void clearFilter();
00087                 virtual void hideSelectedColumn();
00088                 virtual void showAllColumns();
00089                 virtual void showColumns(QStringList);
00090                 void resizeColumns();
00091                 void reconfigPaths(QStringList);
00092                 
00093         protected:
00095                 int m_column;
00097                 QMenu m_menu;
00099                 QAction *m_filterAct;
00101                 QAction *m_clearFilterAct;
00103                 QAction *m_hideAct;
00105                 QAction *m_showAllAct;
00107                 QStandardItemModel *m_model;
00109                 QSortFilterProxyModel *m_filterModel;
00111                 QItemSelectionModel *m_selectionModel;
00113                 QStringList m_paths;
00114                 virtual void contextMenuEvent ( QContextMenuEvent * e );
00115                 
00116         private:
00117                 virtual void createActions();
00118                 virtual void readSettings();
00119                 virtual void writeSettings();
00120                 
00121         signals:
00125                 void showedView(QStringList columns);
00129                 void updateModel();
00130 
00131 };
00132 
00133 #endif

Generated on Sun Jan 14 23:38:42 2007 for QCondor by  doxygen 1.4.7