mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-24 02:42:15 +02:00
commit
cb8320ca41
@ -1085,8 +1085,6 @@ SET(LAUNCHER_SOURCES
|
|||||||
ui/widgets/CustomCommands.h
|
ui/widgets/CustomCommands.h
|
||||||
ui/widgets/EnvironmentVariables.cpp
|
ui/widgets/EnvironmentVariables.cpp
|
||||||
ui/widgets/EnvironmentVariables.h
|
ui/widgets/EnvironmentVariables.h
|
||||||
ui/widgets/DropLabel.cpp
|
|
||||||
ui/widgets/DropLabel.h
|
|
||||||
ui/widgets/FocusLineEdit.cpp
|
ui/widgets/FocusLineEdit.cpp
|
||||||
ui/widgets/FocusLineEdit.h
|
ui/widgets/FocusLineEdit.h
|
||||||
ui/widgets/IconLabel.cpp
|
ui/widgets/IconLabel.cpp
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
#include "DropLabel.h"
|
|
||||||
|
|
||||||
#include <QDropEvent>
|
|
||||||
#include <QMimeData>
|
|
||||||
|
|
||||||
DropLabel::DropLabel(QWidget* parent) : QLabel(parent)
|
|
||||||
{
|
|
||||||
setAcceptDrops(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DropLabel::dragEnterEvent(QDragEnterEvent* event)
|
|
||||||
{
|
|
||||||
event->acceptProposedAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DropLabel::dragMoveEvent(QDragMoveEvent* event)
|
|
||||||
{
|
|
||||||
event->acceptProposedAction();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DropLabel::dragLeaveEvent(QDragLeaveEvent* event)
|
|
||||||
{
|
|
||||||
event->accept();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DropLabel::dropEvent(QDropEvent* event)
|
|
||||||
{
|
|
||||||
const QMimeData* mimeData = event->mimeData();
|
|
||||||
|
|
||||||
if (!mimeData) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mimeData->hasUrls()) {
|
|
||||||
auto urls = mimeData->urls();
|
|
||||||
emit droppedURLs(urls);
|
|
||||||
}
|
|
||||||
|
|
||||||
event->acceptProposedAction();
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QLabel>
|
|
||||||
|
|
||||||
class DropLabel : public QLabel {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit DropLabel(QWidget* parent = nullptr);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void droppedURLs(QList<QUrl> urls);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void dropEvent(QDropEvent* event) override;
|
|
||||||
void dragEnterEvent(QDragEnterEvent* event) override;
|
|
||||||
void dragMoveEvent(QDragMoveEvent* event) override;
|
|
||||||
void dragLeaveEvent(QDragLeaveEvent* event) override;
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user