NOISSUE continue reshuffling the codebase
This commit is contained in:
parent
5040231f8d
commit
b258eac215
244 changed files with 516 additions and 768 deletions
41
launcher/ui/widgets/DropLabel.cpp
Normal file
41
launcher/ui/widgets/DropLabel.cpp
Normal file
|
@ -0,0 +1,41 @@
|
|||
#include "DropLabel.h"
|
||||
|
||||
#include <QMimeData>
|
||||
#include <QDropEvent>
|
||||
|
||||
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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue