📄 qmlistview.h
字号:
/* ;-*-c++-*- * * qmlistview.h * * $Id: qmlistview.h,v 1.27 2002/03/31 23:52:41 kyllingstad Exp $ * * Apollo sound player: http://www.apolloplayer.org * Copyright(C) 2000-2002 Apollo Team. See CREDITS file. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * The GNU General Public License is also available online at: * * http://www.gnu.org/copyleft/gpl.html */#ifndef QMLISTVIEW_H_INCLUDED#define QMLISTVIEW_H_INCLUDED#include <qlistview.h>#include <qlist.h>#include "qmmainwindow.h"#include <qpoint.h>class QDomNode;class QTextStream;class QTimer;class QmDropIndicator;/*! \file qmlistview.h Definition of QmListView which adds a few features to QListView.*/class QmListView : public QListView{ Q_OBJECTpublic: enum InsertPosition { Below, Child }; QmListView(QWidget *parent = 0, const char *name = 0); virtual ~QmListView(); void reposition(QListViewItem *moveitem, QListViewItem *itemabove); void take(QListViewItem *item); QListViewItem* at(const QPoint &p) const; void insertBelow(QListViewItem *insertitem, QListViewItem *itemabove); QListViewItem* lastChild() const; QListViewItem* lastItem() const; bool hasSelectedItems(); void reorganizable(bool d); bool reorganizable() { return m_Reorganizable; } void enableSelfSave(const QString &filename); void disableSelfSave(); void save(); void save(QTextStream &out); const QString &fileName() const;protected: virtual void contentsMousePressEvent(QMouseEvent *e); virtual void contentsMouseMoveEvent(QMouseEvent *e); virtual void dragMoveEvent(QDragMoveEvent *e); virtual void dragEnterEvent(QDragEnterEvent *e); virtual void dragLeaveEvent(QDragLeaveEvent *e); virtual void dropEvent(QDropEvent *e); virtual bool canDecode(QDragMoveEvent *e); virtual void startDragging(); virtual void stopDragging(); QListViewItem* dropPos() { return m_pItemAbove; } virtual QList<QListViewItem>* selectedItems(); bool isParent(QListViewItem *parent, QListViewItem *item) const; void insertItem( QListViewItem *parent, QListViewItem *item, QListViewItem *after );private:// void startDragging();// void stopDragging(); bool isDroppable(QListViewItem *itemabove); bool isFolder(QListViewItem *item); QPoint indicatorPos(const QPoint &pos); bool atTopMargin( const QPoint &pos ); bool atBottomMargin( const QPoint &pos ); void moveIndicator( const QPoint &mousepos );protected slots: virtual void removeSelectedItems(); virtual void clear(); private slots: void slotScrollView();private: /*! The number of pixels the user must drag an item to start the DnD. */#ifdef _WS_WIN_ #define DRAG_THRESHOLD 3#else static const int DRAG_THRESHOLD = 3;#endif QPoint m_Click; QmDropIndicator *m_pDropIndicator; QListViewItem *m_pItemAbove; InsertPosition m_InsertPos; bool m_Reorganizable; QString m_FileName; QPoint m_DragPos, m_PointerPos; QTimer *m_pScrollTimer;};#endif // QMLISTVIEW_H_INCLUDED
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -