CopperSpice API  1.9.1
QPaintDeviceWindow Class Reference

Subclass of the QWindow class. More...

Inheritance diagram for QPaintDeviceWindow:
QWindow QPaintDevice QObject QSurface QOpenGLWindow QRasterWindow

Public Slots

void update ()
 
- Public Slots inherited from QWindow
void alert (int msec)
 
bool close ()
 
void hide ()
 
void lower ()
 
void raise ()
 
void requestActivate ()
 
void requestUpdate ()
 
void setMaximumWidth (int width)
 
void setVisible (bool visible)
 
void show ()
 
void showFullScreen ()
 
void showMaximized ()
 
void showMinimized ()
 
void showNormal ()
 
- Public Slots inherited from QObject
void deleteLater ()
 

Public Methods

qreal devicePixelRatio () const
 
void update (const QRect &rect)
 
void update (const QRegion &region)
 
- Public Methods inherited from QWindow
 QWindow (QScreen *screen=nullptr)
 
 QWindow (QWindow *parent)
 
virtual ~QWindow ()
 
QSize baseSize () const
 
Qt::ScreenOrientation contentOrientation () const
 
void create ()
 
QCursor cursor () const
 
void destroy ()
 
qreal devicePixelRatio () const
 
QString filePath () const
 
Qt::WindowFlags flags () const
 
virtual QObjectfocusObject () const
 
QSurfaceFormat format () const override
 
QRect frameGeometry () const
 
QMargins frameMargins () const
 
QPoint framePosition () const
 
QRect geometry () const
 
QIcon icon () const
 
bool isActive () const
 
bool isAncestorOf (const QWindow *child, AncestorMode mode=IncludeTransients) const
 
bool isExposed () const
 
bool isModal () const
 
bool isTopLevel () const
 
bool isVisible () const
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QRegion mask () const
 
QSize maximumSize () const
 
QSize minimumSize () const
 
Qt::WindowModality modality () const
 
QWindow * parent () const
 
QPoint position () const
 
void reportContentOrientationChange (Qt::ScreenOrientation orientation)
 
QSurfaceFormat requestedFormat () const
 
void resize (const QSize &newSize)
 
void resize (int w, int h)
 
QScreenscreen () const
 
void setBaseSize (const QSize &size)
 
void setCursor (const QCursor &cursor)
 
void setFilePath (const QString &filePath)
 
void setFlags (Qt::WindowFlags flags)
 
void setFormat (const QSurfaceFormat &format)
 
void setFramePosition (const QPoint &point)
 
void setGeometry (const QRect &rect)
 
void setGeometry (int posx, int posy, int w, int h)
 
void setIcon (const QIcon &icon)
 
bool setKeyboardGrabEnabled (bool grab)
 
void setMask (const QRegion &region)
 
void setMaximumSize (const QSize &size)
 
void setMinimumSize (const QSize &size)
 
void setModality (Qt::WindowModality modality)
 
bool setMouseGrabEnabled (bool grab)
 
void setParent (QWindow *parent)
 
void setPosition (const QPoint &pt)
 
void setPosition (int posx, int posy)
 
void setScreen (QScreen *screen)
 
void setSizeIncrement (const QSize &size)
 
void setSurfaceType (SurfaceType surfaceType)
 
void setTransientParent (QWindow *parent)
 
void setVulkanInstance (QVulkanInstance *instance)
 
void setWindowState (Qt::WindowState state)
 
QSize size () const override
 
QSize sizeIncrement () const
 
SurfaceType surfaceType () const override
 
QWindow * transientParent () const
 
Qt::WindowType type () const
 
void unsetCursor ()
 
QVulkanInstancevulkanInstance () const
 
Qt::WindowState windowState () const
 
WId winId () const
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 
- Public Methods inherited from QSurface
virtual ~QSurface ()
 
virtual QSurfaceFormat format () const = 0
 
virtual QSize size () const = 0
 
bool supportsOpenGL () const
 
SurfaceClass surfaceClass () const
 
virtual QPlatformSurfacesurfaceHandle () const = 0
 
virtual SurfaceType surfaceType () const = 0
 
- Public Methods inherited from QPaintDevice
virtual ~QPaintDevice ()
 
int colorCount () const
 
int depth () const
 
int devicePixelRatio () const
 
