mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 08:47:18 +01:00
Qt5: added QLCLOpenGLWidget. part of issue #36342
Qt5: cbindings library version update to 1.2.8 git-svn-id: trunk@62760 -
This commit is contained in:
parent
8ac43cbd8d
commit
fc7eba9872
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -10529,6 +10529,9 @@ lcl/interfaces/qt5/cbindings/src/qlclitemdelegate_c.h svneol=native#text/plain
|
||||
lcl/interfaces/qt5/cbindings/src/qlclmessageevent.h svneol=native#text/plain
|
||||
lcl/interfaces/qt5/cbindings/src/qlclmessageevent_c.cpp svneol=native#text/plain
|
||||
lcl/interfaces/qt5/cbindings/src/qlclmessageevent_c.h svneol=native#text/plain
|
||||
lcl/interfaces/qt5/cbindings/src/qlclopenglwidget.h svneol=native#text/plain
|
||||
lcl/interfaces/qt5/cbindings/src/qlclopenglwidget_c.cpp svneol=native#text/plain
|
||||
lcl/interfaces/qt5/cbindings/src/qlclopenglwidget_c.h svneol=native#text/plain
|
||||
lcl/interfaces/qt5/cbindings/src/qlcltabwidget.h svneol=native#text/plain
|
||||
lcl/interfaces/qt5/cbindings/src/qlcltabwidget_c.cpp svneol=native#text/plain
|
||||
lcl/interfaces/qt5/cbindings/src/qlcltabwidget_c.h svneol=native#text/plain
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
# Binding Release Version 2.6 against Qt5 5.6 LTS release.
|
||||
# WebKit widgets are disabled until webenginewidgets are implemented.
|
||||
|
||||
VERSION = 1.2.7
|
||||
VERSION = 1.2.8
|
||||
|
||||
QT += gui network printsupport
|
||||
TARGET = Qt5Pas
|
||||
@ -158,6 +158,7 @@ HEADERS += \
|
||||
qwindow_hook.h \
|
||||
qwidget_c.h \
|
||||
qwidget_hook.h \
|
||||
qlclopenglwidget_c.h \
|
||||
qlayoutitem_c.h \
|
||||
qlayout_c.h \
|
||||
qlayout_hook.h \
|
||||
@ -505,6 +506,7 @@ SOURCES += \
|
||||
qscreen_c.cpp \
|
||||
qwindow_c.cpp \
|
||||
qwidget_c.cpp \
|
||||
qlclopenglwidget_c.cpp \
|
||||
qlayoutitem_c.cpp \
|
||||
qlayout_c.cpp \
|
||||
qboxlayout_c.cpp \
|
||||
|
||||
@ -48,6 +48,7 @@ typedef struct QCheckBox_hook__ { PTRINT dummy; } *QCheckBox_hookH;
|
||||
typedef struct QModelIndex__ { PTRINT dummy; } *QModelIndexH;
|
||||
typedef struct QLocale__ { PTRINT dummy; } *QLocaleH;
|
||||
typedef struct QWidget__ { PTRINT dummy; } *QWidgetH;
|
||||
typedef struct QLCLOpenGLWidget__ { PTRINT dummy; } *QLCLOpenGLWidgetH;
|
||||
typedef struct QRadialGradient__ { PTRINT dummy; } *QRadialGradientH;
|
||||
typedef struct QStyle__ { PTRINT dummy; } *QStyleH;
|
||||
typedef struct QFontComboBox_hook__ { PTRINT dummy; } *QFontComboBox_hookH;
|
||||
|
||||
82
lcl/interfaces/qt5/cbindings/src/qlclopenglwidget.h
Normal file
82
lcl/interfaces/qt5/cbindings/src/qlclopenglwidget.h
Normal file
@ -0,0 +1,82 @@
|
||||
//******************************************************************************
|
||||
// Copyright (c) 2020 by Željan Rikalo
|
||||
//
|
||||
// See the included file COPYING.TXT for details about the copyright.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//******************************************************************************
|
||||
|
||||
#ifndef QLCLOPENGLWIDGET_H
|
||||
#define QLCLOPENGLWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "pascalbind.h"
|
||||
|
||||
class QLCLOpenGLWidget : public QWidget {
|
||||
|
||||
public:
|
||||
|
||||
//====================================================================================
|
||||
QLCLOpenGLWidget(QWidget * parent = 0, Qt::WindowFlags flags = Qt::Widget) : QWidget (parent, (Qt::WindowFlags)flags) {
|
||||
paintGLOverride.func = NULL;
|
||||
setAttribute(Qt::WA_NativeWindow);
|
||||
setAttribute(Qt::WA_PaintOnScreen);
|
||||
setAttribute(Qt::WA_NoSystemBackground);
|
||||
};
|
||||
|
||||
virtual QPaintEngine* paintEngine() const Q_DECL_OVERRIDE
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void override_paintGL(const QOverrideHook hook) {
|
||||
paintGLOverride = hook;
|
||||
}
|
||||
|
||||
void InheritedPaintGLOverride() {
|
||||
qInfo("empty inheritedPaintGLOverride called");
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//====================================================================================
|
||||
QOverrideHook paintGLOverride;
|
||||
//====================================================================================
|
||||
|
||||
void paintGL() {
|
||||
|
||||
|
||||
if (paintGLOverride.func) {
|
||||
|
||||
typedef void (*func_type)(void *data);
|
||||
(*(func_type)paintGLOverride.func)(paintGLOverride.data);
|
||||
}
|
||||
else InheritedPaintGLOverride();
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE {
|
||||
if (paintGLOverride.func) {
|
||||
Q_UNUSED(e);
|
||||
if (!isVisible())
|
||||
return;
|
||||
if (updatesEnabled()) {
|
||||
paintGL();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
QWidget::paintEvent(e);
|
||||
};
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
34
lcl/interfaces/qt5/cbindings/src/qlclopenglwidget_c.cpp
Normal file
34
lcl/interfaces/qt5/cbindings/src/qlclopenglwidget_c.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
//******************************************************************************
|
||||
// Copyright (c) 2020 Željan Rikalo
|
||||
//
|
||||
// See the included file COPYING.TXT for details about the copyright.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//******************************************************************************
|
||||
|
||||
|
||||
#include "qlclopenglwidget_c.h"
|
||||
|
||||
QLCLOpenGLWidgetH QLCLOpenGLWidget_Create(QWidgetH parent, unsigned int f)
|
||||
{
|
||||
return (QLCLOpenGLWidgetH) new QLCLOpenGLWidget((QWidget*)parent, (Qt::WindowFlags)f);
|
||||
}
|
||||
|
||||
void QLCLOpenGLWidget_Destroy(QLCLOpenGLWidgetH handle)
|
||||
{
|
||||
delete (QLCLOpenGLWidget *)handle;
|
||||
}
|
||||
|
||||
void QLCLOpenGLWidget_override_paintGL(QLCLOpenGLWidgetH handle, const QOverrideHook hook)
|
||||
{
|
||||
((QLCLOpenGLWidget *)handle)->override_paintGL(hook);
|
||||
}
|
||||
|
||||
void QLCLOpenGLWidget_InheritedPaintGL(QLCLOpenGLWidgetH handle)
|
||||
{
|
||||
((QLCLOpenGLWidget *)handle)->InheritedPaintGLOverride();
|
||||
}
|
||||
|
||||
|
||||
23
lcl/interfaces/qt5/cbindings/src/qlclopenglwidget_c.h
Normal file
23
lcl/interfaces/qt5/cbindings/src/qlclopenglwidget_c.h
Normal file
@ -0,0 +1,23 @@
|
||||
//******************************************************************************
|
||||
// Copyright (c) 2020 by Željan Rikalo
|
||||
//
|
||||
// See the included file COPYING.TXT for details about the copyright.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//******************************************************************************
|
||||
|
||||
|
||||
#ifndef QLCLOPENGLWIDGET_C_H
|
||||
#define QLCLOPENGLWIDGET_C_H
|
||||
|
||||
#include "qlclopenglwidget.h"
|
||||
#include "pascalbind.h"
|
||||
|
||||
C_EXPORT QLCLOpenGLWidgetH QLCLOpenGLWidget_Create(QWidgetH parent, unsigned int f);
|
||||
C_EXPORT void QLCLOpenGLWidget_Destroy(QLCLOpenGLWidgetH handle);
|
||||
C_EXPORT void QLCLOpenGLWidget_override_paintGL(QLCLOpenGLWidgetH handle, const QOverrideHook hook);
|
||||
C_EXPORT void QLCLOpenGLWidget_InheritedPaintGL(QLCLOpenGLWidgetH handle);
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user