itom 2.2.1
K:/git-itom/sources/itom/itomWidgets/treeComboBox.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2016, Institut fuer Technische Optik (ITO),
00005     Universitaet Stuttgart, Germany
00006 
00007     This file is part of itom and its software development toolkit (SDK).
00008 
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013    
00014     In addition, as a special exception, the Institut fuer Technische
00015     Optik (ITO) gives you certain additional rights.
00016     These rights are described in the ITO LGPL Exception version 1.0,
00017     which can be found in the file LGPL_EXCEPTION.txt in this package.
00018 
00019     itom is distributed in the hope that it will be useful, but
00020     WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00022     General Public Licence for more details.
00023 
00024     You should have received a copy of the GNU Library General Public License
00025     along with itom. If not, see <http://www.gnu.org/licenses/>.
00026 
00027     This file is a port and modified version of the 
00028     Common framework (http://www.commontk.org)
00029 *********************************************************************** */
00030 
00031 #ifndef TREECOMBOBOX_H
00032 #define TREECOMBOBOX_H
00033 
00034 // Qt includes
00035 #include <QComboBox>
00036 
00037 // CTK includes
00038 //#include <ctkPimpl.h>
00039 
00040 #include "commonWidgets.h"
00041 
00042 class TreeComboBoxPrivate;
00043 class QTreeView;
00044 
00060 class ITOMWIDGETS_EXPORT TreeComboBox : public QComboBox
00061 {
00062   Q_OBJECT
00065   Q_PROPERTY(int visibleModelColumn READ visibleModelColumn WRITE setVisibleModelColumn)
00066 public:
00067   typedef QComboBox Superclass;
00068   explicit TreeComboBox(QWidget* parent = 0);
00069   virtual ~TreeComboBox();
00070 
00071   int visibleModelColumn()const;
00072   void setVisibleModelColumn(int index);
00073 
00074   virtual bool eventFilter(QObject* object, QEvent* event);
00075   virtual void showPopup();
00076   virtual void hidePopup();
00077   
00081   QTreeView* treeView()const;
00082 
00083 protected:
00084   virtual void paintEvent(QPaintEvent*);
00085   
00086 protected Q_SLOTS:
00087   void resizePopup();
00088   
00089 signals:
00090   void popupShow();
00091   void popupHide();
00092 
00093 protected:
00094   QScopedPointer<TreeComboBoxPrivate> d_ptr;
00095 
00096 private:
00097   Q_DECLARE_PRIVATE(TreeComboBox);
00098   Q_DISABLE_COPY(TreeComboBox);
00099 };
00100 
00101 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends