⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qheader.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QHeader 3qt "9 December 2002" "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 \- Header row or column, e.g. for tables and listviews.SH SYNOPSIS\fC#include <qheader.h>\fR.PPInherits QWidget..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 n, QWidget * parent = 0, const char * name = 0 )".br.ti -1c.BI "\fB~QHeader\fR ()".br.ti -1c.BI "int \fBaddLabel\fR ( const QString & s, int size = -1 )".br.ti -1c.BI "int \fBaddLabel\fR ( const QIconSet & iconset, const QString & s, int size = -1 )".br.ti -1c.BI "void \fBremoveLabel\fR ( int section )".br.ti -1c.BI "virtual void \fBsetLabel\fR ( int section, const QString & s, int size = -1 )".br.ti -1c.BI "virtual void \fBsetLabel\fR ( int section, const QIconSet & iconset, const QString & s, 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 enable, int section = -1 )".br.ti -1c.BI "virtual void \fBsetResizeEnabled\fR ( bool enable, int section = -1 )".br.ti -1c.BI "virtual void \fBsetMovingEnabled\fR ( bool )".br.ti -1c.BI "virtual void \fBsetStretchEnabled\fR ( bool b, int section )".br.ti -1c.BI "void \fBsetStretchEnabled\fR ( bool b )".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 "bool \fBisStretchEnabled\fR () const".br.ti -1c.BI "bool \fBisStretchEnabled\fR ( int section ) 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 "int \fBheaderWidth\fR () const".br.ti -1c.BI "QRect \fBsectionRect\fR ( int section ) const".br.ti -1c.BI "virtual void setCellSize ( int section, int s )  \fI(obsolete)\fR".br.ti -1c.BI "int cellSize ( int i ) const  \fI(obsolete)\fR".br.ti -1c.BI "int cellPos ( int i ) const  \fI(obsolete)\fR".br.ti -1c.BI "int cellAt ( int pos ) 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 a ) const  \fI(obsolete)\fR".br.ti -1c.BI "int mapToActual ( int l ) const  \fI(obsolete)\fR".br.ti -1c.BI "void \fBmoveSection\fR ( int section, int toIndex )".br.ti -1c.BI "virtual void moveCell ( int fromIdx, int toIdx )  \fI(obsolete)\fR".br.ti -1c.BI "void \fBsetSortIndicator\fR ( int section, bool increasing = TRUE )".br.ti -1c.BI "void \fBadjustHeaderSize\fR ()".br.in -1c.SS "Public Slots".in +1c.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 index )  \fI(obsolete)\fR".br.ti -1c.BI "void moved ( int fromIndex, int toIndex )  \fI(obsolete)\fR".br.in -1c.SS "Properties".in +1c.ti -1c.BI "int \fBcount\fR - the number of sections in the header  \fI(read " "only" ")\fR".br.ti -1c.BI "bool \fBmoving\fR - whether the header sections can be moved".br.ti -1c.BI "int \fBoffset\fR - the header's left-most (or top-most) visible pixel".br.ti -1c.BI "Orientation \fBorientation\fR - the header's orientation".br.ti -1c.BI "bool \fBstretching\fR - whether the header sections always take up the full width (or " "height" ") of the header".br.ti -1c.BI "bool \fBtracking\fR - whether the sizeChange() signal is emitted continuously".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "QRect \fBsRect\fR ( int index )".br.ti -1c.BI "virtual void \fBpaintSection\fR ( QPainter * p, int index, const QRect & fr )".br.ti -1c.BI "virtual void \fBpaintSectionLabel\fR ( QPainter * p, int index, const QRect & fr )".br.in -1c.SH DESCRIPTIONThe QHeader class provides a header row or column, e.g. for tables and listviews..PPThis 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..PPA header is composed of one or more \fIsections\fR, each of which can display a text label and an iconset. A sort indicator (an arrow) can also be displayed using setSortIndicator()..PPSections 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..PPThe 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)..PPA 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..PPIf 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..PPHere's an example to clarify mapToSection() and mapToIndex():.PP<center>.nf.TSl - l. 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.TE.fi</center>.PP<center>.nf.TSl - l. \fIk\fR mapToSection(\fIk\fR) mapToIndex(\fIk\fR) 0 0 0 1 2 3 2 3 1 3 1.TE.fi</center>.PPIn 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..PPQHeader 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..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QListView, QTable, and Advanced Widgets..SH MEMBER FUNCTION DOCUMENTATION.SH "QHeader::QHeader ( QWidget * parent = 0, const char * name = 0 )"Constructs a horizontal header called \fIname\fR, with parent \fIparent\fR..SH "QHeader::QHeader ( int n, QWidget * parent = 0, const char * name = 0 )"Constructs a horizontal header called \fIname\fR, with \fIn\fR sections and parent \fIparent\fR..SH "QHeader::~QHeader ()"Destroys the header and all its sections..SH "int QHeader::addLabel ( const QString & s, int size = -1 )"Adds a new section with label text \fIs\fR. 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 \fIsize\fR. If \fIsize\fR < 0, an appropriate size for the text \fIs\fR is chosen..SH "int QHeader::addLabel ( const QIconSet & iconset, const QString & s, int size = -1 )"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPAdds a new section with iconset \fIiconset\fR and label text \fIs\fR. 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 \fIsize\fR, unless size is negative in which case the size is calculated taking account of the size of the text..SH "void QHeader::adjustHeaderSize ()"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..SH "int QHeader::cellAt ( int pos ) const"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PP

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -