Learn R Programming

qtutils (version 0.1-3)

qsceneDevice: Graphics device based on Qt's Graphics View framework

Description

Starts a QGraphicsScene graphics device.

Usage

qsceneDevice(width = 10, height = 10, pointsize = 12, family = "") QT(rscene, ..., antialias = TRUE, opengl = FALSE)

Arguments

width
Width of the scene in inches, assuming 72 pixels per inch.
height
Height of the scene in inches, assuming 72 pixels per inch.
pointsize
Default pointsize.
family
Default font family.
rscene
A QGraphicsScene instance produced by a call to qsceneDevice. Can be missing, in which case a suitable instance will be created (see ... below).
...
Arguments passed on to qsceneDevice if rscene is missing.
antialias
Logical flag. Specifies whether the view should be antialiased.
opengl
Logical flag. Specifies whether the view should be a QGLWidget, used for rendering OpenGL graphics.

Value

qsceneDevice returns a QGraphicsScene instance. Drawing operations will result in QGraphicsItems being added to the scene. Note that unlike common R graphics devices, the return value is nontrivial.QT returns a QGraphicsView instance.

Details

qsceneDevice starts a graphics device that is based on Qt's Graphics View framework. In the abstract sense, the device is a ‘graphics scene’, which contains various graphical items such as circles, lines, and text. The scene itself is not tied to a particular on-screen view or output file. Further steps must be taken to view the contents of the scene, or render it to a file in a suitable format.

QT is convenient user-level wrapper for the qsceneDevice device. It returns a QGraphicsView instance (which is also a QWidget instance) whose scene is set to the QGraphicsScene instance created by a call to qsceneDevice(...). In addition, several predefined actions are associated with the view, allowing (through a context menu and keyboard shortcuts) zooming, printing, and exporting as a bitmap image. The device also supports basic interaction, namely, confirming new pages by pressing Enter and locator functionality.