📄 qlistbox-h.html
字号:
int cellWidth(int i) const { ASSERT(i==0); return maxItemWidth(); } int numCols() const { return numColumns(); }#endif int itemHeight( int index = 0 ) const; QListBoxItem * itemAt( QPoint ) const; QRect itemRect( QListBoxItem *item ) const; QListBoxItem *firstItem() const; void sort( bool ascending = TRUE );public slots: virtual void ensureCurrentVisible(); virtual void clearSelection(); void selectAll( bool select ); // ###### make virtual void invertSelection(); // ######### make virtualsignals: void highlighted( int index ); void selected( int index ); void highlighted( const QString &); void selected( const QString &); void highlighted( QListBoxItem * ); void selected( QListBoxItem * ); void selectionChanged(); void selectionChanged( QListBoxItem * ); void currentChanged( QListBoxItem * ); void clicked( QListBoxItem * ); void clicked( QListBoxItem *, const QPoint & ); void pressed( QListBoxItem * ); void pressed( QListBoxItem *, const QPoint & ); void doubleClicked( QListBoxItem * ); void returnPressed( QListBoxItem * ); void rightButtonClicked( QListBoxItem *, const QPoint & ); void rightButtonPressed( QListBoxItem *, const QPoint & ); void mouseButtonPressed( int, QListBoxItem*, const QPoint& ); void mouseButtonClicked( int, QListBoxItem*, const QPoint& ); void onItem( QListBoxItem *item ); void onViewport();protected: void viewportMousePressEvent( QMouseEvent * ); void viewportMouseReleaseEvent( QMouseEvent * ); void viewportMouseDoubleClickEvent( QMouseEvent * ); void viewportMouseMoveEvent( QMouseEvent * ); void mousePressEvent( QMouseEvent * ); void mouseReleaseEvent( QMouseEvent * ); void mouseDoubleClickEvent( QMouseEvent * ); void mouseMoveEvent( QMouseEvent * ); void keyPressEvent( QKeyEvent *e ); void focusInEvent( QFocusEvent *e ); void focusOutEvent( QFocusEvent *e ); void resizeEvent( QResizeEvent * ); void showEvent( QShowEvent * ); void updateItem( int index ); void updateItem( QListBoxItem * );#ifndef QT_NO_COMPAT void updateCellWidth() { } int totalWidth() const { return contentsWidth(); } int totalHeight() const { return contentsHeight(); }#endif virtual void paintCell( QPainter *, int row, int col ); void toggleCurrentItem(); bool isRubberSelecting() const; void doLayout() const;#ifndef QT_NO_COMPAT // obsolete, provided for source compatibility bool itemYPos( int index, int *yPos ) const; int findItem( int yPos ) const {return index(itemAt(QPoint(0,yPos)));}#endifprotected slots: void clearInputString();private slots: void refreshSlot(); void doAutoScroll(); void adjustItems();private: void tryGeometry( int, int ) const; int currentRow() const; int currentColumn() const; void updateSelection(); void drawRubber(); void doRubberSelection( const QRect &old, const QRect &rubber ); void handleItemChange( QListBoxItem *old, bool shift, bool control ); void selectRange( QListBoxItem *from, QListBoxItem *to, bool invert, bool includeFirst, bool clearSel = FALSE ); void emitChangedSignal( bool ); int columnAt( int ) const; int rowAt( int ) const; QListBoxPrivate * d; static QListBox * changedListBox;private: // Disabled copy constructor and operator=#if defined(Q_DISABLE_COPY) QListBox( const QListBox & ); QListBox &operator=( const QListBox & );#endif};class Q_EXPORT <a href="qlistboxitem.html">QListBoxItem</a>{public: QListBoxItem( QListBox* listbox = 0 ); QListBoxItem( QListBox* listbox, QListBoxItem *after ); virtual ~QListBoxItem(); virtual QString text() const; virtual const QPixmap *pixmap() const; virtual int height( const QListBox * ) const; virtual int width( const QListBox * ) const; bool selected() const { return s; } bool current() const; QListBox *listBox() const; void setSelectable( bool b ); bool isSelectable() const; QListBoxItem *next() const; QListBoxItem *prev() const;protected: virtual void paint( QPainter * ) = 0; virtual void setText( const QString &text ) { txt = text; } void setCustomHighlighting( bool );private: QString txt; uint s:1; uint dirty:1; uint custom_highlight : 1; int x, y; QListBoxItem * p, * n; QListBox* lbox; friend class QListBox; friend class QListBoxPrivate; friend class QComboBox;private: // Disabled copy constructor and operator=#if defined(Q_DISABLE_COPY) QListBoxItem( const QListBoxItem & ); QListBoxItem &operator=( const QListBoxItem & );#endif};class Q_EXPORT <a href="qlistboxtext.html">QListBoxText</a> : public <a href="qlistboxitem.html">QListBoxItem</a>{public: QListBoxText( QListBox* listbox, const QString & text=QString::null ); QListBoxText( const QString & text=QString::null ); QListBoxText( QListBox* listbox, const QString & text, QListBoxItem *after ); ~QListBoxText(); int height( const QListBox * ) const; int width( const QListBox * ) const;protected: void paint( QPainter * );private: // Disabled copy constructor and operator=#if defined(Q_DISABLE_COPY) QListBoxText( const QListBoxText & ); QListBoxText &operator=( const QListBoxText & );#endif};class Q_EXPORT <a href="qlistboxpixmap.html">QListBoxPixmap</a> : public <a href="qlistboxitem.html">QListBoxItem</a>{public: QListBoxPixmap( QListBox* listbox, const QPixmap & ); QListBoxPixmap( const QPixmap & ); QListBoxPixmap( QListBox* listbox, const QPixmap & pix, QListBoxItem *after ); QListBoxPixmap( QListBox* listbox, const QPixmap &, const QString& ); QListBoxPixmap( const QPixmap &, const QString& ); QListBoxPixmap( QListBox* listbox, const QPixmap & pix, const QString&, QListBoxItem *after ); ~QListBoxPixmap(); const QPixmap *pixmap() const { return &pm; } int height( const QListBox * ) const; int width( const QListBox * ) const;protected: void paint( QPainter * );private: QPixmap pm;private: // Disabled copy constructor and operator=#if defined(Q_DISABLE_COPY) QListBoxPixmap( const QListBoxPixmap & ); QListBoxPixmap &operator=( const QListBoxPixmap & );#endif};#endif // QT_NO_LISTBOX#endif // QLISTBOX_H</pre><p><address><hr><div align="center"><table width="100%" cellspacing="0" border="0"><tr><td>Copyright
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -