diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-07-08 07:44:30 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2010-07-08 07:44:30 +0200 |
commit | 3d75736bb30623c5858fec33ad8c0a3419d35c52 (patch) | |
tree | 766f0f5b7db7f175b5578d8c4c79798119d04d3d /qwidgethostnative.h |
Diffstat (limited to 'qwidgethostnative.h')
-rw-r--r-- | qwidgethostnative.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/qwidgethostnative.h b/qwidgethostnative.h new file mode 100644 index 0000000..e753b75 --- /dev/null +++ b/qwidgethostnative.h @@ -0,0 +1,34 @@ +#ifndef QWIDGETHOSTNATIVE_H +#define QWIDGETHOSTNATIVE_H + +#include <QtGui> + +#if defined(QT_JAMBI_RUN) +# define QWIDGETHOSTNATIVE_BASECLASS QWidget +#elif defined(Q_OS_WIN32) +# include "qwinwidget.h" +# define QWIDGETHOSTNATIVE_BASECLASS QWinWidget +#else +# include <QtGui/QX11EmbedWidget> +# define QWIDGETHOSTNATIVE_BASECLASS QX11EmbedWidget +#endif + +#include <jni.h> + +class QWidgetHostNative: public QWIDGETHOSTNATIVE_BASECLASS +{ +public: + QWidgetHostNative(jobject parentWindow); + +protected: + void childEvent(QChildEvent *e); + bool eventFilter(QObject *o, QEvent *e); + void focusInEvent(QFocusEvent *e); + bool event(QEvent *); + void resizeEvent(QResizeEvent *); + +private: + WId getWindowHandle(jobject window); +}; + +#endif |