#include <MultiLayer.h>
Note that several parts of the code, as well as the user interface, refer to MultiLayer as "graph" or "plot", practically guaranteeing confusion with the classes Graph and Plot.
The main problem to be figured out for this is how Graph would interface with the rest of the project. A possible solution is outlined in the documentation of ApplicationWindow: If MultiLayer exposes its parent Project to the widgets it manages, they could handle things like creating tables by calling methods of Project instead of sending signals.
Public Types | |
enum | HorAlignement { HCenter, Left, Right } |
enum | VertAlignement { VCenter, Top, Bottom } |
Public Slots | |
void | activateGraph (LayerButton *button) |
Graph * | activeGraph () |
Graph * | addLayer (int x=0, int y=0, int width=0, int height=0) |
void | adjustSize () |
void | arrangeLayers (bool fit, bool userSize) |
QSize | arrangeLayers (bool userSize) |
int | bottomMargin () |
int | colsSpacing () |
void | confirmRemoveLayer () |
void | connectLayer (Graph *g) |
void | findBestLayout (int &rows, int &cols) |
int | getCols () |
int | getRows () |
int | horizontalAlignement () |
bool | isEmpty () |
QSize | layerCanvasSize () |
int | layers () |
int | leftMargin () |
void | removeLayer () |
int | rightMargin () |
int | rowsSpacing () |
QString | saveAsTemplate (const QString &geometryInfo) |
QString | saveToString (const QString &geometry, bool=false) |
void | setActiveGraph (Graph *g) |
void | setAlignement (int ha, int va) |
void | setCols (int c) |
void | setFonts (const QFont &titleFnt, const QFont &scaleFnt, const QFont &numbersFnt, const QFont &legendFnt) |
void | setGraphGeometry (int x, int y, int w, int h) |
void | setLayerCanvasSize (int w, int h) |
void | setLayersNumber (int n) |
void | setMargins (int lm, int rm, int tm, int bm) |
void | setRows (int r) |
void | setSpacing (int rgap, int cgap) |
bool | swapLayers (int src, int dest) |
int | topMargin () |
int | verticalAlignement () |
Print and Export | |
QPixmap | canvasPixmap () |
void | copyAllLayers () |
void | exportImage (const QString &fileName, int quality=100, bool transparent=false) |
void | exportPDF (const QString &fname) |
void | exportSVG (const QString &fname) |
void | exportToFile (const QString &fileName) |
void | exportVector (const QString &fileName, int res=0, bool color=true, bool keepAspect=true, QPrinter::PageSize pageSize=QPrinter::Custom) |
void | print () |
void | printActiveLayer () |
void | printAllLayers (QPainter *painter) |
Signals | |
void | createTable (const QString &, int, int, const QString &) |
void | currentFontChanged (const QFont &) |
void | cursorInfo (const QString &) |
void | drawLineEnded (bool) |
void | drawTextOff () |
void | enableTextEditor (Graph *) |
void | modifiedPlot () |
void | pasteMarker () |
void | setPointerCursor () |
void | showAxisDialog (int) |
void | showCurveContextMenu (int) |
void | showCurvesDialog () |
void | showGraphContextMenu () |
void | showImageDialog () |
void | showLineDialog () |
void | showMarkerPopupMenu () |
void | showPlotDialog (int) |
void | showRightAxisTitleDialog () |
void | showScaleDialog (int) |
void | showTextDialog () |
void | showTopAxisTitleDialog () |
void | showWindowContextMenu () |
void | showXAxisTitleDialog () |
void | showYAxisTitleDialog () |
void | viewTitleDialog () |
Public Member Functions | |
LayerButton * | addLayerButton () |
void | copy (MultiLayer *ml) |
QWidgetList | graphPtrs () |
Graph * | layer (int num) |
MultiLayer (const QString &label, QWidget *parent=0, const char *name=0, Qt::WFlags f=0) | |
void | printCropmarks (bool on) |
bool | printCropmarksEnabled () |
bool | scaleLayersOnPrint () |
void | setHidden () |
Notifies that a window was hidden by a direct user action. | |
void | setOpenMaximized () |
void | setScaleLayersOnPrint (bool on) |
Event Handlers | |
void | changeEvent (QEvent *) |
Catches parent changes (in order to gain access to the title bar). | |
void | contextMenuEvent (QContextMenuEvent *) |
bool | eventFilter (QObject *object, QEvent *) |
Filters other object's events (customizes title bar's context menu). | |
bool | focusNextPrevChild (bool next) |
void | keyPressEvent (QKeyEvent *) |
void | mousePressEvent (QMouseEvent *) |
void | releaseLayer () |
void | wheelEvent (QWheelEvent *) |
Private Member Functions | |
void | resizeLayers (const QSize &size, const QSize &oldSize, bool scaleFonts) |
void | resizeLayers (const QResizeEvent *re) |
Private Attributes | |
Graph * | active_graph |
int | bottom_margin |
QWidgetList | buttonsList |
QWidget * | canvas |
int | cols |
int | colsSpace |
QPointer< SelectionMoveResizer > | d_layers_selector |
QSize | d_max_size |
Stores the size of the widget in the Qt::WindowMaximized state. | |
QSize | d_normal_size |
Stores the size of the widget in Qt::WindowNoState (normal state). | |
int | d_open_maximized |
bool | d_print_cropmarks |
bool | d_scale_on_print |
int | graph_height |
int | graph_width |
int | graphs |
Used for resizing of layers. | |
QWidgetList | graphsList |
int | hor_align |
int | l_canvas_height |
int | l_canvas_width |
QHBoxLayout * | layerButtonsBox |
int | left_margin |
int | right_margin |
int | rows |
int | rowsSpace |
int | top_margin |
int | vert_align |
MultiLayer::MultiLayer | ( | const QString & | label, | |
QWidget * | parent = 0 , |
|||
const char * | name = 0 , |
|||
Qt::WFlags | f = 0 | |||
) |
void MultiLayer::activateGraph | ( | LayerButton * | button | ) | [slot] |
Graph* MultiLayer::activeGraph | ( | ) | [inline, slot] |
Graph * MultiLayer::addLayer | ( | int | x = 0 , |
|
int | y = 0 , |
|||
int | width = 0 , |
|||
int | height = 0 | |||
) | [slot] |
LayerButton * MultiLayer::addLayerButton | ( | ) |
void MultiLayer::adjustSize | ( | ) | [slot] |
void MultiLayer::arrangeLayers | ( | bool | fit, | |
bool | userSize | |||
) | [slot] |
QSize MultiLayer::arrangeLayers | ( | bool | userSize | ) | [slot] |
int MultiLayer::bottomMargin | ( | ) | [inline, slot] |
QPixmap MultiLayer::canvasPixmap | ( | ) | [slot] |
void MultiLayer::changeEvent | ( | QEvent * | event | ) | [virtual] |
int MultiLayer::colsSpacing | ( | ) | [inline, slot] |
void MultiLayer::confirmRemoveLayer | ( | ) | [slot] |
void MultiLayer::connectLayer | ( | Graph * | g | ) | [slot] |
void MultiLayer::contextMenuEvent | ( | QContextMenuEvent * | e | ) |
void MultiLayer::copy | ( | MultiLayer * | ml | ) |
void MultiLayer::copyAllLayers | ( | ) | [slot] |
void MultiLayer::createTable | ( | const QString & | , | |
int | , | |||
int | , | |||
const QString & | ||||
) | [signal] |
void MultiLayer::currentFontChanged | ( | const QFont & | ) | [signal] |
void MultiLayer::cursorInfo | ( | const QString & | ) | [signal] |
void MultiLayer::drawLineEnded | ( | bool | ) | [signal] |
void MultiLayer::drawTextOff | ( | ) | [signal] |
void MultiLayer::enableTextEditor | ( | Graph * | ) | [signal] |
bool MultiLayer::eventFilter | ( | QObject * | object, | |
QEvent * | e | |||
) |
void MultiLayer::exportImage | ( | const QString & | fileName, | |
int | quality = 100 , |
|||
bool | transparent = false | |||
) | [slot] |
void MultiLayer::exportPDF | ( | const QString & | fname | ) | [virtual, slot] |
Reimplemented from MyWidget.
void MultiLayer::exportSVG | ( | const QString & | fname | ) | [slot] |
void MultiLayer::exportToFile | ( | const QString & | fileName | ) | [slot] |
void MultiLayer::exportVector | ( | const QString & | fileName, | |
int | res = 0 , |
|||
bool | color = true , |
|||
bool | keepAspect = true , |
|||
QPrinter::PageSize | pageSize = QPrinter::Custom | |||
) | [slot] |
void MultiLayer::findBestLayout | ( | int & | rows, | |
int & | cols | |||
) | [slot] |
bool MultiLayer::focusNextPrevChild | ( | bool | next | ) |
int MultiLayer::getCols | ( | ) | [inline, slot] |
int MultiLayer::getRows | ( | ) | [inline, slot] |
QWidgetList MultiLayer::graphPtrs | ( | ) | [inline] |
int MultiLayer::horizontalAlignement | ( | ) | [inline, slot] |
bool MultiLayer::isEmpty | ( | ) | [slot] |
void MultiLayer::keyPressEvent | ( | QKeyEvent * | e | ) |
Graph * MultiLayer::layer | ( | int | num | ) |
QSize MultiLayer::layerCanvasSize | ( | ) | [inline, slot] |
int MultiLayer::layers | ( | ) | [inline, slot] |
int MultiLayer::leftMargin | ( | ) | [inline, slot] |
void MultiLayer::modifiedPlot | ( | ) | [signal] |
void MultiLayer::mousePressEvent | ( | QMouseEvent * | e | ) |
void MultiLayer::pasteMarker | ( | ) | [signal] |
void MultiLayer::print | ( | ) | [virtual, slot] |
Reimplemented from MyWidget.
void MultiLayer::printActiveLayer | ( | ) | [slot] |
void MultiLayer::printAllLayers | ( | QPainter * | painter | ) | [slot] |
void MultiLayer::printCropmarks | ( | bool | on | ) | [inline] |
bool MultiLayer::printCropmarksEnabled | ( | ) | [inline] |
void MultiLayer::releaseLayer | ( | ) |
void MultiLayer::removeLayer | ( | ) | [slot] |
void MultiLayer::resizeLayers | ( | const QSize & | size, | |
const QSize & | oldSize, | |||
bool | scaleFonts | |||
) | [private] |
void MultiLayer::resizeLayers | ( | const QResizeEvent * | re | ) | [private] |
int MultiLayer::rightMargin | ( | ) | [inline, slot] |
int MultiLayer::rowsSpacing | ( | ) | [inline, slot] |
QString MultiLayer::saveAsTemplate | ( | const QString & | geometryInfo | ) | [virtual, slot] |
Reimplemented from MyWidget.
QString MultiLayer::saveToString | ( | const QString & | geometry, | |
bool | saveAsTemplate = false | |||
) | [virtual, slot] |
Reimplemented from MyWidget.
bool MultiLayer::scaleLayersOnPrint | ( | ) | [inline] |
void MultiLayer::setActiveGraph | ( | Graph * | g | ) | [slot] |
void MultiLayer::setAlignement | ( | int | ha, | |
int | va | |||
) | [slot] |
void MultiLayer::setCols | ( | int | c | ) | [slot] |
void MultiLayer::setFonts | ( | const QFont & | titleFnt, | |
const QFont & | scaleFnt, | |||
const QFont & | numbersFnt, | |||
const QFont & | legendFnt | |||
) | [slot] |
void MultiLayer::setGraphGeometry | ( | int | x, | |
int | y, | |||
int | w, | |||
int | h | |||
) | [slot] |
void MultiLayer::setHidden | ( | ) | [virtual] |
void MultiLayer::setLayerCanvasSize | ( | int | w, | |
int | h | |||
) | [slot] |
void MultiLayer::setLayersNumber | ( | int | n | ) | [slot] |
void MultiLayer::setMargins | ( | int | lm, | |
int | rm, | |||
int | tm, | |||
int | bm | |||
) | [slot] |
void MultiLayer::setOpenMaximized | ( | ) | [inline] |
void MultiLayer::setPointerCursor | ( | ) | [signal] |
void MultiLayer::setRows | ( | int | r | ) | [slot] |
void MultiLayer::setScaleLayersOnPrint | ( | bool | on | ) | [inline] |
void MultiLayer::setSpacing | ( | int | rgap, | |
int | cgap | |||
) | [slot] |
void MultiLayer::showAxisDialog | ( | int | ) | [signal] |
void MultiLayer::showCurveContextMenu | ( | int | ) | [signal] |
void MultiLayer::showCurvesDialog | ( | ) | [signal] |
void MultiLayer::showGraphContextMenu | ( | ) | [signal] |
void MultiLayer::showImageDialog | ( | ) | [signal] |
void MultiLayer::showLineDialog | ( | ) | [signal] |
void MultiLayer::showMarkerPopupMenu | ( | ) | [signal] |
void MultiLayer::showPlotDialog | ( | int | ) | [signal] |
void MultiLayer::showRightAxisTitleDialog | ( | ) | [signal] |
void MultiLayer::showScaleDialog | ( | int | ) | [signal] |
void MultiLayer::showTextDialog | ( | ) | [signal] |
void MultiLayer::showTopAxisTitleDialog | ( | ) | [signal] |
void MultiLayer::showWindowContextMenu | ( | ) | [signal] |
void MultiLayer::showXAxisTitleDialog | ( | ) | [signal] |
void MultiLayer::showYAxisTitleDialog | ( | ) | [signal] |
bool MultiLayer::swapLayers | ( | int | src, | |
int | dest | |||
) | [slot] |
int MultiLayer::topMargin | ( | ) | [inline, slot] |
int MultiLayer::verticalAlignement | ( | ) | [inline, slot] |
void MultiLayer::viewTitleDialog | ( | ) | [signal] |
void MultiLayer::wheelEvent | ( | QWheelEvent * | e | ) |
Graph* MultiLayer::active_graph [private] |
int MultiLayer::bottom_margin [private] |
QWidgetList MultiLayer::buttonsList [private] |
QWidget* MultiLayer::canvas [private] |
int MultiLayer::cols [private] |
int MultiLayer::colsSpace [private] |
QPointer<SelectionMoveResizer> MultiLayer::d_layers_selector [private] |
QSize MultiLayer::d_max_size [private] |
Stores the size of the widget in the Qt::WindowMaximized state.
QSize MultiLayer::d_normal_size [private] |
Stores the size of the widget in Qt::WindowNoState (normal state).
int MultiLayer::d_open_maximized [private] |
bool MultiLayer::d_print_cropmarks [private] |
bool MultiLayer::d_scale_on_print [private] |
int MultiLayer::graph_height [private] |
int MultiLayer::graph_width [private] |
int MultiLayer::graphs [private] |
Used for resizing of layers.
QWidgetList MultiLayer::graphsList [private] |
int MultiLayer::hor_align [private] |
int MultiLayer::l_canvas_height [private] |
int MultiLayer::l_canvas_width [private] |
QHBoxLayout* MultiLayer::layerButtonsBox [private] |
int MultiLayer::left_margin [private] |
int MultiLayer::right_margin [private] |
int MultiLayer::rows [private] |
int MultiLayer::rowsSpace [private] |
int MultiLayer::top_margin [private] |
int MultiLayer::vert_align [private] |