QElectroTech  0.70
Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
TitleBlockTemplateView Class Reference

#include <templateview.h>

Public Slots

void setTitleBlockTemplate (TitleBlockTemplate *)
 
void selectionChanged ()
 
void zoomIn ()
 
void zoomOut ()
 
void zoomFit ()
 
void zoomReset ()
 
QList< TitleBlockCell * > cut ()
 
QList< TitleBlockCell * > copy ()
 
bool mayPaste ()
 
QList< TitleBlockCellpastedCells ()
 
void paste ()
 
void addColumnAtEnd ()
 
void addRowAtEnd ()
 
void addColumnBefore ()
 
void addRowBefore ()
 
void addColumnAfter ()
 
void addRowAfter ()
 
void editColumn (HelperCell *=nullptr)
 
void editRow (HelperCell *=nullptr)
 
void deleteColumn ()
 
void deleteRow ()
 
void mergeSelectedCells ()
 
void splitSelectedCell ()
 
void refresh ()
 
void changePreviewWidth ()
 
void setPreviewWidth (int)
 
void updateLayout ()
 
void rowsDimensionsChanged ()
 
void columnsDimensionsChanged ()
 
void updateDisplayedMinMaxWidth ()
 
void setReadOnly (bool)
 

Signals

void selectedCellsChanged (QList< TitleBlockCell *>)
 
void gridModificationRequested (TitleBlockTemplateCommand *)
 
void previewWidthChanged (int, int)
 

Public Member Functions

 TitleBlockTemplateView (QWidget *=nullptr)
 
 TitleBlockTemplateView (QGraphicsScene *, QWidget *=nullptr)
 
 ~TitleBlockTemplateView () override
 
TitleBlockTemplatetitleBlockTemplate () const
 
virtual QList< TitleBlockCell * > selectedCells () const
 
virtual TitleBlockTemplateCellsSet selectedCellsSet () const
 
virtual TitleBlockTemplateCellsSet cells (const QRectF &) const
 
virtual void analyzeSelectedCells (bool *, bool *, int *)
 
virtual QSizeF templateSize () const
 
virtual qreal templateWidth () const
 
virtual qreal templateHeight () const
 

Protected Slots

virtual void applyColumnsWidths (bool=true)
 
virtual void applyRowsHeights (bool=true)
 
virtual void updateRowsHelperCells ()
 
virtual void updateColumnsHelperCells ()
 

Protected Member Functions

void drawBackground (QPainter *, const QRectF &) override
 
virtual void addCells ()
 
virtual void loadTemplate (TitleBlockTemplate *)
 
virtual void init ()
 
void wheelEvent (QWheelEvent *) override
 
virtual qreal zoomFactor () const
 
virtual void fillWithEmptyCells ()
 
bool event (QEvent *) override
 
virtual void normalizeCells (QList< TitleBlockCell > &, int x=0, int y=0) const
 

Private Slots

void updateLastContextMenuCell (HelperCell *)
 
void adjustSceneRect ()
 

Private Member Functions

 TitleBlockTemplateView (const TitleBlockTemplateView &)
 
QList< QAction * > rowsActions () const
 
QList< QAction * > columnsActions () const
 
void updateTotalWidthLabel ()
 
void requestGridModification (TitleBlockTemplateCommand *)
 
int lastContextMenuCellIndex () const
 
int indexOf (QGraphicsLayoutItem *)
 
void removeItem (QGraphicsLayoutItem *)
 
TitleBlockTemplateCellsSet makeCellsSetFromGraphicsItems (const QList< QGraphicsItem *> &) const
 
QString makePrettyToolTip (const QString &)
 

Private Attributes

TitleBlockTemplatetbtemplate_
 
QGraphicsGridLayout * tbgrid_
 
QGraphicsWidget * form_
 
int preview_width_
 
SplittedHelperCelltotal_width_helper_cell_
 
HelperCellextra_cells_width_helper_cell_
 
QAction * add_column_before_
 
QAction * add_row_before_
 
QAction * add_column_after_
 
QAction * add_row_after_
 
QAction * edit_column_dim_
 
QAction * edit_row_dim_
 
QAction * delete_column_
 
QAction * delete_row_
 
QAction * change_preview_width_
 
HelperCelllast_context_menu_cell_
 
int apply_columns_widths_count_
 
int apply_rows_heights_count_
 
bool first_activation_
 Boolean used to detect the first display of this widget. More...
 
bool read_only_
 Boolean stating whether this view allows template edition. More...
 

Detailed Description

This QGraphicsView subclass is used in the title block template editor to offer a graphical preview of the template being edited, but also to handle cell selection and various actions.

Definition at line 32 of file templateview.h.

Constructor & Destructor Documentation

◆ TitleBlockTemplateView() [1/3]

TitleBlockTemplateView::TitleBlockTemplateView ( QWidget *  parent = nullptr)

Constructor

Parameters
parentParent QWidget.

Definition at line 40 of file templateview.cpp.

References init().

◆ TitleBlockTemplateView() [2/3]

TitleBlockTemplateView::TitleBlockTemplateView ( QGraphicsScene *  scene,
QWidget *  parent = nullptr 
)

Constructor

Parameters
parentParent QWidget.

Definition at line 58 of file templateview.cpp.

References init().

◆ ~TitleBlockTemplateView()

TitleBlockTemplateView::~TitleBlockTemplateView ( )
override

Destructor

Definition at line 74 of file templateview.cpp.

◆ TitleBlockTemplateView() [3/3]

TitleBlockTemplateView::TitleBlockTemplateView ( const TitleBlockTemplateView )
private

Member Function Documentation

◆ addCells()

void TitleBlockTemplateView::addCells ( )
protectedvirtual

◆ addColumnAfter

void TitleBlockTemplateView::addColumnAfter ( )
slot

Add a column right after the last index selected when calling the context menu.

Definition at line 302 of file templateview.cpp.

References ModifyTemplateGridCommand::addColumn(), lastContextMenuCellIndex(), read_only_, requestGridModification(), and tbtemplate_.

Referenced by init().

◆ addColumnAtEnd

void TitleBlockTemplateView::addColumnAtEnd ( )
slot

Add a column right after the last one.

Definition at line 263 of file templateview.cpp.

References ModifyTemplateGridCommand::addColumn(), read_only_, requestGridModification(), and tbtemplate_.

◆ addColumnBefore

void TitleBlockTemplateView::addColumnBefore ( )
slot

Add a column right before the last index selected when calling the context menu.

Definition at line 280 of file templateview.cpp.

References ModifyTemplateGridCommand::addColumn(), lastContextMenuCellIndex(), read_only_, requestGridModification(), and tbtemplate_.

Referenced by init().

◆ addRowAfter

void TitleBlockTemplateView::addRowAfter ( )
slot

Add a row right after the last index selected when calling the context menu.

Definition at line 313 of file templateview.cpp.

References ModifyTemplateGridCommand::addRow(), lastContextMenuCellIndex(), read_only_, requestGridModification(), and tbtemplate_.

Referenced by init().

◆ addRowAtEnd

void TitleBlockTemplateView::addRowAtEnd ( )
slot

Add a row right after the last one.

Definition at line 271 of file templateview.cpp.

References ModifyTemplateGridCommand::addRow(), read_only_, requestGridModification(), and tbtemplate_.

◆ addRowBefore

void TitleBlockTemplateView::addRowBefore ( )
slot

Add a row right before the last index selected when calling the context menu.

Definition at line 291 of file templateview.cpp.

References ModifyTemplateGridCommand::addRow(), lastContextMenuCellIndex(), read_only_, requestGridModification(), and tbtemplate_.

Referenced by init().

◆ adjustSceneRect

void TitleBlockTemplateView::adjustSceneRect ( )
privateslot

Adjusts the bounding rect of the scene.

Definition at line 1094 of file templateview.cpp.

References templateSize().

Referenced by loadTemplate(), zoomFit(), and zoomReset().

◆ analyzeSelectedCells()

void TitleBlockTemplateView::analyzeSelectedCells ( bool *  can_merge,
bool *  can_split,
int *  count 
)
virtual
Parameters
can_mergeIf non-zero, will be changed to reflect whether selected cells may be merged
can_mergeIf non-zero, will be changed to reflect whether selected cells may be splitted
countIf non-zero, will be changed to reflect the number of selected cells

Definition at line 451 of file templateview.cpp.

References MergeCellsCommand::canMerge(), SplitCellsCommand::canSplit(), selectedCellsSet(), and tbtemplate_.

◆ applyColumnsWidths

void TitleBlockTemplateView::applyColumnsWidths ( bool  animate = true)
protectedvirtualslot

Apply the columns widths currently specified by the edited title block template.

Parameters
animatetrue to animate the change, false otherwise.

Definition at line 566 of file templateview.cpp.

References apply_columns_widths_count_, COL_OFFSET, DEFAULT_ROWS_HELPER_CELLS_WIDTH, extra_cells_width_helper_cell_, form_, preview_width_, removeItem(), ROW_OFFSET, tbgrid_, tbtemplate_, total_width_helper_cell_, QET::Icons::tr, updateColumnsHelperCells(), and updateDisplayedMinMaxWidth().

Referenced by columnsDimensionsChanged(), loadTemplate(), and setPreviewWidth().

◆ applyRowsHeights

void TitleBlockTemplateView::applyRowsHeights ( bool  animate = true)
protectedvirtualslot

Apply the rows heights currently specified by the edited title block template.

Parameters
animatetrue to animate the change, false otherwise.

Definition at line 631 of file templateview.cpp.

References apply_rows_heights_count_, DEFAULT_COLS_HELPER_CELLS_HEIGHT, DEFAULT_PREVIEW_HELPER_CELL_HEIGHT, form_, ROW_OFFSET, tbgrid_, tbtemplate_, and updateRowsHelperCells().

Referenced by loadTemplate(), and rowsDimensionsChanged().

◆ cells()

TitleBlockTemplateCellsSet TitleBlockTemplateView::cells ( const QRectF &  rect) const
virtual
Returns
the visual cells contained in the rect
Parameters
rectRectangle in the coordinates of the QGraphicsWidget representing the title block template.

Definition at line 440 of file templateview.cpp.

References form_, and makeCellsSetFromGraphicsItems().

Referenced by normalizeCells(), and selectedCells().

◆ changePreviewWidth

void TitleBlockTemplateView::changePreviewWidth ( )
slot

◆ columnsActions()

QList< QAction * > TitleBlockTemplateView::columnsActions ( ) const
private
Returns
the list of columns-specific actions.

Definition at line 891 of file templateview.cpp.

References add_column_after_, add_column_before_, delete_column_, and edit_column_dim_.

Referenced by addCells().

◆ columnsDimensionsChanged

void TitleBlockTemplateView::columnsDimensionsChanged ( )
slot

Update the displayed layout. Call this function when the dimensions of columns changed.

Definition at line 917 of file templateview.cpp.

References applyColumnsWidths().

◆ copy

QList< TitleBlockCell * > TitleBlockTemplateView::copy ( )
slot

Export currently selected cells to the clipboard.

Returns
the list of cells copied to the clipboard

Definition at line 154 of file templateview.cpp.

References selectedCells(), and tbtemplate_.

Referenced by cut().

◆ cut

QList< TitleBlockCell * > TitleBlockTemplateView::cut ( )
slot

Export currently selected cells to the clipboard before setting them as empty.

Returns
the list of cells copied to the clipboard

Definition at line 138 of file templateview.cpp.

References copy(), requestGridModification(), and tbtemplate_.

◆ deleteColumn

void TitleBlockTemplateView::deleteColumn ( )
slot

Remove the column at the last index selected when calling the context menu.

Definition at line 375 of file templateview.cpp.

References ModifyTemplateGridCommand::deleteColumn(), lastContextMenuCellIndex(), requestGridModification(), and tbtemplate_.

Referenced by init().

◆ deleteRow

void TitleBlockTemplateView::deleteRow ( )
slot

Remove the row at the last index selected when calling the context menu.

Definition at line 384 of file templateview.cpp.

References ModifyTemplateGridCommand::deleteRow(), lastContextMenuCellIndex(), requestGridModification(), and tbtemplate_.

Referenced by init().

◆ drawBackground()

void TitleBlockTemplateView::drawBackground ( QPainter *  painter,
const QRectF &  rect 
)
overrideprotected

Reimplement the way the background is drawn to render the title block template.

Definition at line 416 of file templateview.cpp.

References tbtemplate_.

◆ editColumn

void TitleBlockTemplateView::editColumn ( HelperCell cell = nullptr)
slot

Edit the width of a column.

Parameters
cell(optional) HelperCell of the column to be modified. If 0, this method uses the last index selected when calling the context menu.

Definition at line 325 of file templateview.cpp.

References TitleBlockDimensionWidget::label(), lastContextMenuCellIndex(), read_only_, requestGridModification(), TitleBlockDimensionWidget::setReadOnly(), TitleBlockDimensionWidget::setValue(), tbtemplate_, QET::Icons::tr, and TitleBlockDimensionWidget::value().

Referenced by addCells(), and init().

◆ editRow

void TitleBlockTemplateView::editRow ( HelperCell cell = nullptr)
slot

Edit the height of a row.

Parameters
cell(optional) HelperCell of the row to be modified. If 0, this method uses the last index selected when calling the context menu.

Definition at line 351 of file templateview.cpp.

References TitleBlockDimensionWidget::label(), lastContextMenuCellIndex(), read_only_, requestGridModification(), TitleBlockDimensionWidget::setReadOnly(), TitleBlockDimensionWidget::setValue(), tbtemplate_, QET::Icons::tr, and TitleBlockDimensionWidget::value().

Referenced by addCells(), and init().

◆ event()

bool TitleBlockTemplateView::event ( QEvent *  event)
overrideprotected
Parameters
eventObject describing the received event

Definition at line 816 of file templateview.cpp.

References first_activation_, and zoomFit().

◆ fillWithEmptyCells()

void TitleBlockTemplateView::fillWithEmptyCells ( )
protectedvirtual

Fill the layout with empty cells where needed.

Definition at line 795 of file templateview.cpp.

References COL_OFFSET, ROW_OFFSET, tbgrid_, and tbtemplate_.

Referenced by loadTemplate().

◆ gridModificationRequested

void TitleBlockTemplateView::gridModificationRequested ( TitleBlockTemplateCommand )
signal

Referenced by requestGridModification().

◆ indexOf()

int TitleBlockTemplateView::indexOf ( QGraphicsLayoutItem *  item)
private
Parameters
iteman item supposed to be contained in the grid layout.
Returns
the flat index if this item, or -1 if it could not be found.

Definition at line 1029 of file templateview.cpp.

References tbgrid_.

Referenced by removeItem().

◆ init()

void TitleBlockTemplateView::init ( )
protectedvirtual

◆ lastContextMenuCellIndex()

int TitleBlockTemplateView::lastContextMenuCellIndex ( ) const
private
Returns
the last index selected when triggering the context menu.
See also
updateLastContextMenuCell

Definition at line 1018 of file templateview.cpp.

References last_context_menu_cell_.

Referenced by addColumnAfter(), addColumnBefore(), addRowAfter(), addRowBefore(), deleteColumn(), deleteRow(), editColumn(), and editRow().

◆ loadTemplate()

void TitleBlockTemplateView::loadTemplate ( TitleBlockTemplate tbt)
protectedvirtual

Load the tbt title block template. If a different template was previously loaded, it is deleted.

Definition at line 848 of file templateview.cpp.

References addCells(), adjustSceneRect(), applyColumnsWidths(), applyRowsHeights(), fillWithEmptyCells(), form_, removeItem(), tbgrid_, and tbtemplate_.

Referenced by setTitleBlockTemplate(), and updateLayout().

◆ makeCellsSetFromGraphicsItems()

TitleBlockTemplateCellsSet TitleBlockTemplateView::makeCellsSetFromGraphicsItems ( const QList< QGraphicsItem *> &  items) const
private
Parameters
alist of QGraphicsItem
Returns
the corresponding TitleBlockTemplateCellsSet

Definition at line 1057 of file templateview.cpp.

Referenced by cells(), and selectedCellsSet().

◆ makePrettyToolTip()

QString TitleBlockTemplateView::makePrettyToolTip ( const QString &  string)
private

Definition at line 1073 of file templateview.cpp.

Referenced by updateDisplayedMinMaxWidth().

◆ mayPaste

bool TitleBlockTemplateView::mayPaste ( )
slot
Returns
true if the content of the clipboard looks interesting

Definition at line 178 of file templateview.cpp.

◆ mergeSelectedCells

void TitleBlockTemplateView::mergeSelectedCells ( )
slot

Merge the selected cells.

Definition at line 393 of file templateview.cpp.

References requestGridModification(), selectedCellsSet(), and tbtemplate_.

◆ normalizeCells()

void TitleBlockTemplateView::normalizeCells ( QList< TitleBlockCell > &  cells,
int  x = 0,
int  y = 0 
) const
protectedvirtual

Given a cells list, change their position so the top left one is at row x and column y.

Parameters
cellsCells list

Definition at line 828 of file templateview.cpp.

References cells().

Referenced by paste().

◆ paste

