diff options
| author | Peter Penz <[email protected]> | 2007-11-20 21:11:48 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-11-20 21:11:48 +0000 |
| commit | e46003aca365ca66ce7c7cccd47fb52d1da2fb91 (patch) | |
| tree | ea8b80800a5986f0e47f90e93c2b70f270af8a87 /src/draganddrophelper.h | |
| parent | ddacabc391ddfe95dff909a00946182dc15f9990 (diff) | |
Drag & drop fixes for all views: assure that a consistent pixmap for the drag object is used throughout all views (still open yet: KCategorizedView uses its custom code yet)
svn path=/trunk/KDE/kdebase/apps/; revision=739322
Diffstat (limited to 'src/draganddrophelper.h')
| -rw-r--r-- | src/draganddrophelper.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/draganddrophelper.h b/src/draganddrophelper.h new file mode 100644 index 000000000..9e174959b --- /dev/null +++ b/src/draganddrophelper.h @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (C) 2007 by Peter Penz <[email protected]> * + * * + * 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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef DRAGANDDROPHELPER_H +#define DRAGANDDROPHELPER_H + +#include <Qt> + +class QAbstractItemView; +class QBrush; +class QRect; +class QWidget; + +/** + * @brief Helper class to bypass some drag & drop limitations in Qt. + * + * The class is used by DolphinIconsView, DolphinDetailsView, + * DolphinColumnView and SidebarTreeView to have a consistent + * drag and drop behavior between all views. + */ +class DragAndDropHelper +{ + +public: + /** + * Creates a drag object for the view \a itemView for all selected items. + */ + static void startDrag(QAbstractItemView* itemView, Qt::DropActions supportedActions); + + // TODO: remove this method when the issue #160611 is solved in Qt 4.4 + static void drawHoverIndication(QWidget* widget, + const QRect& bounds, + const QBrush& brush); +}; + +#endif |
