Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kdiroperatorcolumnview.cpp
- This file was added.
| 1 | /***************************************************************************** | ||||
|---|---|---|---|---|---|
| 2 | * Copyright (C) 2017 by Fabian Vogt <fabian@ritter-vogt.de> * | ||||
| 3 | * Copyright (C) 2007 by Peter Penz <peter.penz@gmx.at> * | ||||
| 4 | * * | ||||
| 5 | * This library is free software; you can redistribute it and/or * | ||||
| 6 | * modify it under the terms of the GNU Library General Public * | ||||
| 7 | * License version 2 as published by the Free Software Foundation. * | ||||
| 8 | * * | ||||
| 9 | * This library is distributed in the hope that it will be useful, * | ||||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * | ||||
| 12 | * Library General Public License for more details. * | ||||
| 13 | * * | ||||
| 14 | * You should have received a copy of the GNU Library General Public License * | ||||
| 15 | * along with this library; see the file COPYING.LIB. If not, write to * | ||||
| 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * | ||||
| 17 | * Boston, MA 02110-1301, USA. * | ||||
| 18 | *****************************************************************************/ | ||||
| 19 | | ||||
| 20 | #include "kdiroperatorcolumnview_p.h" | ||||
| 21 | | ||||
| 22 | #include <kdirlister.h> | ||||
| 23 | #include <kdirmodel.h> | ||||
| 24 | #include <QDebug> | ||||
| 25 | | ||||
| 26 | #include <QtCore/QEvent> | ||||
| 27 | #include <QtCore/QTimer> | ||||
| 28 | #include <QAbstractProxyModel> | ||||
| 29 | #include <QApplication> | ||||
| 30 | #include <QHeaderView> | ||||
| 31 | #include <QListView> | ||||
| 32 | #include <QMimeData> | ||||
| 33 | #include <QResizeEvent> | ||||
| 34 | #include <QScrollBar> | ||||
| 35 | | ||||
| 36 | KDirOperatorColumnView::KDirOperatorColumnView(QWidget *parent) : | ||||
| 37 | KColumnView(parent) | ||||
| 38 | { | ||||
| 39 | setDragDropMode(QAbstractItemView::DragOnly); | ||||
| 40 | setSelectionBehavior(QAbstractItemView::SelectRows); | ||||
| 41 | setEditTriggers(QAbstractItemView::NoEditTriggers); | ||||
| 42 | setResizeGripsVisible(false); | ||||
| 43 | setPreviewWidget(nullptr); | ||||
| 44 | } | ||||
| 45 | | ||||
| 46 | KDirOperatorColumnView::~KDirOperatorColumnView() | ||||
| 47 | { | ||||
| 48 | } | ||||
| 49 | | ||||
| 50 | void KDirOperatorColumnView::dragEnterEvent(QDragEnterEvent *event) | ||||
| 51 | { | ||||
| 52 | if (event->mimeData()->hasUrls()) { | ||||
| 53 | event->acceptProposedAction(); | ||||
| 54 | } | ||||
| 55 | } | ||||