53 #ifndef QT_NO_ITEMVIEWS
55 class QHeaderViewPrivate;
61 Q_PROPERTY(
bool showSortIndicator READ isSortIndicatorShown WRITE setSortIndicatorShown)
62 Q_PROPERTY(
bool highlightSections READ highlightSections WRITE setHighlightSections)
63 Q_PROPERTY(
bool stretchLastSection READ stretchLastSection WRITE setStretchLastSection)
64 Q_PROPERTY(
bool cascadingSectionResizes READ cascadingSectionResizes WRITE setCascadingSectionResizes)
65 Q_PROPERTY(
int defaultSectionSize READ defaultSectionSize WRITE setDefaultSectionSize)
66 Q_PROPERTY(
int minimumSectionSize READ minimumSectionSize WRITE setMinimumSectionSize)
67 Q_PROPERTY(
Qt::Alignment defaultAlignment READ defaultAlignment WRITE setDefaultAlignment)
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;
127 void setResizeMode(ResizeMode
mode);
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
virtual void rowsInserted(const QModelIndex &parent, int start, int end)
void mouseReleaseEvent(QMouseEvent *event)
bool viewportEvent(QEvent *event)
void mousePressEvent(QMouseEvent *event)
virtual void updateGeometries()
virtual void setModel(QAbstractItemModel *model)
virtual int verticalOffset() const =0
#define Q_PRIVATE_SLOT(d, signature)
virtual bool isIndexHidden(const QModelIndex &index) const =0
void mouseMoveEvent(QMouseEvent *event)
#define QT_BEGIN_NAMESPACE
virtual void doItemsLayout()
virtual void scrollTo(const QModelIndex &index, ScrollHint hint=EnsureVisible)=0
virtual QRect visualRect(const QModelIndex &index) const =0
virtual QModelIndex indexAt(const QPoint &point) const =0
GLuint GLuint GLsizei count
GLuint GLsizei GLsizei * length
virtual int horizontalOffset() const =0
virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
bool event(QEvent *event)
virtual QRegion visualRegionForSelection(const QItemSelection &selection) const =0
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
virtual void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)=0
void mouseDoubleClickEvent(QMouseEvent *event)
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers)=0