45 #include <QtGui/qabstractitemview.h> 53 #ifndef QT_NO_ITEMVIEWS 90 int sectionSizeHint(
int logicalIndex)
const;
92 int visualIndexAt(
int position)
const;
93 int logicalIndexAt(
int position)
const;
95 inline int logicalIndexAt(
int x,
int y)
const;
96 inline int logicalIndexAt(
const QPoint &pos)
const;
98 int sectionSize(
int logicalIndex)
const;
99 int sectionPosition(
int logicalIndex)
const;
100 int sectionViewportPosition(
int logicalIndex)
const;
102 void moveSection(
int from,
int to);
103 void swapSections(
int first,
int second);
104 void resizeSection(
int logicalIndex,
int size);
107 bool isSectionHidden(
int logicalIndex)
const;
108 void setSectionHidden(
int logicalIndex,
bool hide);
109 int hiddenSectionCount()
const;
111 inline void hideSection(
int logicalIndex);
112 inline void showSection(
int logicalIndex);
115 int visualIndex(
int logicalIndex)
const;
116 int logicalIndex(
int visualIndex)
const;
118 void setMovable(
bool movable);
119 bool isMovable()
const;
121 void setClickable(
bool clickable);
122 bool isClickable()
const;
124 void setHighlightSections(
bool highlight);
125 bool highlightSections()
const;
128 void setResizeMode(
int logicalIndex,
ResizeMode mode);
129 ResizeMode resizeMode(
int logicalIndex)
const;
130 int stretchSectionCount()
const;
132 void setSortIndicatorShown(
bool show);
133 bool isSortIndicatorShown()
const;
135 void setSortIndicator(
int logicalIndex,
Qt::SortOrder order);
136 int sortIndicatorSection()
const;
139 bool stretchLastSection()
const;
140 void setStretchLastSection(
bool stretch);
142 bool cascadingSectionResizes()
const;
143 void setCascadingSectionResizes(
bool enable);
145 int defaultSectionSize()
const;
146 void setDefaultSectionSize(
int size);
148 int minimumSectionSize()
const;
149 void setMinimumSectionSize(
int size);
151 Qt::Alignment defaultAlignment()
const;
152 void setDefaultAlignment(Qt::Alignment alignment);
155 bool sectionsMoved()
const;
156 bool sectionsHidden()
const;
158 #ifndef QT_NO_DATASTREAM 166 void setOffset(
int offset);
167 void setOffsetToSectionPosition(
int visualIndex);
168 void setOffsetToLastSection();
169 void headerDataChanged(
Qt::Orientation orientation,
int logicalFirst,
int logicalLast);
172 void sectionMoved(
int logicalIndex,
int oldVisualIndex,
int newVisualIndex);
173 void sectionResized(
int logicalIndex,
int oldSize,
int newSize);
174 void sectionPressed(
int logicalIndex);
175 void sectionClicked(
int logicalIndex);
176 void sectionEntered(
int logicalIndex);
177 void sectionDoubleClicked(
int logicalIndex);
178 void sectionCountChanged(
int oldCount,
int newCount);
179 void sectionHandleDoubleClicked(
int logicalIndex);
181 void geometriesChanged();
182 void sortIndicatorChanged(
int logicalIndex,
Qt::SortOrder order);
185 void updateSection(
int logicalIndex);
186 void resizeSections();
187 void sectionsInserted(
const QModelIndex &parent,
int logicalFirst,
int logicalLast);
188 void sectionsAboutToBeRemoved(
const QModelIndex &parent,
int logicalFirst,
int logicalLast);
194 void initializeSections();
195 void initializeSections(
int start,
int end);
206 virtual void paintSection(
QPainter *painter,
const QRect &rect,
int logicalIndex)
const;
207 virtual QSize sectionSizeFromContents(
int logicalIndex)
const;
235 inline
int QHeaderView::logicalIndexAt(
int ax,
int ay)
const 236 {
return orientation() ==
Qt::Horizontal ? logicalIndexAt(ax) : logicalIndexAt(ay); }
238 {
return logicalIndexAt(apos.
x(), apos.
y()); }
240 { setSectionHidden(alogicalIndex,
true); }
242 { setSectionHidden(alogicalIndex,
false); }
244 #endif // QT_NO_ITEMVIEWS 250 #endif // QHEADERVIEW_H The QPainter class performs low-level painting on widgets and other paint devices.
#define QT_END_NAMESPACE
This macro expands to.
void mouseMoveEvent(QMouseEvent *event)
This function is called with the given event when a mouse move event is sent to the widget...
virtual bool isIndexHidden(const QModelIndex &index) const =0
Returns true if the item referred to by the given index is hidden in the view, otherwise returns fals...
virtual QRect visualRect(const QModelIndex &index) const =0
Returns the rectangle on the viewport occupied by the item at index.
void mouseDoubleClickEvent(QMouseEvent *event)
This function is called with the given event when a mouse button is double clicked inside the widget...
The QByteArray class provides an array of bytes.
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
virtual void doItemsLayout()
This function is intended to lay out the items in the view.
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers)=0
Returns a QModelIndex object pointing to the next object in the view, based on the given cursorAction...
virtual int verticalOffset() const =0
Returns the vertical offset of the view.
virtual void setModel(QAbstractItemModel *model)
Sets the model for the view to present.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual void scrollTo(const QModelIndex &index, ScrollHint hint=EnsureVisible)=0
Scrolls the view if necessary to ensure that the item at index is visible.
virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
This slot is called when a new item becomes the current item.
virtual void reset()
Reset the internal state of the view.
The QRegion class specifies a clip region for a painter.
virtual int horizontalOffset() const =0
Returns the horizontal offset of the view.
The QAbstractItemModel class provides the abstract interface for item model classes.
The QMouseEvent class contains parameters that describe a mouse event.
The QAbstractItemView class provides the basic functionality for item view classes.
The QItemSelection class manages information about selected items in a model.
virtual void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)=0
Applies the selection flags to the items in or touched by the rectangle, rect.
The QPoint class defines a point in the plane using integer precision.
The QModelIndex class is used to locate data in a data model.
The QRect class defines a rectangle in the plane using integer precision.
int y() const
Returns the y coordinate of this point.
void mouseReleaseEvent(QMouseEvent *event)
This function is called with the given event when a mouse button is released, after a mouse press eve...
virtual void rowsInserted(const QModelIndex &parent, int start, int end)
This slot is called when rows are inserted.
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
This slot is called when items are changed in the model.
virtual QRegion visualRegionForSelection(const QItemSelection &selection) const =0
Returns the region from the viewport of the items in the given selection.
virtual void updateGeometries()
Updates the geometry of the child widgets of the view.
The QSize class defines the size of a two-dimensional object using integer point precision.
#define Q_DECLARE_PRIVATE(Class)
CursorAction
This enum describes the different ways to navigate between items,.
int x() const
Returns the x coordinate of this point.
The QPaintEvent class contains event parameters for paint events.
static const KeyPair *const end
bool event(QEvent *event)
Reimplemented Function
The QEvent class is the base class of all event classes.
void mousePressEvent(QMouseEvent *event)
This function is called with the given event when a mouse button is pressed while the cursor is insid...
bool viewportEvent(QEvent *event)
This function is used to handle tool tips, and What's This? mode, if the given event is a QEvent::Too...
virtual QModelIndex indexAt(const QPoint &point) const =0
Returns the model index of the item at the viewport coordinates point.