📄 qiconview.h
字号:
/****************************************************************************** $Id: qt/src/iconview/qiconview.h 2.3.6 edited 2002-10-28 $**** Definition of QIconView widget class**** Created : 990707**** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.**** This file is part of the iconview 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 or Qt Professional 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 QICONVIEW_H#define QICONVIEW_H#ifndef QT_H#include <qscrollview.h>#include <qiconset.h>#include <qstring.h>#include <qrect.h>#include <qpoint.h>#include <qsize.h>#include <qfont.h>#include <qlist.h>#include <qdragobject.h>#include <qstringlist.h>#include <qmultilineedit.h>#include <qbitmap.h>#endif // QT_H#include <qmodules.h>#if !defined(QT_MODULE_ICONVIEW)#define QM_EXPORT#else#define QM_EXPORT Q_EXPORT#endif#ifndef QT_NO_ICONVIEWclass QIconView;class QFontMetrics;class QPainter;class QMimeSource;class QDragObject;class QMouseEvent;class QDragEnterEvent;class QDragMoveEvent;class QDragLeaveEvent;class QKeyEvent;class QFocusEvent;class QShowEvent;class QIconViewPrivate;struct QIconViewItemPrivate;class QIconViewItem;class QIconViewItemLineEdit;class QStringList;#ifndef QT_NO_DRAGANDDROP/***************************************************************************** * * Class QIconDragItem * *****************************************************************************/class QM_EXPORT QIconDragItem{public: QIconDragItem(); virtual ~QIconDragItem(); virtual QByteArray data() const; virtual void setData( const QByteArray &d ); bool operator== ( const QIconDragItem& ) const;private: QByteArray ba;};/***************************************************************************** * * Class QIconDrag * *****************************************************************************/struct QIconDragPrivate;class QM_EXPORT QIconDrag : public QDragObject{ Q_OBJECTpublic: QIconDrag( QWidget * dragSource, const char* name = 0 ); virtual ~QIconDrag(); void append( const QIconDragItem &item, const QRect &pr, const QRect &tr ); virtual const char* format( int i ) const; static bool canDecode( QMimeSource* e ); virtual QByteArray encodedData( const char* mime ) const;private: QIconDragPrivate *d; QChar endMark; friend class QIconView; friend class QIconViewPrivate;};#endif/***************************************************************************** * * Class QIconViewItem * *****************************************************************************/class QIconViewToolTip;class QM_EXPORT QIconViewItem : public Qt{ friend class QIconView; friend class QIconViewToolTip; friend class QIconViewItemLineEdit;public: QIconViewItem( QIconView *parent ); QIconViewItem( QIconView *parent, QIconViewItem *after ); QIconViewItem( QIconView *parent, const QString &text ); QIconViewItem( QIconView *parent, QIconViewItem *after, const QString &text ); QIconViewItem( QIconView *parent, const QString &text, const QPixmap &icon ); QIconViewItem( QIconView *parent, QIconViewItem *after, const QString &text, const QPixmap &icon ); virtual ~QIconViewItem(); virtual void setRenameEnabled( bool allow ); virtual void setDragEnabled( bool allow ); virtual void setDropEnabled( bool allow ); virtual QString text() const; virtual QPixmap *pixmap() const; virtual QString key() const; bool renameEnabled() const; bool dragEnabled() const; bool dropEnabled() const; QIconView *iconView() const; QIconViewItem *prevItem() const; QIconViewItem *nextItem() const; int index() const; virtual void setSelected( bool s, bool cb ); virtual void setSelected( bool s ); virtual void setSelectable( bool s ); bool isSelected() const; bool isSelectable() const; virtual void repaint(); virtual void move( int x, int y ); virtual void moveBy( int dx, int dy ); virtual void move( const QPoint &pnt ); virtual void moveBy( const QPoint &pnt ); QRect rect() const; int x() const; int y() const; int width() const; int height() const; QSize size() const; QPoint pos() const; QRect textRect( bool relative = TRUE ) const; QRect pixmapRect( bool relative = TRUE ) const; bool contains( QPoint pnt ) const; bool intersects( QRect r ) const; virtual bool acceptDrop( const QMimeSource *mime ) const; void rename(); virtual int compare( QIconViewItem *i ) const; virtual void setText( const QString &text ); virtual void setPixmap( const QPixmap &icon ); virtual void setText( const QString &text, bool recalc, bool redraw = TRUE ); virtual void setPixmap( const QPixmap &icon, bool recalc, bool redraw = TRUE ); virtual void setKey( const QString &k );protected: virtual void removeRenameBox(); virtual void calcRect( const QString &text_ = QString::null ); virtual void paintItem( QPainter *p, const QColorGroup &cg ); virtual void paintFocus( QPainter *p, const QColorGroup &cg );#ifndef QT_NO_DRAGANDDROP virtual void dropped( QDropEvent *e, const QValueList<QIconDragItem> &lst );#endif virtual void dragEntered(); virtual void dragLeft(); void setItemRect( const QRect &r ); void setTextRect( const QRect &r ); void setPixmapRect( const QRect &r ); void calcTmpText();private: void init( QIconViewItem *after = 0 ); void renameItem(); void cancelRenameItem(); void checkRect(); QIconView *view; QString itemText, itemKey; QString tmpText; QPixmap *itemIcon; QIconViewItem *prev, *next; uint allow_rename : 1; uint allow_drag : 1; uint allow_drop : 1; uint selected : 1; uint selectable : 1; uint dirty : 1; uint wordWrapDirty : 1; QRect itemRect, itemTextRect, itemIconRect; QIconViewItemLineEdit *renameBox; QRect oldRect; QIconViewItemPrivate *d;#if defined(QT_EZX_MUNGE)public: QRect globalRect(void);#endif /* defined(QT_EZX_MUNGE) */};/***************************************************************************** * * Class QIconView
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -