The QHeader class provides a table header. More...
#include <qheader.h>
Inherits QWidget.
Type | Name | READ | WRITE | Options |
---|---|---|---|---|
Orientation | orientation | orientation | setOrientation | |
bool | tracking | tracking | setTracking | |
int | count | count | ||
int | offset | offset | setOffset |
This is a table heading of the type used in a list view. It gives the user the opportunity to resize and move the columns (or rows for vertical headings).
This class can be used without a table view, if you need to control table-like structures.
See also: QListView and QTableView.
Constructs a horizontal header.
The parent and name arguments are sent to the QWidget constructor.
Constructs a horizontal header with n sections.
The parent and name arguments are sent to the QWidget constructor.
Destructs the header.
Adds a new section, with icon set iconset and label text s. Returns the index. If size is non-negative, the section width is set to size, otherwise a size currently sufficient for the label is used.
Adds a new section, with label text s. Returns the index. If size is non-negative, the section width is set to size, otherwise a size currently sufficient for the label text is used.
Returns the actual index of the section at widget position c, or -1 if outside.
Returns the position in pixels of section i of the header. The position is measured from the start of the first header. i is the actual index.
Returns the size in pixels of section i of the header. i is the actual index.
Returns the number of sections in the header.
Returns the icon set set on logical section i.
Returns the text set on logical section i.
Translates from logical index l to actual index. Returns -1 if l is outside the legal range.
See also: mapToLogical().
Translates from actual index a to logical index. Returns -1 if a is outside the legal range.
See also: mapToActual().
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual protected]
Reimplemented for internal reasons; the API is not affected.
Reimplemented from QWidget.
[virtual]
Moves the section with actual index fromIdx to the division line at toIdx
[signal]
This signal is emitted when the user has moved section from to position to. from is the actual index of the section before the move and to is the new actual index.
Returns the leftmost (or uppermost for vertical headers) visible pixel.
Returns Horizontal
if the header is horizontal, Vertical
if
the header is vertical.
[virtual protected]
Paints the header.
Reimplemented from QWidget.
[protected]
Paints actual section id of the header, inside rectangle fr in widget coordinates.
Removes the section with logical index index.
[protected]
Returns the rectangle covered by actual section i.
[signal]
This signal is emitted when a part of the header is clicked. actual is the actual index of the clicked section.
In a list view, this signal would typically be connected to a slot which sorts the specified column (or row).
[virtual]
Sets the size of logical section i to s pixels.
Warning: does not repaint or send out signals at present.
[virtual]
Enable clicking in logical section i if enable is TRUE, disable otherwise. If i is negative (as it is by default), clicking is enabled/disabled for all sectionss.
If enabled, the sectionClicked() signal is emitted when the user clicks.
See also: setMovingEnabled() and setResizeEnabled().
[virtual]
Sets the icon on logical section i to iconset and the text to s. If the section does not exist, nothing happens. If size is non-negative, the section width is set to size.
Any icon set that has been defined for this section remains unchanged.
[virtual]
Sets the text on logical section i to s. If the section does not exist, nothing happens. If size is non-negative, the section width is set to size.
Any icon set that has been defined for this section remains unchanged.
[virtual]
Enable the user to exchange sections if enable is TRUE, disable otherwise.
See also: setClickEnabled() and setResizeEnabled().
[virtual slot]
Scrolls the header such that x becomes the leftmost (or uppermost for vertical headers) visible pixel.
[virtual]
Sets the header orientation. The orientation must be QHeader::Vertical or QHeader::Horizontal.
When adding labels without the size parameter, setOrientation should be called first, otherwise labels will be sized incorrectly.
See also: orientation().
[virtual]
Enable user resizing of logical section i if enable is TRUE, disable otherwise. If i is negative (as it is by default), resizing is enabled/disabled for all sections.
See also: setMovingEnabled() and setClickEnabled().
As most of the time QHeader is used together with a list widget, QHeader can indicate a sort order. This is done using an arrow at the right edge of a section which points up or down. logIdx specifies in which logical section this arrow should be drawn, and increasing, if the arrow should point to the bottom (TRUE) or the the top (FALSE). If logIdx is -1, no arrow is drawn.
See also: QListView::setShowSortIndicator().
[virtual]
Sets tracking if enable is TRUE, otherwise turns off tracking. If tracking is on, the sizeChange() signal is emitted continuously while the mouse is moved, otherwise it is only emitted when the mouse button is released.
See also: tracking().
[signal]
This signal is emitted when the user has changed the size of some of the parts of the header. This signal is typically connected to a slot that repaints the table. logicalSection is the logical section resized.
[virtual]
Returns the recommended size of the QHeader.
Reimplemented from QWidget.
[virtual]
A horizontal header may stretch horizontally, but is fixed vertically.
Reimplemented from QWidget.
Returns TRUE if tracking is on, FALSE otherwise.
See also: setTracking().
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-2000 Troll Tech, all rights reserved.
Copyright İ 2000 Troll Tech | Trademarks | Qt version 2.1.0-beta1
|