diff --git a/core/utilities/timeadjust/detbyclockphotobutton.cpp b/core/utilities/timeadjust/detbyclockphotobutton.cpp index cd147776ea..a59ef74821 100644 --- a/core/utilities/timeadjust/detbyclockphotobutton.cpp +++ b/core/utilities/timeadjust/detbyclockphotobutton.cpp @@ -1,54 +1,59 @@ /* ============================================================ * * This file is a part of the digikam project * http://www.digikam.org * * Date : 2017-01-01 * Description : button for choosing time difference photo which accepts drag & drop * * Copyright (C) 2017 by Markus Leuthold * * 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, 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. * * ============================================================ */ #include "detbyclockphotobutton.h" // Qt includes #include // local includes #include "digikam_debug.h" namespace Digikam { void DetByClockPhotoButton::dragEnterEvent(QDragEnterEvent* event) { event->acceptProposedAction(); } +void DetByClockPhotoButton::dragMoveEvent(QDragMoveEvent* event) +{ + event->acceptProposedAction(); +} + void DetByClockPhotoButton::dropEvent(QDropEvent* event) { const QMimeData* const mimeData = event->mimeData(); if (mimeData && mimeData->hasUrls()) { // if user dropped more than one image, take the first one QUrl url = mimeData->urls().first(); qCDebug(DIGIKAM_GENERAL_LOG) << "Dropped clock photo:" << url; emit signalClockPhotoDropped(url); } } } // namespace Digikam diff --git a/core/utilities/timeadjust/detbyclockphotobutton.h b/core/utilities/timeadjust/detbyclockphotobutton.h index 8e9610dbf6..0845196f83 100644 --- a/core/utilities/timeadjust/detbyclockphotobutton.h +++ b/core/utilities/timeadjust/detbyclockphotobutton.h @@ -1,56 +1,57 @@ /* ============================================================ * * This file is a part of the digikam project * http://www.digikam.org * * Date : 2017-01-01 * Description : button for choosing time difference photo which accepts drag & drop * * Copyright (C) 2017 by Markus Leuthold * * 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, 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. * * ============================================================ */ #ifndef DIGIKAM_DET_BY_CLOCK_PHOTO_BUTTON_H #define DIGIKAM_DET_BY_CLOCK_PHOTO_BUTTON_H // Qt includes #include #include namespace Digikam { class DetByClockPhotoButton : public QPushButton { Q_OBJECT public: explicit DetByClockPhotoButton(const QString& text) : QPushButton(text) { setAcceptDrops(true); }; void dragEnterEvent(QDragEnterEvent* event); + void dragMoveEvent(QDragMoveEvent* event); void dropEvent(QDropEvent* event); Q_SIGNALS: void signalClockPhotoDropped(const QUrl&); }; } // namespace Digikam #endif // DIGIKAM_DET_BY_CLOCK_PHOTO_BUTTON_H