12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #include <assert.h>
- #include <QMainWindow>
- #include <QWidget>
- #include <gnu_java_awt_peer_qt_QtCanvasPeer.h>
- #include "qtcomponent.h"
- #include "keybindings.h"
- class MyCanvas : public QWidget
- {
- public:
- MyCanvas(JNIEnv *env, jobject obj, QWidget *parent) : QWidget( parent )
- {
- setup(env, obj);
- }
- ~MyCanvas()
- {
- destroy();
- }
- #define I_KNOW_WHAT_IM_DOING
- #define PARENT QWidget
- #include "eventmethods.h"
- };
- JNIEXPORT void JNICALL Java_gnu_java_awt_peer_qt_QtCanvasPeer_init
- (JNIEnv *env, jobject obj)
- {
- QWidget *parentWidget = (QWidget *)getParentWidget(env, obj);
-
- QWidget *canvas = new MyCanvas( env, obj, parentWidget );
- assert( canvas );
- setNativeObject( env, obj, canvas );
- }
|