diff options
Diffstat (limited to 'src/gui/doc')
-rw-r--r-- | src/gui/doc/snippets/dropevents/dropevents.pro | 9 | ||||
-rw-r--r-- | src/gui/doc/snippets/dropevents/window.cpp | 27 | ||||
-rw-r--r-- | src/gui/doc/snippets/snippets.pro | 1 |
3 files changed, 32 insertions, 5 deletions
diff --git a/src/gui/doc/snippets/dropevents/dropevents.pro b/src/gui/doc/snippets/dropevents/dropevents.pro index 6283406f25..54c3ceeb5b 100644 --- a/src/gui/doc/snippets/dropevents/dropevents.pro +++ b/src/gui/doc/snippets/dropevents/dropevents.pro @@ -1,3 +1,6 @@ -HEADERS = window.h -SOURCES = main.cpp \ - window.cpp +TEMPLATE = lib +TARGET = dropevents_snippets +QT += core gui widgets + +SOURCES = \ + window.cpp diff --git a/src/gui/doc/snippets/dropevents/window.cpp b/src/gui/doc/snippets/dropevents/window.cpp index c3445bcc75..a62b656b64 100644 --- a/src/gui/doc/snippets/dropevents/window.cpp +++ b/src/gui/doc/snippets/dropevents/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 +{ + +public: + explicit Window(QWidget *parent = nullptr); -#include "window.h" +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 diff --git a/src/gui/doc/snippets/snippets.pro b/src/gui/doc/snippets/snippets.pro index 079ffa7918..ce8ccd1577 100644 --- a/src/gui/doc/snippets/snippets.pro +++ b/src/gui/doc/snippets/snippets.pro @@ -8,6 +8,7 @@ contains(QT_BUILD_PARTS, tests) { code \ draganddrop \ droparea \ + dropevents \ qfontdatabase \ textblock-formats \ textblock-fragments \ |