File indexing completed on 2024-04-21 04:32:08
0001 /* 0002 * Copyright (C) 2011-2015 by Stephen Allewell 0003 * steve.allewell@gmail.com 0004 * 0005 * This program is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation; either version 2 of the License, or 0008 * (at your option) any later version. 0009 */ 0010 0011 #ifndef LibraryListWidget_H 0012 #define LibraryListWidget_H 0013 0014 #include <QListWidget> 0015 #include <QWidget> 0016 0017 #include "Renderer.h" 0018 0019 class QString; 0020 0021 class Renderer; 0022 0023 class LibraryListWidget : public QListWidget 0024 { 0025 public: 0026 explicit LibraryListWidget(QWidget *parent); 0027 virtual ~LibraryListWidget() = default; 0028 0029 void setCellSize(double, double); 0030 void changeIconSize(int); 0031 0032 protected: 0033 virtual void dragEnterEvent(QDragEnterEvent *) Q_DECL_OVERRIDE; 0034 virtual void dragMoveEvent(QDragMoveEvent *) Q_DECL_OVERRIDE; 0035 virtual void dragLeaveEvent(QDragLeaveEvent *) Q_DECL_OVERRIDE; 0036 virtual void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; 0037 virtual void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; 0038 0039 private: 0040 Renderer m_renderer; 0041 0042 QPoint m_startDrag; 0043 0044 double m_cellWidth; 0045 double m_cellHeight; 0046 }; 0047 0048 #endif // LibraryListWidget_H