qreal devicePixelRatioF () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
int width () const
 
int widthMM () const
 

Protected Methods

int metric (PaintDeviceMetric metric) const override
 
virtual void paintEvent (QPaintEvent *event)
 
- Protected Methods inherited from QWindow
bool event (QEvent *event) override
 
virtual void exposeEvent (QExposeEvent *event)
 
virtual void focusInEvent (QFocusEvent *event)
 
virtual void focusOutEvent (QFocusEvent *event)
 
virtual void hideEvent (QHideEvent *event)
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void moveEvent (QMoveEvent *event)
 
virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void showEvent (QShowEvent *event)
 
virtual void tabletEvent (QTabletEvent *event)
 
virtual void wheelEvent (QWheelEvent *event)
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Methods inherited from QSurface
 QSurface (SurfaceClass type)
 
- Protected Methods inherited from QPaintDevice
 QPaintDevice ()
 

Properties

 height
 
 width
 
- Properties inherited from QWindow
 active
 
 contentOrientation
 
 flags
 
 height
 
 maximumHeight
 
 maximumWidth
 
 minimumHeight
 
 minimumWidth
 
 modality
 
 opacity
 
 title
 
 visibility
 
 visible
 
 width
 
 x
 
 y
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Public Types inherited from QWindow
enum  AncestorMode
 
enum  Visibility
 
- Public Types inherited from QSurface
enum  SurfaceClass
 
enum  SurfaceType
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric
 
- Public Signals inherited from QWindow
void contentOrientationChanged (Qt::ScreenOrientation orientation)
 
void focusObjectChanged (QObject *object)
 
void modalityChanged (Qt::WindowModality modality)
 
void screenChanged (QScreen *screen)
 
void windowStateChanged (Qt::WindowState windowState)
 
- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 
- Static Public Methods inherited from QWindow
static QWindow * fromWinId (WId id)
 
- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 

Detailed Description

QPaintDeviceWindow is a subclass of the QWindow class with added functionality. Whenever the content needs to be updated the virtual paintEvent() method is called. This class should normally not be used directly in your application. It is intended to be used as a base class which your code will inherit and extend functionality.

See also
QOpenGLWindow

Method Documentation

qreal QWindow::devicePixelRatio ( ) const
using

Returns the ratio between physical pixels and device-independent pixels for the window. This value is dependent on the screen the window is on, and may change when the window is moved.

Common values are 1.0 on normal displays and 2.0 on Apple "retina" displays.

Note
For windows not backed by a platform window, meaning that create() was not called, the function will fall back to QApplication::devicePixelRatio() which in turn returns the highest screen device pixel ratio found on the system.
See also
QScreen::devicePixelRatio(), QApplication::devicePixelRatio()
int QPaintDeviceWindow::metric ( PaintDeviceMetric  metric) const
overrideprotectedvirtual

Returns the metric information for the given paint device metric.

See also
PaintDeviceMetric

Reimplemented from QPaintDevice::metric()

Reimplemented in QRasterWindow::metric()

void QPaintDeviceWindow::paintEvent ( QPaintEvent event)
protectedvirtual

Handles paint events passed by the parameter event. The default implementation does nothing and must be reimplement in an inherited class to perform painting. If necessary the dirty area is retrievable from the event.

Reimplemented in QOpenGLWindow::paintEvent()

void QPaintDeviceWindow::update ( )
slot

Marks the entire window as dirty and schedules a repaint. Subsequent calls to this method before the next paint event will get ignored. For non-exposed windows the update is deferred until the window becomes exposed again.

void QPaintDeviceWindow::update ( const QRect rect)

Marks the rect of the window as dirty and schedules a repaint. Subsequent calls to this method before the next paint event will get ignored, but rect is added to the region to update. For non-exposed windows the update is deferred until the window becomes exposed again.

void QPaintDeviceWindow::update ( const QRegion region)

Marks the region of the window as dirty and schedules a repaint. Subsequent calls to this function before the next paint event will get ignored, but region is added to the region to update. For non-exposed windows the update is deferred until the window becomes exposed again.

Property Documentation

QWindow::height
using

The height of the window's geometry.

PropertiesClass Methods
read
write
notify
QWindow::width
using

The width of the window's geometry.

PropertiesClass Methods
read
write
notify