Widget to generate Image files. More...
Inherits QMainWindow.
Public Types | |
enum | Flags { ShowScale =0x0001 } |
Public Member Functions | |
CellImage (QWidget *parent=NULL) | |
virtual | ~CellImage () |
void | setScreenCellWidget (CellWidget *) |
void | setMode (int mode) |
QImage * | toImage (unsigned int flags=0) |
Widget to generate Image files.
CellImage is a simple Qt Widget to write the contents of a CellWidget into a QImage. As it may uses lots of memory (due to the high-res bitmaps) it is advisable to delete it immediatly after usage. The same rendering engine is used to both display on screen and onto the image so it is a "What You See Is What You Get" mode (except for the higher resolution).
It's use is straigtforward, as shown in the example below. It consist of six steps:
Code example (took from CellViewer):
The CellImage reads the following configuration variables for it's defaults settings (they are located in misc.conf
, for the system-wide settings).
"viewer.printer.mode"
, select between the two resolution modes (Cell or Design). This widget is build as a QMainWindow (top-level) one encapsulating only a CellWidget. It is configured to never been shown thanks to the Qt::WA_DontShowOnScreen
attribute, but all the display computations still takes place as if it actually was.
The CellImage returns a newly allocated QImage, it is the responsability of the caller to delete it after usage.
To obtain a sufficent resolution the CellImage/CellWidget are resized to the resolution of the printed page. For a better look select a display style with patterns of 32x32 pixels, such as "Image.Coriolis"
.
Hurricane::CellImage::CellImage | ( | QWidget * | parent = NULL | ) |
Construct a CellImage window no screen CellWidget is actually bound.
|
virtual |
Destructor.
void Hurricane::CellImage::setScreenCellWidget | ( | CellWidget * | screenCellWidget | ) |
Bind the CellImage to the screen CellWidget screenCellWidget
. It is those contents that will be printed.
|
inline |
Sets the display mode, that is the resolution that will be used. Two modes are availables:
QImage * Hurricane::CellImage::toImage | ( | unsigned int | flags = 0 | ) |
flags | Control some tweaks. |
screenCellWidget
. The deletion of the QImage is left to caller.Availables flags:
Generated by doxygen 1.9.1 on Thu Aug 11 2022 | Return to top of page |
Hurricane Design Viewer | Copyright © 2008-2020 Sorbonne Universite All rights reserved |