Doc: Compile dropevents snippets
Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I8d2eebcd82f47c500a215e310b5828f9b7e303c6 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>bb10
parent
88e3bdb6e6
commit
4dd53a40aa
|
|
@ -1,3 +1,6 @@
|
|||
HEADERS = window.h
|
||||
SOURCES = main.cpp \
|
||||
window.cpp
|
||||
TEMPLATE = lib
|
||||
TARGET = dropevents_snippets
|
||||
QT += core gui widgets
|
||||
|
||||
SOURCES = \
|
||||
window.cpp
|
||||
|
|
|
|||
|
|
@ -47,10 +47,31 @@
|
|||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#include <QComboBox>
|
||||
#include <QDragEnterEvent>
|
||||
#include <QLabel>
|
||||
#include <QMimeData>
|
||||
#include <QTextBrowser>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
#include <QtGui>
|
||||
namespace dropevents {
|
||||
class Window : public QWidget
|
||||
{
|
||||
|
||||
#include "window.h"
|
||||
public:
|
||||
explicit Window(QWidget *parent = nullptr);
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QDragEnterEvent *event) override;
|
||||
void dropEvent(QDropEvent *event) override;
|
||||
|
||||
private:
|
||||
QComboBox *mimeTypeCombo = nullptr;
|
||||
QTextBrowser *textBrowser = nullptr;
|
||||
QString oldText;
|
||||
QStringList oldMimeTypes;
|
||||
};
|
||||
|
||||
//! [0]
|
||||
Window::Window(QWidget *parent)
|
||||
|
|
@ -95,3 +116,5 @@ void Window::dropEvent(QDropEvent *event)
|
|||
event->acceptProposedAction();
|
||||
}
|
||||
//! [4]
|
||||
|
||||
} // dropevents
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ contains(QT_BUILD_PARTS, tests) {
|
|||
code \
|
||||
draganddrop \
|
||||
droparea \
|
||||
dropevents \
|
||||
qfontdatabase \
|
||||
textblock-formats \
|
||||
textblock-fragments \
|
||||
|
|
|
|||
Loading…
Reference in New Issue