void TitleBlockTemplateView::paste ( )
slot

◆ pastedCells

QList< TitleBlockCell > TitleBlockTemplateView::pastedCells ( )
slot

◆ previewWidthChanged

void TitleBlockTemplateView::previewWidthChanged ( int  ,
int   
)
signal

Referenced by setPreviewWidth().

◆ refresh

void TitleBlockTemplateView::refresh ( )
slot

Refresh the regular cells.

Definition at line 763 of file templateview.cpp.

References COL_OFFSET, ROW_OFFSET, tbgrid_, and tbtemplate_.

◆ removeItem()

void TitleBlockTemplateView::removeItem ( QGraphicsLayoutItem *  item)
private

Removes an item from the grid layout

Parameters
iteman item supposed to be contained in the grid layout.

Definition at line 1040 of file templateview.cpp.

References indexOf(), and tbgrid_.

Referenced by applyColumnsWidths(), and loadTemplate().

◆ requestGridModification()

void TitleBlockTemplateView::requestGridModification ( TitleBlockTemplateCommand command)
private

Emit the gridModificationRequested() signal with command after having set its view component.

See also
TitleBlockTemplateCommand::setView()
Parameters
commandA command object modifying the rendered title block template.

Definition at line 1008 of file templateview.cpp.

References gridModificationRequested().

Referenced by addColumnAfter(), addColumnAtEnd(), addColumnBefore(), addRowAfter(), addRowAtEnd(), addRowBefore(), cut(), deleteColumn(), deleteRow(), editColumn(), editRow(), mergeSelectedCells(), paste(), and splitSelectedCell().

◆ rowsActions()

QList< QAction * > TitleBlockTemplateView::rowsActions ( ) const
private
Returns
the list of rows-specific actions.

Definition at line 884 of file templateview.cpp.

References add_row_after_, add_row_before_, delete_row_, and edit_row_dim_.

Referenced by addCells().

◆ rowsDimensionsChanged

void TitleBlockTemplateView::rowsDimensionsChanged ( )
slot

Update the displayed layout. Call this function when the dimensions of rows changed.

Definition at line 909 of file templateview.cpp.

References applyRowsHeights().

◆ selectedCells()

QList< TitleBlockCell * > TitleBlockTemplateView::selectedCells ( ) const
virtual
Returns
the selected logical cells, not including the spanned ones.

Definition at line 424 of file templateview.cpp.

References cells(), and selectedCellsSet().

Referenced by copy(), and selectionChanged().

◆ selectedCellsChanged

void TitleBlockTemplateView::selectedCellsChanged ( QList< TitleBlockCell *>  )
signal

Referenced by selectionChanged().

◆ selectedCellsSet()

TitleBlockTemplateCellsSet TitleBlockTemplateView::selectedCellsSet ( ) const
virtual
Returns
the selected visual cells.

Definition at line 431 of file templateview.cpp.

References makeCellsSetFromGraphicsItems().

Referenced by analyzeSelectedCells(), mergeSelectedCells(), paste(), selectedCells(), and splitSelectedCell().

◆ selectionChanged

void TitleBlockTemplateView::selectionChanged ( )
slot

Emits the selectedCellsChanged() signal with the currently selected cells.

Definition at line 96 of file templateview.cpp.

References selectedCells(), and selectedCellsChanged().

Referenced by init().

◆ setPreviewWidth

void TitleBlockTemplateView::setPreviewWidth ( int  width)
slot

Set the new preview width to width

Parameters
widthnew preview width

Definition at line 976 of file templateview.cpp.

References applyColumnsWidths(), form_, preview_width_, previewWidthChanged(), tbgrid_, and updateTotalWidthLabel().

Referenced by changePreviewWidth().

◆ setReadOnly

void TitleBlockTemplateView::setReadOnly ( bool  read_only)
slot
Parameters
read_onlywhether this view should be read only.

Definition at line 960 of file templateview.cpp.

References add_column_after_, add_column_before_, add_row_after_, add_row_before_, delete_column_, delete_row_, and read_only_.

◆ setTitleBlockTemplate

void TitleBlockTemplateView::setTitleBlockTemplate ( TitleBlockTemplate tbtemplate)
slot
Parameters
tbtemplateTitle block template to be rendered by this view. If set to zero, the View will render nothing.

Definition at line 81 of file templateview.cpp.

References loadTemplate(), and zoomFit().

◆ splitSelectedCell

