#include <customizableheaderview.h>
Signals | |
void | sectionAboutToBeHidden (int index, Qt::Orientation orientation) |
void | sectionAboutToBeShown (int index, Qt::Orientation orientation) |
void | sectionHidden (int index, Qt::Orientation orientation) |
void | sectionShown (int index, Qt::Orientation orientation) |
Public Member Functions | |
CustomizableHeaderView (Qt::Orientation orientation, QWidget *parent=0) | |
virtual | ~CustomizableHeaderView () |
QString | contextMenuTitle () const |
void | resetContextMenuTitle () |
void | setContextMenuTitle (const QString &title) |
Protected Member Functions | |
virtual void | contextMenuEvent (QContextMenuEvent *e) |
Properties | |
QString | contextMenuTitle |
Private Attributes | |
QString | m_contextMenuTitle |
Each time a context menu is requested by the user, a new context menu is created with the actual data (column/row header names and maybe a menu title).
This class uses by default KMenu from the kdelibs (KDEUI) for the context menu, which gives support for visible menu titles. However when you want a Qt-only version of CustomizableHeaderView, just remove the defination KDE4_SUPPORT from the header file. (In this case, the property contextMenuTitle will no longer be available.)
Definition at line 48 of file customizableheaderview.h.
CustomizableHeaderView::CustomizableHeaderView | ( | Qt::Orientation | orientation, | |
QWidget * | parent = 0 | |||
) | [explicit] |
Creates a new generic header.
orientation | Qt::Horizontal or Qt::Vertical | |
parent | parent widget |
Definition at line 27 of file customizableheaderview.cpp.
CustomizableHeaderView::~CustomizableHeaderView | ( | ) | [virtual] |
Generic destructor.
Definition at line 32 of file customizableheaderview.cpp.
void CustomizableHeaderView::contextMenuEvent | ( | QContextMenuEvent * | e | ) | [protected, virtual] |
Displays the context menu.
Reimplemented from class QAbstractScrollArea.
Definition at line 58 of file customizableheaderview.cpp.
References contextMenuTitle(), sectionAboutToBeHidden(), sectionAboutToBeShown(), sectionHidden(), and sectionShown().
QString CustomizableHeaderView::contextMenuTitle | ( | ) | const |
See property contextMenuTitle.
Referenced by contextMenuEvent().
void CustomizableHeaderView::resetContextMenuTitle | ( | ) |
See property contextMenuTitle.
Definition at line 51 of file customizableheaderview.cpp.
References setContextMenuTitle().
void CustomizableHeaderView::sectionAboutToBeHidden | ( | int | index, | |
Qt::Orientation | orientation | |||
) | [signal] |
This signal is emitted immediately before hiding a row or column because the user used the context menu. It is not emitted when hideSection() or setSectionHidden() was called.
index | index of the row or column that will be hidden. | |
orientation | The orientation of the header. If Qt::Horizontal, than a column will be hidden, if Qt::Vertical, a row will be hidden. |
Referenced by contextMenuEvent().
void CustomizableHeaderView::sectionAboutToBeShown | ( | int | index, | |
Qt::Orientation | orientation | |||
) | [signal] |
This signal is emitted immediately before showing a row or column because the user used the context menu. It is not emitted when setSectionHidden() was called.
index | index of the row or column that will be shown. | |
orientation | The orientation of the header. If Qt::Horizontal, than a column will be shown, if Qt::Vertical, a row will be shown. |
Referenced by contextMenuEvent().
void CustomizableHeaderView::sectionHidden | ( | int | index, | |
Qt::Orientation | orientation | |||
) | [signal] |
This signal is emitted immediately after hiding a row or column because the user used the context menu. It is not emitted when hideSection() or setSectionHidden() was called.
index | index of the row or column that has been hidden. | |
orientation | The orientation of the header. If Qt::Horizontal, than a column was hidden, if Qt::Vertical, a row was hidden. |
Referenced by contextMenuEvent().
void CustomizableHeaderView::sectionShown | ( | int | index, | |
Qt::Orientation | orientation | |||
) | [signal] |
This signal is emitted immediately after showing a row or column because the user used the context menu. It is not emitted when setSectionHidden() was called.
index | index of the row or column that has been shown. | |
orientation | The orientation of the header. If Qt::Horizontal, than a column was shown, if Qt::Vertical, a row was shown. |
Referenced by contextMenuEvent().
void CustomizableHeaderView::setContextMenuTitle | ( | const QString & | title | ) |
See property contextMenuTitle.
Definition at line 46 of file customizableheaderview.cpp.
References m_contextMenuTitle.
Referenced by resetContextMenuTitle().
QString CustomizableHeaderView::m_contextMenuTitle [private] |
Used internally to store the property contextMenuTitle.
Definition at line 132 of file customizableheaderview.h.
Referenced by setContextMenuTitle().
QString CustomizableHeaderView::contextMenuTitle [read, write] |
This property holds the title of the context menu. If empty (which is default), no title is displayed.
const QString contextMenuTitle()
void setContextMenuTitle(const QString & title)
void resetContextMenuTitle()
Definition at line 67 of file customizableheaderview.h.