📄 qtable-h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Qt Toolkit - qtable.h include file</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }--></style></head><body bgcolor="#ffffff"><table width="100%"><tr><td><a href="index.html"><img width="100" height="100" src="qtlogo.png"alt="Home" border="0"><img width="100"height="100" src="face.png" alt="Home" border="0"></a><td valign="top"><div align="right"><img src="dochead.png" width="472" height="27"><br><a href="classes.html"><b>Classes</b></a>- <a href="annotated.html">Annotated</a>- <a href="hierarchy.html">Tree</a>- <a href="functions.html">Functions</a>- <a href="index.html">Home</a>- <a href="topicals.html"><b>Structure</b> <font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" align="center" size=32>Qte</font></a></div></table><h1 align=center>qtable.h</h1><br clear="all">This is the verbatim text of the qtable.h include file. It isprovided only for illustration; the copyrightremains with Trolltech.<hr><pre>/******************************************************************************** Definition of QTable widget class**** Created : 000607**** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.**** This file is part of the table module of the Qt GUI Toolkit.**** This file may be distributed under the terms of the Q Public License** as defined by Trolltech AS of Norway and appearing in the file** LICENSE.QPL included in the packaging of this file.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition licenses may use this** file in accordance with the Qt Commercial License Agreement provided** with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for** information about Qt Commercial License Agreements.** See http://www.trolltech.com/qpl/ for QPL licensing information.** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#ifndef QTABLE_H#define QTABLE_H#ifndef QT_H#include <qscrollview.h>#include <qpixmap.h>#include <qvector.h>#include <qheader.h>#include <qarray.h>#include <qlist.h>#include <qguardedptr.h>#include <qshared.h>#endif // QT_H#ifndef QT_NO_TABLEclass QTableHeader;class <a href="qvalidator.html">QValidator</a>;class <a href="qtable.html">QTable</a>;class <a href="qpaintevent.html">QPaintEvent</a>;class <a href="qtimer.html">QTimer</a>;class <a href="qresizeevent.html">QResizeEvent</a>;struct QTablePrivate;struct QTableHeaderPrivate;class Q_EXPORT <a href="qtableselection.html">QTableSelection</a>{public: QTableSelection(); void init( int row, int col ); void expandTo( int row, int col ); bool operator==( const QTableSelection &s ) const; int topRow() const { return tRow; } int bottomRow() const { return bRow; } int leftCol() const { return lCol; } int rightCol() const { return rCol; } int anchorRow() const { return aRow; } int anchorCol() const { return aCol; } bool isActive() const { return active; }private: uint active : 1; uint inited : 1; int tRow, lCol, bRow, rCol; int aRow, aCol;};class Q_EXPORT <a href="qtableitem.html">QTableItem</a> : public <a href="qt.html">Qt</a>{public: enum EditType { Never, OnTyping, WhenCurrent, Always }; QTableItem( QTable *table, EditType et, const QString &text ); QTableItem( QTable *table, EditType et, const QString &text, const QPixmap &p ); virtual ~QTableItem(); virtual QPixmap pixmap() const; virtual QString text() const; virtual void setPixmap( const QPixmap &p ); virtual void setText( const QString &t ); QTable *table() const { return t; } virtual int alignment() const; virtual void setWordWrap( bool b ); bool wordWrap() const; EditType editType() const; virtual QWidget *createEditor() const; virtual void setContentFromEditor( QWidget *w ); virtual void setReplaceable( bool ); bool isReplaceable() const; virtual QString key() const; virtual QSize sizeHint() const; virtual void setSpan( int rs, int cs ); int rowSpan() const; int colSpan() const; virtual void setRow( int r ); virtual void setCol( int c ); int row() const; int col() const; virtual void paint( QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected ); void updateEditor( int oldRow, int oldCol );private: QString txt; QPixmap pix; QTable *t; EditType edType; uint wordwrap : 1; uint tcha : 1; int rw, cl; int rowspan, colspan;};#if defined(Q_TEMPLATEDLL)// MOC_SKIP_BEGINtemplate class Q_EXPORT QVector<QTableItem>;template class Q_EXPORT QVector<QWidget>;template class Q_EXPORT QList<QTableSelection>;// MOC_SKIP_END#endifclass Q_EXPORT <a href="qtable.html">QTable</a> : public <a href="qscrollview.html">QScrollView</a>{ Q_OBJECT Q_PROPERTY( int numRows READ numRows WRITE setNumRows ) Q_PROPERTY( int numCols READ numCols WRITE setNumCols ) Q_PROPERTY( bool showGrid READ showGrid WRITE setShowGrid ) Q_PROPERTY( bool rowMovingEnabled READ rowMovingEnabled WRITE setRowMovingEnabled ) Q_PROPERTY( bool columnMovingEnabled READ columnMovingEnabled WRITE setColumnMovingEnabled ) friend class QTableHeader;public: QTable( QWidget *parent = 0, const char *name = 0 ); QTable( int numRows, int numCols, QWidget *parent = 0, const char *name = 0 ); ~QTable(); QHeader *horizontalHeader() const; QHeader *verticalHeader() const; enum SelectionMode { Single, Multi, NoSelection }; virtual void setSelectionMode( SelectionMode mode ); SelectionMode selectionMode() const; virtual void setItem( int row, int col, QTableItem *item ); virtual void setText( int row, int col, const QString &text ); virtual void setPixmap( int row, int col, const QPixmap &pix ); virtual QTableItem *item( int row, int col ) const; virtual QString text( int row, int col ) const; virtual QPixmap pixmap( int row, int col ) const; virtual void clearCell( int row, int col ); virtual QRect cellGeometry( int row, int col ) const; virtual int columnWidth( int col ) const; virtual int rowHeight( int row ) const; virtual int columnPos( int col ) const; virtual int rowPos( int row ) const; virtual int columnAt( int pos ) const; virtual int rowAt( int pos ) const; int numRows() const; int numCols() const; void updateCell( int row, int col ); bool eventFilter( QObject * o, QEvent * ); int currentRow() const { return curRow; } int currentColumn() const { return curCol; } void ensureCellVisible( int row, int col );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -