📄 qheader.3qt
字号:
'\" t.TH QHeader 3qt "24 January 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQHeader \- Table header.br.PP\fC#include <qheader.h>\fR.PPInherits QWidget..PPInherited by QTableHeader..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQHeader\fR ( QWidget * " "parent" "=0, const char * " "name" "=0 ) ".br.ti -1c.BI "\fBQHeader\fR ( int, QWidget * " "parent" "=0, const char * " "name" "=0 ) ".br.ti -1c.BI "\fB~QHeader\fR () ".br.ti -1c.BI "int \fBaddLabel\fR ( const QString &, int " "size" " = -1 ) ".br.ti -1c.BI "int \fBaddLabel\fR ( const QIconSet &, const QString &, int " "size" " = -1 ) ".br.ti -1c.BI "void \fBremoveLabel\fR ( int section ) ".br.ti -1c.BI "virtual void \fBsetLabel\fR ( int, const QString &, int " "size" " = -1 ) ".br.ti -1c.BI "virtual void \fBsetLabel\fR ( int, const QIconSet &, const QString &, int " "size" " = -1 ) ".br.ti -1c.BI "QString \fBlabel\fR ( int section ) const".br.ti -1c.BI "QIconSet* \fBiconSet\fR ( int section ) const".br.ti -1c.BI "virtual void \fBsetOrientation\fR ( Orientation ) ".br.ti -1c.BI "Orientation \fBorientation\fR () const".br.ti -1c.BI "virtual void \fBsetTracking\fR ( bool enable ) ".br.ti -1c.BI "bool \fBtracking\fR () const".br.ti -1c.BI "virtual void \fBsetClickEnabled\fR ( bool, int " "section" " = -1 ) ".br.ti -1c.BI "virtual void \fBsetResizeEnabled\fR ( bool, int " "section" " = -1 ) ".br.ti -1c.BI "virtual void \fBsetMovingEnabled\fR ( bool ) ".br.ti -1c.BI "bool \fBisClickEnabled\fR ( int " "section" " = -1 ) const".br.ti -1c.BI "bool \fBisResizeEnabled\fR ( int " "section" " = -1 ) const".br.ti -1c.BI "bool \fBisMovingEnabled\fR () const".br.ti -1c.BI "void \fBresizeSection\fR ( int " "section" ", int s ) ".br.ti -1c.BI "int \fBsectionSize\fR ( int section ) const".br.ti -1c.BI "int \fBsectionPos\fR ( int section ) const".br.ti -1c.BI "int \fBsectionAt\fR ( int pos ) const".br.ti -1c.BI "int \fBcount\fR () const".br.ti -1c.BI "virtual void setCellSize ( int, int ) \fI(obsolete)\fR".br.ti -1c.BI "int cellSize ( int ) const \fI(obsolete)\fR".br.ti -1c.BI "int cellPos ( int ) const \fI(obsolete)\fR".br.ti -1c.BI "int cellAt ( int ) const \fI(obsolete)\fR".br.ti -1c.BI "int \fBoffset\fR () const".br.ti -1c.BI "int \fBmapToSection\fR ( int index ) const".br.ti -1c.BI "int \fBmapToIndex\fR ( int section ) const".br.ti -1c.BI "int mapToLogical ( int ) const \fI(obsolete)\fR".br.ti -1c.BI "int mapToActual ( int ) const \fI(obsolete)\fR".br.ti -1c.BI "void \fBmoveSection\fR ( int " "section" ", int toIndex ) ".br.ti -1c.BI "virtual void moveCell ( int, int ) \fI(obsolete)\fR".br.ti -1c.BI "void \fBsetSortIndicator\fR ( int " "section" ", bool " "increasing" " = TRUE ) ".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "virtual void \fBsetUpdatesEnabled\fR ( bool enable ) ".br.ti -1c.BI "virtual void \fBsetOffset\fR ( int pos ) ".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBclicked\fR ( int section ) ".br.ti -1c.BI "void \fBpressed\fR ( int section ) ".br.ti -1c.BI "void \fBreleased\fR ( int section ) ".br.ti -1c.BI "void \fBsizeChange\fR ( int " "section" ", int " "oldSize" ", int newSize ) ".br.ti -1c.BI "void \fBindexChange\fR ( int " "section" ", int " "fromIndex" ", int toIndex ) ".br.ti -1c.BI "void sectionClicked ( int ) \fI(obsolete)\fR".br.ti -1c.BI "void moved ( int, int ) \fI(obsolete)\fR".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "QRect \fBsRect\fR ( int index ) ".br.ti -1c.BI "void \fBpaintSection\fR ( QPainter * " "p" ", int " "index" ", QRect fr ) ".br.ti -1c.BI "void \fBpaintSectionLabel\fR ( QPainter * " "p" ", int " "index" ", const QRect & fr ) ".br.in -1c.SS "Properties".nf.TSl l l l l- - - - -l l l l l.Type Name READ WRITE OptionsOrientation orientation orientation setOrientationbool tracking tracking setTrackingint count countint offset offset setOffsetbool moving isMovingEnabled setMovingEnabled.TE.fi.SH DESCRIPTIONThe QHeader class provides a table header..PPThis class provides a table header as known from spreadsheet-like widgets. QHeader can be used vertically or horizontally (see setOrientation())..PPWith addLabel() you can add sections, and with removeLabel() you can remove them. If you enabled clicking for one or all sections (see setClickEnabled()), the user can reorder the sections and click on them which may be used for sorting (see also setSortIndicator()). This feature is turned on by default..PPSo, if the user reorders the sections by clicking and moving them with the mouse the index of a section may change. This means, the section you inserted at the first position might be displayed at a different index then. To get the index at which e.g the first section is displayed, use mapToIndex() with 0 as argument for our example..PPIf you want e.g. to know which section is displayed at e.g. index 3 use mapToSection() with 3 as argument..PPSo, you can always work with the section numbers as you inserted them without caring about the index at which they are displayed at the moment. Also the API of QHeader works with the section numbers..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QListView and QTableView..SH MEMBER FUNCTION DOCUMENTATION.SH "QHeader::QHeader ( QWidget * parent=0, const char * name=0 )"Constructs a horizontal header..PPThe \fIparent\fR and \fIname\fR arguments are sent to the QWidget constructor..SH "QHeader::QHeader ( int n, QWidget * parent=0, const char * name=0 )"Constructs a horizontal header with \fIn\fR sections..PPThe \fIparent\fR and \fIname\fR arguments are sent to the QWidget constructor..SH "QHeader::~QHeader ()"Destructs the header.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -