|
Schim
|
A specialized QGraphicsScene containing a sheet of paper.
More...
#include <sheetscene.h>
Public Member Functions | |
| SheetScene (Sheet *sheet) | |
| Construct a scene based on the specified sheet. More... | |
| QPointF | getRawCursorPos () const |
| Return the raw cursor position, before applying snap. | |
| QPointF | getCursorPos () const |
| Return the processed cursor pos. More... | |
| QPointF | snap (const QPointF &pt) const |
Return the point on the grid that is closest to pt. More... | |
| QPointF | forcedSnap (const QPointF &pt) const |
Return the point on the grid that is closest to pt. More... | |
| void | setHeader (Header *hdr, bool destroy=true) |
| Set the header in the scene and in the model. More... | |
| void | startOperation (SceneOperation *op) |
| Start a scene operation. More... | |
| void | tryChangeHeader (Header *hdr, bool *changed=nullptr, bool *confirmed=nullptr) |
Try to set the sheet header to hdr and update the scene. More... | |
Friends | |
| class | SheetView |
| class | GObject |
A specialized QGraphicsScene containing a sheet of paper.
|
explicit |
Construct a scene based on the specified sheet.
| std::logic_error | If sheet is null. |
sheet. | QPointF SheetScene::forcedSnap | ( | const QPointF & | pt | ) | const |
Return the point on the grid that is closest to pt.
Both the argument and return value are in scene coordinates.
snap, this method returns the snapped position regardless of the enabled state of the snap feature. | QPointF SheetScene::getCursorPos | ( | ) | const |
Return the processed cursor pos.
If snap is disabled the raw cursor position is returned. If snap is enabled, the snapped cursor position is returned.
| void SheetScene::setHeader | ( | Header * | hdr, |
| bool | destroy = true |
||
| ) |
Set the header in the scene and in the model.
| hdr | The new header. |
| destroy | Whether to destroy the old header in the model. |
| QPointF SheetScene::snap | ( | const QPointF & | pt | ) | const |
Return the point on the grid that is closest to pt.
Both the argument and return value are in scene coordinates.
| void SheetScene::startOperation | ( | SceneOperation * | op | ) |
Start a scene operation.
The scene takes ownership of op, which must be dynamically allocated. Any active operations will be canceled.
| void SheetScene::tryChangeHeader | ( | Header * | hdr, |
| bool * | changed = nullptr, |
||
| bool * | confirmed = nullptr |
||
| ) |
Try to set the sheet header to hdr and update the scene.
| hdr | The new header. |
| changed | [Out] Whether the header has been changed. |
| confirmed | [Out] Whether the user confirmed the change. |
confirmed is true by default.
1.8.13