void TitleBlockTemplateView::splitSelectedCell ( )
slot

Split the selected cell.

Definition at line 404 of file templateview.cpp.

References requestGridModification(), selectedCellsSet(), and tbtemplate_.

◆ templateHeight()

qreal TitleBlockTemplateView::templateHeight ( ) const
virtual
Returns
the current height of the rendered title block template

Definition at line 497 of file templateview.cpp.

References DEFAULT_COLS_HELPER_CELLS_HEIGHT, DEFAULT_PREVIEW_HELPER_CELL_HEIGHT, and tbtemplate_.

Referenced by templateSize().

◆ templateSize()

QSizeF TitleBlockTemplateView::templateSize ( ) const
virtual
Returns
the current size of the rendered title block template

Definition at line 477 of file templateview.cpp.

References templateHeight(), and templateWidth().

Referenced by adjustSceneRect().

◆ templateWidth()

qreal TitleBlockTemplateView::templateWidth ( ) const
virtual
Returns
the current width of the rendered title block template

Definition at line 484 of file templateview.cpp.

References DEFAULT_ROWS_HELPER_CELLS_WIDTH, preview_width_, and tbtemplate_.

Referenced by templateSize().

◆ titleBlockTemplate()

TitleBlockTemplate * TitleBlockTemplateView::titleBlockTemplate ( ) const
Returns
The title block template object rendered by this view.

Definition at line 89 of file templateview.cpp.

References tbtemplate_.

◆ updateColumnsHelperCells

void TitleBlockTemplateView::updateColumnsHelperCells ( )
protectedvirtualslot

Update the content (type and value) of columns helper cells.

Definition at line 679 of file templateview.cpp.

References COL_OFFSET, tbgrid_, tbtemplate_, TitleBlockDimension::toString(), and TitleBlockDimension::type.

Referenced by applyColumnsWidths().

◆ updateDisplayedMinMaxWidth

void TitleBlockTemplateView::updateDisplayedMinMaxWidth ( )
slot

Update the tooltip that displays the minimum and/or maximum width of the template.

Definition at line 925 of file templateview.cpp.

References makePrettyToolTip(), tbtemplate_, total_width_helper_cell_, and QET::Icons::tr.

Referenced by applyColumnsWidths().

◆ updateLastContextMenuCell

void TitleBlockTemplateView::updateLastContextMenuCell ( HelperCell last_context_menu_cell)
privateslot

Stores last_context_menu_cell as being the last helper cell the context menu was triggered on.

Definition at line 1087 of file templateview.cpp.

References last_context_menu_cell_.

Referenced by addCells().

◆ updateLayout

void TitleBlockTemplateView::updateLayout ( )
slot

Update the displayed layout. Call this function to refresh the display after the rendered title block template has been "deeply" modified, e.g. rows/columns have been added/modified or cells were merged/splitted.

Definition at line 900 of file templateview.cpp.

References loadTemplate(), and tbtemplate_.

◆ updateRowsHelperCells

void TitleBlockTemplateView::updateRowsHelperCells ( )
protectedvirtualslot

Update the content (type and value) of rows helper cells.

Definition at line 664 of file templateview.cpp.

References QET::Absolute, ROW_OFFSET, tbgrid_, tbtemplate_, and QET::Icons::tr.

Referenced by applyRowsHeights().

◆ updateTotalWidthLabel()

void TitleBlockTemplateView::updateTotalWidthLabel ( )
private

Update the label of the helper cell that indicates the preview width.

Definition at line 992 of file templateview.cpp.

References preview_width_, total_width_helper_cell_, and QET::Icons::tr.

Referenced by addCells(), and setPreviewWidth().

◆ wheelEvent()

void TitleBlockTemplateView::wheelEvent ( QWheelEvent *  e)
overrideprotected

Handles mouse wheel-related actions

Parameters
eQWheelEvent describing the wheel event

Definition at line 511 of file templateview.cpp.

References zoomIn(), and zoomOut().

◆ zoomFactor()

qreal TitleBlockTemplateView::zoomFactor ( ) const
protectedvirtual
Returns
the zoom factor used by zoomIn() and zoomOut().

Definition at line 527 of file templateview.cpp.

Referenced by zoomIn(), and zoomOut().

◆ zoomFit

void TitleBlockTemplateView::zoomFit ( )
slot

Fit the rendered title block template in this view.

Definition at line 120 of file templateview.cpp.

References adjustSceneRect().

Referenced by event(), and setTitleBlockTemplate().

◆ zoomIn

void TitleBlockTemplateView::zoomIn ( )
slot

Zoom in by zoomFactor().

See also
zoomFactor()

Definition at line 104 of file templateview.cpp.

References zoomFactor().

Referenced by wheelEvent().

◆ zoomOut

void TitleBlockTemplateView::zoomOut ( )
slot

Zoom out by zoomFactor().

See also
zoomFactor()

Definition at line 112 of file templateview.cpp.

References zoomFactor().

Referenced by wheelEvent().

◆ zoomReset

void TitleBlockTemplateView::zoomReset ( )
slot

Reset the zoom level.

Definition at line 128 of file templateview.cpp.

References adjustSceneRect().

Member Data Documentation

◆ add_column_after_

QAction* TitleBlockTemplateView::add_column_after_
private

Definition at line 133 of file templateview.h.

Referenced by columnsActions(), init(), and setReadOnly().

◆ add_column_before_

QAction* TitleBlockTemplateView::add_column_before_
private

Definition at line 132 of file templateview.h.

Referenced by columnsActions(), init(), and setReadOnly().

◆ add_row_after_

QAction * TitleBlockTemplateView::add_row_after_
private

Definition at line 133 of file templateview.h.

Referenced by init(), rowsActions(), and setReadOnly().

◆ add_row_before_

QAction * TitleBlockTemplateView::add_row_before_
private

Definition at line 132 of file templateview.h.

Referenced by init(), rowsActions(), and setReadOnly().

◆ apply_columns_widths_count_

int TitleBlockTemplateView::apply_columns_widths_count_
private

Definition at line 138 of file templateview.h.

Referenced by applyColumnsWidths().

◆ apply_rows_heights_count_

int TitleBlockTemplateView::apply_rows_heights_count_
private

Definition at line 139 of file templateview.h.

Referenced by applyRowsHeights().

◆ change_preview_width_

QAction* TitleBlockTemplateView::change_preview_width_
private

Definition at line 136 of file templateview.h.

Referenced by addCells(), and init().

◆ delete_column_

QAction* TitleBlockTemplateView::delete_column_
private

Definition at line 135 of file templateview.h.

Referenced by columnsActions(), init(), and setReadOnly().

◆ delete_row_

QAction * TitleBlockTemplateView::delete_row_
private

Definition at line 135 of file templateview.h.

Referenced by init(), rowsActions(), and setReadOnly().

◆ edit_column_dim_

QAction* TitleBlockTemplateView::edit_column_dim_
private

Definition at line 134 of file templateview.h.

Referenced by columnsActions(), and init().

◆ edit_row_dim_

QAction * TitleBlockTemplateView::edit_row_dim_
private

Definition at line 134 of file templateview.h.

Referenced by init(), and rowsActions().

◆ extra_cells_width_helper_cell_

HelperCell* TitleBlockTemplateView::extra_cells_width_helper_cell_
private

Definition at line 131 of file templateview.h.

Referenced by addCells(), and applyColumnsWidths().

◆ first_activation_

bool TitleBlockTemplateView::first_activation_
private

Boolean used to detect the first display of this widget.

Definition at line 140 of file templateview.h.

Referenced by event().

◆ form_

QGraphicsWidget* TitleBlockTemplateView::form_
private

◆ last_context_menu_cell_

HelperCell* TitleBlockTemplateView::last_context_menu_cell_
private

Definition at line 137 of file templateview.h.

Referenced by lastContextMenuCellIndex(), and updateLastContextMenuCell().

◆ preview_width_

int TitleBlockTemplateView::preview_width_
private

◆ read_only_

bool TitleBlockTemplateView::read_only_
private

Boolean stating whether this view allows template edition.

Definition at line 141 of file templateview.h.

Referenced by addColumnAfter(), addColumnAtEnd(), addColumnBefore(), addRowAfter(), addRowAtEnd(), addRowBefore(), editColumn(), editRow(), and setReadOnly().

◆ tbgrid_

QGraphicsGridLayout* TitleBlockTemplateView::tbgrid_
private

◆ tbtemplate_

TitleBlockTemplate* TitleBlockTemplateView::tbtemplate_
private

◆ total_width_helper_cell_

SplittedHelperCell* TitleBlockTemplateView::total_width_helper_cell_
private

The documentation for this class was generated from the following files: