Qt: QGraphicsView notes

Qt’s graphics/viewarchitecture has a non-visual class for holding the item data as a model (QGraphicsScene), and a class for visualizing the data (QGraphicsView).

The way to add standard QWidgets to a scene is to create a QGraphicsProxyWidget for each QWidget, and add the proxy to the scene.

Structurally, using the graphics/view architecture to provide a mainwindow’s widgets is not so very different from the more conventional approach. The only significant differences are that we must create and add proxy widgets for the actual widgets, and that we must use graphics/view-specific layouts rather than the standard layout classes. Of course, if we wanted to use QGraphicsWidget subclasses there would be no need to create proxies for them, since we can add these directly into a scene.

Source:

Advanced Qt Programming: Creating Great Software with C++ and Qt 4

Advertisements
This entry was posted in Qt and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s