Eneboo - Documentación para desarrolladores
Slots públicos | Señales | Métodos públicos | Métodos protegidos | Propiedades | Amigas
Referencia de la Clase QHeader

The QHeader class provides a header row or column, e.g. for tables and listviews. Más...

#include <qheader.h>

Diagrama de herencias de QHeader
QWidget QWidget QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QTableHeader

Lista de todos los miembros.

Slots públicos

void setUpdatesEnabled (bool enable)
virtual void setOffset (int pos)
void setUpdatesEnabled (bool enable)
virtual void setOffset (int pos)

Señales

void clicked (int section)
void pressed (int section)
void released (int section)
void sizeChange (int section, int oldSize, int newSize)
void indexChange (int section, int fromIndex, int toIndex)
void sectionClicked (int)
void moved (int, int)
void sectionHandleDoubleClicked (int section)
void clicked (int section)
void pressed (int section)
void released (int section)
void sizeChange (int section, int oldSize, int newSize)
void indexChange (int section, int fromIndex, int toIndex)
void sectionClicked (int)
void moved (int, int)
void sectionHandleDoubleClicked (int section)

Métodos públicos

 QHeader (QWidget *parent=0, const char *name=0)
 QHeader (int, QWidget *parent=0, const char *name=0)
 ~QHeader ()
int addLabel (const QString &, int size=-1)
int addLabel (const QIconSet &, const QString &, int size=-1)
void removeLabel (int section)
void removeLabels (int fromSection, int toSection)
virtual void setLabel (int, const QString &, int size=-1)
virtual void setLabel (int, const QIconSet &, const QString &, int size=-1)
QString label (int section) const
QIconSeticonSet (int section) const
virtual void setOrientation (Orientation)
Orientation orientation () const
virtual void setTracking (bool enable)
bool tracking () const
virtual void setClickEnabled (bool, int section=-1)
virtual void setResizeEnabled (bool, int section=-1)
virtual void setMovingEnabled (bool)
virtual void setStretchEnabled (bool b, int section)
void setStretchEnabled (bool b)
bool isClickEnabled (int section=-1) const
bool isResizeEnabled (int section=-1) const
bool isMovingEnabled () const
bool isStretchEnabled () const
bool isStretchEnabled (int section) const
void resizeSection (int section, int s)
int sectionSize (int section) const
int sectionPos (int section) const
int sectionAt (int pos) const
int count () const
int headerWidth () const
QRect sectionRect (int section) const
virtual void setCellSize (int, int)
int cellSize (int i) const
int cellPos (int) const
int cellAt (int pos) const
int offset () const
QSize sizeHint () const
int mapToSection (int index) const
int mapToIndex (int section) const
int mapToLogical (int) const
int mapToActual (int) const
void moveSection (int section, int toIndex)
virtual void moveCell (int, int)
void setSortIndicator (int section, bool ascending=TRUE)
void setSortIndicator (int section, SortOrder order)
int sortIndicatorSection () const
SortOrder sortIndicatorOrder () const
void adjustHeaderSize ()
 QHeader (QWidget *parent=0, const char *name=0)
 QHeader (int, QWidget *parent=0, const char *name=0)
 ~QHeader ()
int addLabel (const QString &, int size=-1)
int addLabel (const QIconSet &, const QString &, int size=-1)
void removeLabel (int section)
void removeLabels (int fromSection, int toSection)
virtual void setLabel (int, const QString &, int size=-1)
virtual void setLabel (int, const QIconSet &, const QString &, int size=-1)
QString label (int section) const
QIconSeticonSet (int section) const
virtual void setOrientation (Orientation)
Orientation orientation () const
virtual void setTracking (bool enable)
bool tracking () const
virtual void setClickEnabled (bool, int section=-1)
virtual void setResizeEnabled (bool, int section=-1)
virtual void setMovingEnabled (bool)
virtual void setStretchEnabled (bool b, int section)
void setStretchEnabled (bool b)
bool isClickEnabled (int section=-1) const
bool isResizeEnabled (int section=-1) const
bool isMovingEnabled () const
bool isStretchEnabled () const
bool isStretchEnabled (int section) const
void resizeSection (int section, int s)
int sectionSize (int section) const
int sectionPos (int section) const
int sectionAt (int pos) const
int count () const
int headerWidth () const
QRect sectionRect (int section) const
virtual void setCellSize (int, int)
int cellSize (int i) const
int cellPos (int) const
int cellAt (int pos) const
int offset () const
QSize sizeHint () const
int mapToSection (int index) const
int mapToIndex (int section) const
int mapToLogical (int) const
int mapToActual (int) const
void moveSection (int section, int toIndex)
virtual void moveCell (int, int)
void setSortIndicator (int section, bool ascending=TRUE)
void setSortIndicator (int section, SortOrder order)
int sortIndicatorSection () const
SortOrder sortIndicatorOrder () const
void adjustHeaderSize ()

Métodos protegidos

void paintEvent (QPaintEvent *)
void showEvent (QShowEvent *e)
void resizeEvent (QResizeEvent *e)
QRect sRect (int index)
virtual void paintSection (QPainter *p, int index, const QRect &fr)
virtual void paintSectionLabel (QPainter *p, int index, const QRect &fr)
void fontChange (const QFont &)
void mousePressEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)
void mouseMoveEvent (QMouseEvent *)
void mouseDoubleClickEvent (QMouseEvent *)
void keyPressEvent (QKeyEvent *)
void keyReleaseEvent (QKeyEvent *)
void paintEvent (QPaintEvent *)
void showEvent (QShowEvent *e)
void resizeEvent (QResizeEvent *e)
QRect sRect (int index)
virtual void paintSection (QPainter *p, int index, const QRect &fr)
virtual void paintSectionLabel (QPainter *p, int index, const QRect &fr)
void fontChange (const QFont &)
void mousePressEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)
void mouseMoveEvent (QMouseEvent *)
void mouseDoubleClickEvent (QMouseEvent *)
void keyPressEvent (QKeyEvent *)
void keyReleaseEvent (QKeyEvent *)

Propiedades

Orientation orientation
 the header's orientation
bool tracking
 whether the sizeChange() signal is emitted continuously
int count
 the number of sections in the header
int offset
 the header's left-most (or top-most) visible pixel
bool moving
 whether the header sections can be moved
bool stretching
 whether the header sections always take up the full width (or height) of the header

Amigas

class QTable
class QTableHeader
class QListView

Descripción detallada

The QHeader class provides a header row or column, e.g. for tables and listviews.

This class provides a header, e.g. a vertical header to display row labels, or a horizontal header to display column labels. It is used by QTable and QListView for example.

A header is composed of one or more sections, each of which can display a text label and an iconset. A sort indicator (an arrow) can also be displayed using setSortIndicator().

Sections are added with addLabel() and removed with removeLabel(). The label and iconset are set in addLabel() and can be changed later with setLabel(). Use count() to retrieve the number of sections in the header.

The orientation of the header is set with setOrientation(). If setStretchEnabled() is TRUE, the sections will expand to take up the full width (height for vertical headers) of the header. The user can resize the sections manually if setResizeEnabled() is TRUE. Call adjustHeaderSize() to have the sections resize to occupy the full width (or height).

A section can be moved with moveSection(). If setMovingEnabled() is TRUE (the default)the user may drag a section from one position to another. If a section is moved, the index positions at which sections were added (with addLabel()), may not be the same after the move. You don't have to worry about this in practice because the QHeader API works in terms of section numbers, so it doesn't matter where a particular section has been moved to.

If you want the current index position of a section call mapToIndex() giving it the section number. (This is the number returned by the addLabel() call which created the section.) If you want to get the section number of a section at a particular index position call mapToSection() giving it the index number.

Here's an example to clarify mapToSection() and mapToIndex():

Index positions 0 1 2 3 Original section ordering Sect 0 Sect 1 Sect 2 Sect 3 Ordering after the user moves a section Sect 0 Sect 2 Sect 3 Sect 1

k mapToSection(k) mapToIndex(k) 0 0 0 1 2 3 2 3 1 3 1 2

In the example above, if we wanted to find out which section is at index position 3 we'd call mapToSection(3) and get a section number of 1 since section 1 was moved. Similarly, if we wanted to know which index position section 2 occupied we'd call mapToIndex(2) and get an index of 1.

QHeader provides the clicked(), pressed() and released() signals. If the user changes the size of a section, the sizeChange() signal is emitted. If you want to have a sizeChange() signal emitted continuously whilst the user is resizing (rather than just after the resizing is finished), use setTracking(). If the user moves a section the indexChange() signal is emitted.

qheader-m.png
qheader-w.png
Ver también:
QListView QTable

Documentación del constructor y destructor

QHeader::QHeader ( QWidget parent = 0,
const char *  name = 0 
)

Constructs a horizontal header called name, with parent parent.

QHeader::QHeader ( int  n,
QWidget parent = 0,
const char *  name = 0 
)

Constructs a horizontal header called name, with n sections and parent parent.

QHeader::~QHeader ( )

Destroys the header and all its sections.

QHeader::QHeader ( QWidget parent = 0,
const char *  name = 0 
)
QHeader::QHeader ( int  ,
QWidget parent = 0,
const char *  name = 0 
)
QHeader::~QHeader ( )

Documentación de las funciones miembro

int QHeader::addLabel ( const QString s,
int  size = -1 
)

Adds a new section with label text s. Returns the index position where the section was added (at the right for horizontal headers, at the bottom for vertical headers). The section's width is set to size. If size < 0, an appropriate size for the text s is chosen.

Reimplementado en QTableHeader.

