customizableheaderview.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2008-2010  Lukas Sommer < SommerLuk at gmail dot com >
00003 
00004     This program is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU General Public License as
00006     published by the Free Software Foundation; either version 2 of
00007     the License or (at your option) version 3 or any later version
00008     accepted by the membership of KDE e.V. (or its successor approved
00009     by the membership of KDE e.V.), which shall act as a proxy
00010     defined in Section 14 of version 3 of the license.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef CUSTOMIZABLEHEADERVIEW_H
00022 #define CUSTOMIZABLEHEADERVIEW_H
00023 
00030 #define KDE4_SUPPORT
00031 
00032 #include <QHeaderView>
00033 
00034 #include <QPointer>
00035 
00048 class CustomizableHeaderView : public QHeaderView
00049 {
00050 
00051   Q_OBJECT
00052 
00053 #ifdef KDE4_SUPPORT
00054 
00064   Q_PROPERTY(QString contextMenuTitle
00065   READ contextMenuTitle
00066   WRITE setContextMenuTitle
00067   RESET resetContextMenuTitle)
00068 #endif
00069 
00070   public:
00076     explicit CustomizableHeaderView(Qt::Orientation orientation, QWidget * parent = 0);
00078     virtual ~CustomizableHeaderView();
00079 
00080 #ifdef KDE4_SUPPORT
00081 
00082     QString contextMenuTitle() const;
00084     void resetContextMenuTitle();
00086     void setContextMenuTitle(const QString & title);
00087 #endif
00088 
00089   signals:
00097     void sectionAboutToBeHidden(int index, Qt::Orientation orientation);
00105     void sectionAboutToBeShown(int index, Qt::Orientation orientation);
00113     void sectionHidden(int index, Qt::Orientation orientation);
00121     void sectionShown(int index, Qt::Orientation orientation);
00122 
00123   protected:
00127     virtual void contextMenuEvent (QContextMenuEvent *e);
00128 
00129   private:
00130 #ifdef KDE4_SUPPORT
00131 
00132     QString m_contextMenuTitle;
00133 #endif
00134 };
00135 
00136 #endif

doxygen