mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2025-02-25 18:55:24 -06:00
qt: update ReadableDisplay
This commit is contained in:
parent
716545f0a1
commit
5b9c0b2cc4
@ -1,4 +1,21 @@
|
|||||||
#include "ReadableDisplay.h"
|
#include "ReadableDisplay.h"
|
||||||
|
|
||||||
ReadableDisplay::ReadableDisplay(QWidget *parent) : QWidget(parent) {
|
ReadableDisplay::ReadableDisplay(QWidget *parent) : QWidget(parent) {
|
||||||
|
setAcceptDrops(true);
|
||||||
|
|
||||||
|
m_displayWidgetLayout = new QVBoxLayout;
|
||||||
|
|
||||||
|
m_displayWidgetLayout->addWidget(new ReadableGraphDisplay);
|
||||||
|
|
||||||
|
setLayout(m_displayWidgetLayout);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadableDisplay::dropEvent(QDropEvent *event) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadableDisplay::dragEnterEvent(QDragEnterEvent *event) {
|
||||||
|
if (!event->mimeData()->hasFormat(ReadableData::mimeType())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
event->accept();
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,19 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QMimeData>
|
||||||
|
#include <QDragEnterEvent>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
|
#include <ReadableData.h>
|
||||||
|
#include "ReadableGraphDisplay.h"
|
||||||
|
|
||||||
class ReadableDisplay : public QWidget {
|
class ReadableDisplay : public QWidget {
|
||||||
public:
|
public:
|
||||||
ReadableDisplay(QWidget *parent = nullptr);
|
ReadableDisplay(QWidget *parent = nullptr);
|
||||||
|
protected:
|
||||||
|
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||||
|
void dropEvent(QDropEvent *event) override;
|
||||||
|
private:
|
||||||
|
QVBoxLayout *m_displayWidgetLayout;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user