int QHeader::addLabel ( const QIconSet iconset,
const QString s,
int  size = -1 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Adds a new section with iconset iconset and label text s. Returns the index position where the section was added (at the right for horizontal headers, at the bottom for vertical headers). The section's width is set to size, unless size is negative in which case the size is calculated taking account of the size of the text.

int QHeader::addLabel ( const QString ,
int  size = -1 
)

Reimplementado en QTableHeader.

int QHeader::addLabel ( const QIconSet ,
const QString ,
int  size = -1 
)
void QHeader::adjustHeaderSize ( ) [inline]

Adjusts the size of the sections to fit the size of the header as completely as possible. Only sections for which isStretchEnabled() is TRUE will be resized.

void QHeader::adjustHeaderSize ( ) [inline]
int QHeader::cellAt ( int  pos) const [inline]

Use sectionAt() instead.

Returns the index at which the section is displayed, which contains pos in widget coordinates, or -1 if pos is outside the header sections.

int QHeader::cellAt ( int  pos) const [inline]
int QHeader::cellPos ( int  i) const

Use sectionPos() instead.

Returns the position in pixels of the section that is displayed at the index i. The position is measured from the start of the header.

int QHeader::cellPos ( int  ) const
int QHeader::cellSize ( int  i) const [inline]

Use sectionSize() instead.

Returns the size in pixels of the section that is displayed at the index i.

int QHeader::cellSize ( int  i) const [inline]
void QHeader::clicked ( int  section) [signal]

If isClickEnabled() is TRUE, this signal is emitted when the user clicks section section.

Ver también:
pressed(), released()
void QHeader::clicked ( int  section) [signal]
int QHeader::count ( ) const
int QHeader::count ( ) const
void QHeader::fontChange ( const QFont oldFont) [protected, virtual]

This virtual function is called from setFont(). oldFont is the previous font; you can get the new font from font().

Reimplement this function if your widget needs to know when its font changes. You will almost certainly need to update the widget using update().

The default implementation updates the widget including its geometry.

Ver también:
setFont(), font(), update(), updateGeometry()

Reimplementado de QWidget.

void QHeader::fontChange ( const QFont oldFont) [protected, virtual]

Reimplementado de QWidget.

int QHeader::headerWidth ( ) const
int QHeader::headerWidth ( ) const

Returns the total width of all the header columns.

QIconSet * QHeader::iconSet ( int  section) const

Returns the icon set for section section. If the section does not exist, 0 is returned.

QIconSet* QHeader::iconSet ( int  section) const
void QHeader::indexChange ( int  section,
int  fromIndex,
int  toIndex 
) [signal]

This signal is emitted when the user moves section section from index position fromIndex, to index position toIndex.

void QHeader::indexChange ( int  section,
int  fromIndex,
int  toIndex 
) [signal]
bool QHeader::isClickEnabled ( int  section = -1) const

Returns TRUE if section section is clickable; otherwise returns FALSE.

If section is out of range (negative or larger than count() - 1): returns TRUE if all sections are clickable; otherwise returns FALSE.

Ver también:
setClickEnabled()
bool QHeader::isClickEnabled ( int  section = -1) const
bool QHeader::isMovingEnabled ( ) const
bool QHeader::isMovingEnabled ( ) const
bool QHeader::isResizeEnabled ( int  section = -1) const

Returns TRUE if section section is resizeable; otherwise returns FALSE.

If section is -1 then this function applies to all sections, i.e. returns TRUE if all sections are resizeable; otherwise returns FALSE.

Ver también:
setResizeEnabled()
bool QHeader::isResizeEnabled ( int  section = -1) const
bool QHeader::isStretchEnabled ( ) const
bool QHeader::isStretchEnabled ( ) const
bool QHeader::isStretchEnabled ( int  section) const
bool QHeader::isStretchEnabled ( int  section) const

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns TRUE if section section will resize to take up the full width (or height) of the header; otherwise returns FALSE. If at least one section has stretch enabled the sections will always take up the full width of the header.

Ver también:
setStretchEnabled()
void QHeader::keyPressEvent ( QKeyEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive key press events for the widget.

A widget must call setFocusPolicy() to accept focus initially and have focus in order to receive a key press event.

If you reimplement this handler, it is very important that you explicitly ignore the event if you do not understand it, so that the widget's parent can interpret it; otherwise, the event will be implicitly accepted. Although top-level widgets are able to choose whether to accept or ignore unknown events because they have no parent widgets that could otherwise handle them, it is good practice to explicitly ignore events to make widgets as reusable as possible.

The default implementation closes popup widgets if the user presses Esc. Otherwise the event is ignored.

Ver también:
keyReleaseEvent(), QKeyEvent::ignore(), setFocusPolicy(), focusInEvent(), focusOutEvent(), event(), QKeyEvent

Reimplementado de QWidget.

void QHeader::keyPressEvent ( QKeyEvent e) [protected, virtual]

Reimplementado de QWidget.

void QHeader::keyReleaseEvent ( QKeyEvent e) [protected, virtual]

Reimplementado de QWidget.

void QHeader::keyReleaseEvent ( QKeyEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive key release events for the widget.

A widget must accept focus initially and have focus in order to receive a key release event.

If you reimplement this handler, it is very important that you ignore() the release if you do not understand it, so that the widget's parent can interpret it.

The default implementation ignores the event.

Ver también:
keyPressEvent(), QKeyEvent::ignore(), setFocusPolicy(), focusInEvent(), focusOutEvent(), event(), QKeyEvent

Reimplementado de QWidget.

QString QHeader::label ( int  section) const
QString QHeader::label ( int  section) const

Returns the text for section section. If the section does not exist, a QString::null is returned.

int QHeader::mapToActual ( int  l) const

Use mapToIndex() instead.

Translates from logical index l to actual index (index at which the section l is displayed) . Returns -1 if l is outside the legal range.

Ver también:
mapToLogical()
int QHeader::mapToActual ( int  ) const
int QHeader::mapToIndex ( int  section) const

Returns the index position corresponding to the specified section number.

Atención:
If QTable is used to move header sections as a result of user interaction, the mapping exposed by this function will not reflect the order of the headers in the table; i.e., QTable does not call moveSection() to move sections but handles move operations internally.
Ver también:
mapToSection()
int QHeader::mapToIndex ( int  section) const
int QHeader::mapToLogical ( int  a) const

Use mapToSection() instead.

Translates from actual index a (index at which the section is displayed) to logical index of the section. Returns -1 if a is outside the legal range.

Ver también:
mapToActual()
int QHeader::mapToLogical ( int  ) const
int QHeader::mapToSection ( int  index) const

Returns the number of the section that corresponds to the specified index.

Atención:
If QTable is used to move header sections as a result of user interaction, the mapping exposed by this function will not reflect the order of the headers in the table; i.e., QTable does not call moveSection() to move sections but handles move operations internally.
Ver también:
mapToIndex()
int QHeader::mapToSection ( int  index) const
void QHeader::mouseDoubleClickEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::mouseDoubleClickEvent ( QMouseEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive mouse double click events for the widget.

The default implementation generates a normal mouse press event.

Note that the widgets gets a mousePressEvent() and a mouseReleaseEvent() before the mouseDoubleClickEvent().

Ver también:
mousePressEvent(), mouseReleaseEvent() mouseMoveEvent(), event(), QMouseEvent

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::mouseMoveEvent ( QMouseEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive mouse move events for the widget.

If mouse tracking is switched off, mouse move events only occur if a mouse button is pressed while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is pressed.

QMouseEvent::pos() reports the position of the mouse cursor, relative to this widget. For press and release events, the position is usually the same as the position of the last mouse move event, but it might be different if the user's hand shakes. This is a feature of the underlying window system, not Qt.

Ver también:
setMouseTracking(), mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), event(), QMouseEvent

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::mouseMoveEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::mousePressEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::mousePressEvent ( QMouseEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive mouse press events for the widget.

If you create new widgets in the mousePressEvent() the mouseReleaseEvent() may not end up where you expect, depending on the underlying window system (or X11 window manager), the widgets' location and maybe more.

The default implementation implements the closing of popup widgets when you click outside the window. For other widget types it does nothing.

Ver también:
mouseReleaseEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), event(), QMouseEvent

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::mouseReleaseEvent ( QMouseEvent e) [protected, virtual]

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::mouseReleaseEvent ( QMouseEvent e) [protected, virtual]

This event handler, for event e, can be reimplemented in a subclass to receive mouse release events for the widget.

Ver también:
mouseReleaseEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), event(), QMouseEvent

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::moveCell ( int  fromIdx,
int  toIdx 
) [virtual]

Use moveSection() instead.

Moves the section that is currently displayed at index fromIdx to index toIdx.

virtual void QHeader::moveCell ( int  ,
int   
) [virtual]
void QHeader::moved ( int  fromIndex,
int  toIndex 
) [signal]

Use indexChange() instead.

This signal is emitted when the user has moved the section which is displayed at the index fromIndex to the index toIndex.

void QHeader::moved ( int  ,
int   
) [signal]
void QHeader::moveSection ( int  section,
int  toIndex 
)

Moves section section to index position toIndex.

void QHeader::moveSection ( int  section,
int  toIndex 
)
int QHeader::offset ( ) const
int QHeader::offset ( ) const
Orientation QHeader::orientation ( ) const
Orientation QHeader::orientation ( ) const
void QHeader::paintEvent ( QPaintEvent e) [protected, virtual]

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::paintEvent ( QPaintEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive paint events.

A paint event is a request to repaint all or part of the widget. It can happen as a result of repaint() or update(), or because the widget was obscured and has now been uncovered, or for many other reasons.

Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and QCanvas do this, for example.

Qt also tries to speed up painting by merging multiple paint events into one. When update() is called several times or the window system sends several paint events, Qt merges these events into one event with a larger region (see QRegion::unite()). repaint() does not permit this optimization, so we suggest using update() when possible.

When the paint event occurs, the update region has normally been erased, so that you're painting on the widget's background. There are a couple of exceptions and QPaintEvent::erased() tells you whether the widget has been erased or not.

The background can be set using setBackgroundMode(), setPaletteBackgroundColor() or setBackgroundPixmap(). The documentation for setBackgroundMode() elaborates on the background; we recommend reading it.

Ver también:
event(), repaint(), update(), QPainter, QPixmap, QPaintEvent

Reimplementado de QWidget.

Reimplementado en QTableHeader.

virtual void QHeader::paintSection ( QPainter p,
int  index,
const QRect fr 
) [protected, virtual]

Reimplementado en QTableHeader.

void QHeader::paintSection ( QPainter p,
int  index,
const QRect fr 
) [protected, virtual]

Paints the section at position index, inside rectangle fr (which uses widget coordinates) using painter p.

Calls paintSectionLabel().

Reimplementado en QTableHeader.

virtual void QHeader::paintSectionLabel ( QPainter p,
int  index,
const QRect fr 
) [protected, virtual]
void QHeader::paintSectionLabel ( QPainter p,
int  index,
const QRect fr 
) [protected, virtual]

Paints the label of the section at position index, inside rectangle fr (which uses widget coordinates) using painter p.

Called by paintSection()

void QHeader::pressed ( int  section) [signal]

This signal is emitted when the user presses section section down.

Ver también:
released()
void QHeader::pressed ( int  section) [signal]
void QHeader::released ( int  section) [signal]

This signal is emitted when section section is released.

Ver también:
pressed()
void QHeader::released ( int  section) [signal]
void QHeader::removeLabel ( int  section)

Reimplementado en QTableHeader.

void QHeader::removeLabel ( int  section)

Removes section section. If the section does not exist, nothing happens.

Reimplementado en QTableHeader.

void QHeader::removeLabels ( int  fromSection,
int  toSection 
)
void QHeader::removeLabels ( int  fromSection,
int  toSection 
)
void QHeader::resizeEvent ( QResizeEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive widget resize events. When resizeEvent() is called, the widget already has its new geometry. The old size is accessible through QResizeEvent::oldSize().

The widget will be erased and receive a paint event immediately after processing the resize event. No drawing need be (or should be) done inside this handler.

Widgets that have been created with the WNoAutoErase flag will not be erased. Nevertheless, they will receive a paint event for their entire area afterwards. Again, no drawing needs to be done inside this handler.

The default implementation calls updateMask() if the widget has automatic masking enabled.

Ver también:
moveEvent(), event(), resize(), QResizeEvent, paintEvent()

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::resizeEvent ( QResizeEvent e) [protected, virtual]

Reimplementado de QWidget.

Reimplementado en QTableHeader.

void QHeader::resizeSection ( int  section,
int  s 
)

Resizes section section to s pixels wide (or high).

void QHeader::resizeSection ( int  section,
int  s 
)
int QHeader::sectionAt ( int  pos) const

Reimplementado en QTableHeader.

int QHeader::sectionAt ( int  pos) const

Returns the index of the section which contains the position pos given in pixels from the left (or top).

Ver también:
offset()

Reimplementado en QTableHeader.

void QHeader::sectionClicked ( int  index) [signal]

Use clicked() instead.

This signal is emitted when a part of the header is clicked. index is the index at which the section is displayed.

In a list view this signal would typically be connected to a slot that sorts the specified column (or row).

void QHeader::sectionClicked ( int  ) [signal]
void QHeader::sectionHandleDoubleClicked ( int  section) [signal]

This signal is emitted when the user doubleclicks on the edge (handle) of section section.

void QHeader::sectionHandleDoubleClicked ( int  section) [signal]
int QHeader::sectionPos ( int  section) const

Reimplementado en QTableHeader.

int QHeader::sectionPos ( int  section) const

Returns the position (in pixels) at which the section starts.

Ver también:
offset()

Reimplementado en QTableHeader.

QRect QHeader::sectionRect ( int  section) const

Returns the rectangle covered by section section.

QRect QHeader::sectionRect ( int  section) const
int QHeader::sectionSize ( int  section) const

Reimplementado en QTableHeader.

int QHeader::sectionSize ( int  section) const

Returns the width (or height) of the section in pixels.

Reimplementado en QTableHeader.

virtual void QHeader::setCellSize ( int  ,
int   
) [virtual]
void QHeader::setCellSize ( int  section,
int  s 
) [virtual]

Use resizeSection() instead.

Sets the size of the section section to s pixels.

Atención:
does not repaint or send out signals
virtual void QHeader::setClickEnabled ( bool  ,
int  section = -1 
) [virtual]
void QHeader::setClickEnabled ( bool  enable,
int  section = -1 
) [virtual]

If enable is TRUE, any clicks on section section will result in clicked() signals being emitted; otherwise the section will ignore clicks.

If section is -1 (the default) then the enable value is set for all existing sections and will be applied to any new sections that are added.

Ver también:
setMovingEnabled(), setResizeEnabled()
void QHeader::setLabel ( int  section,
const QIconSet iconset,
const QString s,
int  size = -1 
) [virtual]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the icon for section section to iconset and the text to s. The section's width is set to size if size >= 0; otherwise it is left unchanged.

If the section does not exist, nothing happens.

Reimplementado en QTableHeader.

virtual void QHeader::setLabel ( int  ,
const QString ,
int  size = -1 
) [virtual]

Reimplementado en QTableHeader.

void QHeader::setLabel ( int  section,
const QString s,
int  size = -1 
) [virtual]

Sets the text of section section to s. The section's width is set to size if size >= 0; otherwise it is left unchanged. Any icon set that has been set for this section remains unchanged.

If the section does not exist, nothing happens.

Reimplementado en QTableHeader.

virtual void QHeader::setLabel ( int  ,
const QIconSet ,
const QString ,
int  size = -1 
) [virtual]

Reimplementado en QTableHeader.

virtual void QHeader::setMovingEnabled ( bool  ) [virtual]
void QHeader::setMovingEnabled ( bool  enable) [virtual]
void QHeader::setOffset ( int  pos) [virtual, slot]
virtual void QHeader::setOffset ( int  pos) [virtual, slot]
void QHeader::setOrientation ( Orientation  orientation) [virtual]
virtual void QHeader::setOrientation ( Orientation  ) [virtual]
virtual void QHeader::setResizeEnabled ( bool  ,
int  section = -1 
) [virtual]
void QHeader::setResizeEnabled ( bool  enable,
int  section = -1 
) [virtual]

If enable is TRUE the user may resize section section; otherwise the section may not be manually resized.

If section is negative (the default) then the enable value is set for all existing sections and will be applied to any new sections that are added. Example:

    // Allow resizing of all current and future sections
    header->setResizeEnabled(TRUE);
    // Disable resizing of section 3, (the fourth section added)
    header->setResizeEnabled(FALSE, 3);

If the user resizes a section, a sizeChange() signal is emitted.

Ver también:
setMovingEnabled() setClickEnabled() setTracking()
void QHeader::setSortIndicator ( int  section,
SortOrder  order 
) [inline]

Sets a sort indicator onto the specified section. The indicator's order is either Ascending or Descending.

Only one section can show a sort indicator at any one time. If you don't want any section to show a sort indicator pass a section number of -1.

Ver también:
sortIndicatorSection(), sortIndicatorOrder()
void QHeader::setSortIndicator ( int  section,
SortOrder  order 
) [inline]
void QHeader::setSortIndicator ( int  section,
bool  ascending = TRUE 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Use the other overload instead.

void QHeader::setSortIndicator ( int  section,
bool  ascending = TRUE 
)
void QHeader::setStretchEnabled ( bool  b,
int  section 
) [virtual]

If b is TRUE, section section will be resized when the header is resized, so that the sections take up the full width (or height for vertical headers) of the header; otherwise section section will be set to be unstretchable and will not resize when the header is resized.

If section is -1, and if b is TRUE, then all sections will be resized equally when the header is resized so that they take up the full width (or height for vertical headers) of the header; otherwise all the sections will be set to be unstretchable and will not resize when the header is resized.

Ver también:
adjustHeaderSize()
void QHeader::setStretchEnabled ( bool  b) [inline]
void QHeader::setStretchEnabled ( bool  b) [inline]
virtual void QHeader::setStretchEnabled ( bool  b,
int  section 
) [virtual]
virtual void QHeader::setTracking ( bool  enable) [virtual]
void QHeader::setTracking ( bool  enable) [inline, virtual]
void QHeader::setUpdatesEnabled ( bool  enable) [virtual, slot]

Reimplementado de QWidget.

void QHeader::setUpdatesEnabled ( bool  enable) [virtual, slot]

Reimplementado de QWidget.

void QHeader::showEvent ( QShowEvent e) [protected, virtual]

Reimplementado de QWidget.

void QHeader::showEvent ( QShowEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive widget show events.

Non-spontaneous show events are sent to widgets immediately before they are shown. The spontaneous show events of top-level widgets are delivered afterwards.

Ver también:
event(), QShowEvent

Reimplementado de QWidget.

void QHeader::sizeChange ( int  section,
int  oldSize,
int  newSize 
) [signal]
void QHeader::sizeChange ( int  section,
int  oldSize,
int  newSize 
) [signal]

This signal is emitted when the user has changed the size of a section from oldSize to newSize. This signal is typically connected to a slot that repaints the table or list that contains the header.

QSize QHeader::sizeHint ( ) const [virtual]

Reimplementado de QWidget.

QSize QHeader::sizeHint ( ) const [virtual]

Reimplementado de QWidget.

SortOrder QHeader::sortIndicatorOrder ( ) const
Qt::SortOrder QHeader::sortIndicatorOrder ( ) const

Returns the implied sort order of the QHeaders sort indicator.

Ver también:
setSortIndicator(), sortIndicatorSection()
int QHeader::sortIndicatorSection ( ) const

Returns the section showing the sort indicator or -1 if there is no sort indicator.

Ver también:
setSortIndicator(), sortIndicatorOrder()
int QHeader::sortIndicatorSection ( ) const
QRect QHeader::sRect ( int  index) [protected]

Returns the rectangle covered by the section at index index.

QRect QHeader::sRect ( int  index) [protected]
bool QHeader::tracking ( ) const
bool QHeader::tracking ( ) const

Documentación de las funciones relacionadas y clases amigas

QListView [friend]
QTable [friend]

Reimplementado en QTableHeader.

QTableHeader [friend]

Documentación de propiedades

int QHeader::count [read]

the number of sections in the header

bool QHeader::moving [read, write]

whether the header sections can be moved

If this property is TRUE (the default) the user can move sections. If the user moves a section the indexChange() signal is emitted.

Ver también:
setClickEnabled(), setResizeEnabled()
int QHeader::offset [read, write]

the header's left-most (or top-most) visible pixel

Setting this property will scroll the header so that offset becomes the left-most (or top-most for vertical headers) visible pixel.

QHeader::Orientation QHeader::orientation [inline, read, write]

the header's orientation

The orientation is either Vertical or Horizontal (the default).

Call setOrientation() before adding labels if you don't provide a size parameter otherwise the sizes will be incorrect.

bool QHeader::stretching [read, write]

whether the header sections always take up the full width (or height) of the header

bool QHeader::tracking [inline, read, write]

whether the sizeChange() signal is emitted continuously

If tracking is on, the sizeChange() signal is emitted continuously while the mouse is moved (i.e. when the header is resized), otherwise it is only emitted when the mouse button is released at the end of resizing.

Tracking defaults to FALSE.


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'