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

📄 qtable-h.html

📁 QT 下载资料仅供参考
💻 HTML
📖 第 1 页 / 共 2 页
字号:
    enum SelectionMode { Single, Multi, SingleRow, MultiRow, 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 &amp;text );    virtual void setPixmap( int row, int col, const QPixmap &amp;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 x ) const;    virtual int rowAt( int y ) const;    virtual int numRows() const;    virtual 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 );    bool isSelected( int row, int col ) const;    bool isRowSelected( int row, bool full = FALSE ) const;    bool isColumnSelected( int col, bool full = FALSE ) const;    int numSelections() const;    QTableSelection selection( int num ) const;    virtual int addSelection( const QTableSelection &amp;s );    virtual void removeSelection( const QTableSelection &amp;s );    virtual void removeSelection( int num );    virtual int currentSelection() const;    bool showGrid() const;    bool columnMovingEnabled() const;    bool rowMovingEnabled() const;    virtual void sortColumn( int col, bool ascending = TRUE,                             bool wholeRows = FALSE );    bool sorting() const;    virtual void takeItem( QTableItem *i );    virtual void setCellWidget( int row, int col, QWidget *e );    virtual QWidget *cellWidget( int row, int col ) const;    virtual void clearCellWidget( int row, int col );    virtual QRect cellRect( int row, int col ) const;    virtual void paintCell( QPainter *p, int row, int col,                            const QRect &amp;cr, bool selected );    virtual void paintCell( QPainter *p, int row, int col,                            const QRect &amp;cr, bool selected, const QColorGroup &amp;cg );    virtual void paintFocus( QPainter *p, const QRect &amp;r );    QSize sizeHint() const;    bool isReadOnly() const;    bool isRowReadOnly( int row ) const;    bool isColumnReadOnly( int col ) const;    void setEnabled( bool b );    void repaintSelections();    enum FocusStyle { FollowStyle, SpreadSheet };    virtual void setFocusStyle( FocusStyle fs );    FocusStyle focusStyle() const;public slots:    virtual void setNumRows( int r );    virtual void setNumCols( int r );    virtual void setShowGrid( bool b );    virtual void hideRow( int row );    virtual void hideColumn( int col );    virtual void showRow( int row );    virtual void showColumn( int col );    virtual void setColumnWidth( int col, int w );    virtual void setRowHeight( int row, int h );    virtual void adjustColumn( int col );    virtual void adjustRow( int row );    virtual void setColumnStretchable( int col, bool stretch );    virtual void setRowStretchable( int row, bool stretch );    bool isColumnStretchable( int col ) const;    bool isRowStretchable( int row ) const;    virtual void setSorting( bool b );    virtual void swapRows( int row1, int row2, bool swapHeader = FALSE );    virtual void swapColumns( int col1, int col2, bool swapHeader = FALSE );    virtual void swapCells( int row1, int col1, int row2, int col2 );    virtual void setLeftMargin( int m );    virtual void setTopMargin( int m );    virtual void setCurrentCell( int row, int col );    void clearSelection( bool repaint = TRUE );    virtual void setColumnMovingEnabled( bool b );    virtual void setRowMovingEnabled( bool b );    virtual void setReadOnly( bool b );    virtual void setRowReadOnly( int row, bool ro );    virtual void setColumnReadOnly( int col, bool ro );    virtual void setDragEnabled( bool b );    bool dragEnabled() const;    virtual void insertRows( int row, int count = 1 );    virtual void insertColumns( int col, int count = 1 );    virtual void removeRow( int row );    virtual void removeRows( const QMemArray&lt;int&gt; &amp;rows );    virtual void removeColumn( int col );    virtual void removeColumns( const QMemArray&lt;int&gt; &amp;cols );    virtual void editCell( int row, int col, bool replace = FALSE );protected:    enum EditMode { NotEditing, Editing, Replacing };    void drawContents( QPainter *p, int cx, int cy, int cw, int ch );    void contentsMousePressEvent( QMouseEvent* );    void contentsMouseMoveEvent( QMouseEvent* );    void contentsMouseDoubleClickEvent( QMouseEvent* );    void contentsMouseReleaseEvent( QMouseEvent* );    void contentsContextMenuEvent( QContextMenuEvent * e );    void keyPressEvent( QKeyEvent* );    void focusInEvent( QFocusEvent* );    void focusOutEvent( QFocusEvent* );    void viewportResizeEvent( QResizeEvent * );    void showEvent( QShowEvent *e );    void setEditMode( EditMode mode, int row, int col );#ifndef QT_NO_DRAGANDDROP    virtual void contentsDragEnterEvent( QDragEnterEvent *e );    virtual void contentsDragMoveEvent( QDragMoveEvent *e );    virtual void contentsDragLeaveEvent( QDragLeaveEvent *e );    virtual void contentsDropEvent( QDropEvent *e );    virtual QDragObject *dragObject();    virtual void startDrag();#endif    virtual void paintEmptyArea( QPainter *p, int cx, int cy, int cw, int ch );    virtual void activateNextCell();    virtual QWidget *createEditor( int row, int col, bool initFromCell ) const;    virtual void setCellContentFromEditor( int row, int col );    virtual QWidget *beginEdit( int row, int col, bool replace );    virtual void endEdit( int row, int col, bool accept, bool replace );    virtual void resizeData( int len );    virtual void insertWidget( int row, int col, QWidget *w );    int indexOf( int row, int col ) const;    void windowActivationChange( bool );    bool isEditing() const;    EditMode editMode() const;    int currEditRow() const;    int currEditCol() const;protected slots:    virtual void columnWidthChanged( int col );    virtual void rowHeightChanged( int row );    virtual void columnIndexChanged( int section, int fromIndex, int toIndex );    virtual void rowIndexChanged( int section, int fromIndex, int toIndex );    virtual void columnClicked( int col );signals:    void currentChanged( int row, int col );    void clicked( int row, int col, int button, const QPoint &amp;mousePos );    void doubleClicked( int row, int col, int button, const QPoint &amp;mousePos );    void pressed( int row, int col, int button, const QPoint &amp;mousePos );    void selectionChanged();    void valueChanged( int row, int col );    void contextMenuRequested( int row, int col, const QPoint &amp;pos );#ifndef QT_NO_DRAGANDDROP    void dropped( QDropEvent *e );#endifprivate slots:    void doAutoScroll();    void doValueChanged();    void updateGeometriesSlot();private:    void contentsMousePressEventEx( QMouseEvent* );    void drawContents( QPainter* );    void updateGeometries();    void repaintSelections( QTableSelection *oldSelection,                            QTableSelection *newSelection,                            bool updateVertical = TRUE,                            bool updateHorizontal = TRUE );    QRect rangeGeometry( int topRow, int leftCol,                         int bottomRow, int rightCol, bool &amp;optimize );    void fixRow( int &amp;row, int y );    void fixCol( int &amp;col, int x );    void init( int numRows, int numCols );    QSize tableSize() const;    void repaintCell( int row, int col );    void contentsToViewport2( int x, int y, int&amp; vx, int&amp; vy );    QPoint contentsToViewport2( const QPoint &amp;p );    void viewportToContents2( int vx, int vy, int&amp; x, int&amp; y );    QPoint viewportToContents2( const QPoint &amp;p );    void updateRowWidgets( int row );    void updateColWidgets( int col );    bool isSelected( int row, int col, bool includeCurrent ) const;    void setCurrentCell( int row, int col, bool updateSelections );    void fixCell( int &amp;row, int &amp;col, int key );    void delayedUpdateGeometries();    struct TableWidget    {	TableWidget( QWidget *w, int r, int c ) : wid( w ), row( r ), col ( c ) {}	QWidget *wid;	int row, col;    };    void saveContents( QPtrVector&lt;QTableItem&gt; &amp;tmp,		       QPtrVector&lt;TableWidget&gt; &amp;tmp2 );    void updateHeaderAndResizeContents( QTableHeader *header,					int num, int colRow,					int width, bool &amp;updateBefore );    void restoreContents( QPtrVector&lt;QTableItem&gt; &amp;tmp,			  QPtrVector&lt;TableWidget&gt; &amp;tmp2 );    void finishContentsResze( bool updateBefore );private:    QPtrVector&lt;QTableItem&gt; contents;    QPtrVector&lt;QWidget&gt; widgets;    int curRow;    int curCol;    QTableHeader *leftHeader, *topHeader;    EditMode edMode;    int editCol, editRow;    QPtrList&lt;QTableSelection&gt; selections;    QTableSelection *currentSel;    QTimer *autoScrollTimer;    int lastSortCol;    bool sGrid : 1;    bool mRows : 1;    bool mCols : 1;    bool asc : 1;    bool doSort : 1;    bool mousePressed : 1;    bool readOnly : 1;    bool shouldClearSelection : 1;    bool dEnabled : 1;    bool context_menu : 1;    bool drawActiveSelection : 1;    bool was_visible : 1;    SelectionMode selMode;    int pressedRow, pressedCol;    QTablePrivate *d;    QIntDict&lt;int&gt; roRows;    QIntDict&lt;int&gt; roCols;    int startDragRow;    int startDragCol;    QPoint dragStartPos;    int oldCurrentRow, oldCurrentCol;    QWidget *topLeftCorner;    FocusStyle focusStl;    QSize cachedSizeHint;};#endif // QT_NO_TABLE#endif // TABLE_H</pre><!-- eof --><p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td><a href="zh_CN.html">译者:farfareast</a><td align=right><div align=right>Qt 3.0.5版</div></table></div></address></body></html>

⌨️ 快捷键说明

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