10#include<QtCore/QtGlobal>
11#include <QtWidgets/QGraphicsView>
12#include <QtWidgets/QGraphicsScene>
13#include <QtWidgets/QGraphicsSceneResizeEvent>
14#include <QtWidgets/QGraphicsSceneWheelEvent>
23#include <GeneratedFiles/icmpstr/ui_CSceneProviderGuiComp.h>
77 I_ASSIGN(m_allowWidgetResizeAttrPtr,
"AllowWidgetResize",
"Allow resize of QWidet object (should be disabled if this GUI size is managed by layout)",
true,
false);
78 I_ASSIGN(m_sceneIdAttrPtr,
"SceneId",
"ID allowing identifying this scene",
true, 0);
79 I_ASSIGN(m_useAntialiasingAttrPtr,
"UseAntialiasing",
"Enables using of antialiasing",
false,
false);
80 I_ASSIGN(m_fitModeAttrPtr,
"FitMode",
"Set fit automatic mode for the scene\n 0 - no fit (default)\n 1 - isotropic (reduction)\n 2 - isotropic\n 3 - anisotropic",
false, 0);
81 I_ASSIGN(m_isotropyFactorAttrPtr,
"IsotropyFactor",
"Describe type of isotropic transformation: 0 - letterbox, 1 - full",
true, 0);
82 I_ASSIGN_MULTI_0(m_dropConsumersCompPtr,
"DropConsumers",
"List of consumers for the drop event",
false);
83 I_ASSIGN(m_backgroundModeAttrPtr,
"BackgroundMode",
"Mode of background drawing:\n 0 - normal window\n 1 - solid color\n 2 - grid\n 3 - checkerboard\n 4 - dot grid\n 5 - transparent",
true, 0);
84 I_ASSIGN(m_gridSizeAttrPtr,
"GridSize",
"Size of grid, it is used also for background",
true, 20);
85 I_ASSIGN(m_isAlignmentEnabledAttrPtr,
"IsAlignmentEnabled",
"If true, grid alignment will be enabled",
true,
false);
86 I_ASSIGN(m_sceneWidthAttrPtr,
"SceneWidth",
"Logical with of scene",
false, 1000);
87 I_ASSIGN(m_sceneHeightAttrPtr,
"SceneHeight",
"Logical height of scene",
false, 1000);
88 I_ASSIGN(m_allowSelectAllAttrPtr,
"AllowSelectAll",
"If true, command 'Select All' will be enabled",
true,
false);
126 void DrawGrid(QPainter& painter,
const QRectF& rect,
bool useDot =
false);
131 virtual void dropEvent(QGraphicsSceneDragDropEvent* eventPtr);
180 std::unique_ptr<QGraphicsScene> m_scenePtr;
184 bool m_isFullScreenMode;
185 bool m_isZoomIgnored;
202 I_ATTR(
bool, m_allowWidgetResizeAttrPtr);
203 I_ATTR(
int, m_sceneIdAttrPtr);
204 I_ATTR(
bool, m_useAntialiasingAttrPtr);
205 I_ATTR(
int, m_fitModeAttrPtr);
206 I_ATTR(
double, m_isotropyFactorAttrPtr);
207 I_ATTR(
int, m_backgroundModeAttrPtr);
208 I_ATTR(
double, m_gridSizeAttrPtr);
209 I_ATTR(
bool, m_isAlignmentEnabledAttrPtr);
210 I_ATTR(
double, m_sceneWidthAttrPtr);
211 I_ATTR(
double, m_sceneHeightAttrPtr);
212 I_ATTR(
bool, m_allowSelectAllAttrPtr);
214 QWidget* m_savedParentWidgetPtr;
215 QTransform m_savedViewTransform;
217 double m_isotropyFactor;
Interface for scene manipulation and query the restrictions.
@ SM_SET
Simple set, old scale will be replaced with the new value.
FittingMode
Vieport scale fitting mode.
Interface for a provider of the heriarchical commands.
Implementation of QGraphicsScene with own background drawing to provide rastered backgrounds.
void DrawGrid(QPainter &painter, const QRectF &rect, bool useDot=false)
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *eventPtr)
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *eventPtr)
CScene(CSceneProviderGuiComp *parentPtr)
virtual void drawBackground(QPainter *painter, const QRectF &rect)
virtual void dropEvent(QGraphicsSceneDragDropEvent *eventPtr)
bool GetSceneAlignment(double &distance) const override
Get parameters of grid alignment.
virtual bool OnMouseDoubleClickEvent(QEvent *eventPtr)
void SetFittedScale(FittingMode mode)
void DelegateDropEvent(const QMimeData &data, QGraphicsSceneDragDropEvent *eventPtr)
int GetSceneFlags() const override
Get scene's paremeter info.
int GetSceneId() const override
Get ID indentifing this scene.
istdgui::CHierarchicalCommand & GetCommandsRootRef()
bool eventFilter(QObject *sourcePtr, QEvent *eventPtr) override
void OnComponentDestroyed() override
bool IsFullScreenMode() const override
Check if full screen mode is enabled.
virtual bool OnKeyReleaseEvent(QKeyEvent *eventPtr)
bool SetFullScreenMode(bool isFullScreen) override
Set full screen mode on/off.
FittingMode GetFitMode() const override
Get vieport scale fitting mode.
@ BM_GRID
Grid of horizontal and vertical lines.
@ BM_CHECKERBOARD
Checkerboard pattern.
@ BM_SOLID
Filled with solid color.
@ BM_TRANSPARENT
Transparent background.
@ BM_NORMAL
Standard window backround.
virtual bool OnResize(QResizeEvent *eventPtr)
void OnGuiCreated() override
Called just after GUI is initialized.
int GetSceneRestrictionFlags() const override
Get the restriction flags, to tell the scene manipulator, what can be changed on the scene.
bool SetFitMode(FittingMode fitMode) override
Set vieport scale fitting mode.
void embeddedRegistrySelected(const QByteArray &)
bool HasDropConsumerForFormat(const QStringList &formats) const
virtual bool OnWheelEvent(QGraphicsSceneWheelEvent *eventPtr)
void ScaleView(double scaleFactor)
const ibase::IHierarchicalCommand * GetCommands() const override
Get list of menu commands.
void OnRetranslate() override
Called when non-GUI elements (like commands) should be retranslated.
void SetIsotropyFactor(double factor)
double GetScale() const override
Get actual scale factor.
istdgui::TDesignerGuiCompBase< Ui::CSceneProviderGuiComp > BaseClass
void OnAutoFit(bool isAutoScale)
double GetIsotropyFactor() const
void OnComponentCreated() override
QGraphicsScene * GetScene() const override
Called when items should be removed from specified scene.
bool SetScale(int scaleMode=SM_SET, double value=1.0) override
Set or modify scale factor.
Interface for GUI objects managing scene.
Common interface to define the hierarchical graph structures.
Implementation of hierarchical command based on QAction from Qt.
Interface for objects which can receive dragged objects.
Base class for all Qt GUI components, which use the Qt designer's UI.
This package contains (Qt based) implementations of compositor components.