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

Description Usage Arguments Details Value Note Author(s)

Description

Starts a QGraphicsScene graphics device.

Usage

1
2
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.

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.

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.

Note

There are several limitations in the current implementation, and it should not be considered stable. Reports of problematic behaviour (and of course suggested fixes) are welcome.

In particular, plotmath has trouble with character placement, although the characters themselves are mostly correct.

Author(s)

Deepayan Sarkar


qtutils documentation built on May 29, 2017, 5:54 p.m.

Related to sceneDevice in qtutils...