QOffscreenSurface: add a constructor taking a parent object
Just like all QObject subclasses. Use a delegating constructor call to share the code from the existing constructor. Change-Id: Ia3c893ccc4c94883e61337f8952d80b665c17fbf Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
ecf440d89d
commit
7be9653f12
@ -121,14 +121,16 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Creates an offscreen surface for the \a targetScreen.
|
\since 5.10
|
||||||
|
|
||||||
|
Creates an offscreen surface for the \a targetScreen with the given \a parent.
|
||||||
|
|
||||||
The underlying platform surface is not created until create() is called.
|
The underlying platform surface is not created until create() is called.
|
||||||
|
|
||||||
\sa setScreen(), create()
|
\sa setScreen(), create()
|
||||||
*/
|
*/
|
||||||
QOffscreenSurface::QOffscreenSurface(QScreen *targetScreen)
|
QOffscreenSurface::QOffscreenSurface(QScreen *targetScreen, QObject *parent)
|
||||||
: QObject(*new QOffscreenSurfacePrivate(), 0)
|
: QObject(*new QOffscreenSurfacePrivate(), parent)
|
||||||
, QSurface(Offscreen)
|
, QSurface(Offscreen)
|
||||||
{
|
{
|
||||||
Q_D(QOffscreenSurface);
|
Q_D(QOffscreenSurface);
|
||||||
@ -143,6 +145,18 @@ QOffscreenSurface::QOffscreenSurface(QScreen *targetScreen)
|
|||||||
connect(d->screen, SIGNAL(destroyed(QObject*)), this, SLOT(screenDestroyed(QObject*)));
|
connect(d->screen, SIGNAL(destroyed(QObject*)), this, SLOT(screenDestroyed(QObject*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Creates an offscreen surface for the \a targetScreen.
|
||||||
|
|
||||||
|
The underlying platform surface is not created until create() is called.
|
||||||
|
|
||||||
|
\sa setScreen(), create()
|
||||||
|
*/
|
||||||
|
QOffscreenSurface::QOffscreenSurface(QScreen *targetScreen)
|
||||||
|
: QOffscreenSurface(targetScreen, nullptr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Destroys the offscreen surface.
|
Destroys the offscreen surface.
|
||||||
|
@ -57,7 +57,8 @@ class Q_GUI_EXPORT QOffscreenSurface : public QObject, public QSurface
|
|||||||
Q_DECLARE_PRIVATE(QOffscreenSurface)
|
Q_DECLARE_PRIVATE(QOffscreenSurface)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
// ### Qt 6: merge overloads
|
||||||
|
explicit QOffscreenSurface(QScreen *screen, QObject *parent = Q_NULLPTR);
|
||||||
explicit QOffscreenSurface(QScreen *screen = Q_NULLPTR);
|
explicit QOffscreenSurface(QScreen *screen = Q_NULLPTR);
|
||||||
virtual ~QOffscreenSurface();
|
virtual ~QOffscreenSurface();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user