Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

GenericTreeViewPage_wdgt.h

00001 /***************************************************************************
00002  *   Copyright (C) 2006 by Graeme Foster                                   *
00003  *   email    foster.graeme@gmail.com                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef __GENERIC_TREE_VIEW_PAGE_WDGT_H
00022 #define __GENERIC_TREE_VIEW_PAGE_WDGT_H
00023 
00024 #include "ui_GenericTreeViewPage_wdgt.h"
00025 #include "RootPage_wdgt.h"
00026 
00027 #include "InstModel.h"
00028 
00029 class GenericTreeViewPageWidget : public RootPageWidget
00030 {
00031     Q_OBJECT
00032 
00033 public: // methods
00034         GenericTreeViewPageWidget(ControlPanel * window
00035                                  ,QWidget * widgetParent
00036                                  ,QBoxLayout * layoutParent
00037                                  ,dbListManager * pDataLists);
00038         inline RootItem * getSelectedItem();
00039 protected: // Properties
00040         Ui::GenericTreeViewPage_wdgt wdgt;
00041         RootItem * selectedItem;
00042         QString    rootSubtype;
00043 protected: // methods
00044         virtual void init()=0;
00045         void initTabBtns(RootItem * obj);
00046         bool eventFilter(QObject * target, QEvent * event);
00047 private: // Methods
00048         void treeViewClicked(const QModelIndex & index);
00049         void createActions();
00050 
00051 protected slots:
00052         virtual void btnAddClicked()=0;
00053         virtual void btnNewClicked()=0;
00054         virtual void btnModClicked()=0;
00055         virtual void btnDelClicked()=0;
00056 
00057 private slots:
00058         void itemClicked(const QModelIndex & index);
00059 };
00060 
00061 inline RootItem * GenericTreeViewPageWidget::getSelectedItem()
00062 {
00063         return static_cast<RootItem*>(wdgt.treeView->currentIndex().internalPointer());
00064 }
00065 
00066 #endif

Generated on Thu Apr 6 16:27:17 2006 for time-table by  doxygen 1.4.4