SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
smtk::extension::qtTaskNode Class Reference

A implementation of a qtBaseTaskNode. More...

#include <qtTaskNode.h>

Inheritance diagram for smtk::extension::qtTaskNode:
[legend]
Collaboration diagram for smtk::extension::qtTaskNode:
[legend]

Public Member Functions

 smtkSuperclassMacro (qtBaseTaskNode)
 
 smtkTypeMacro (smtk::extension::qtTaskNode)
 
 qtTaskNode (qtDiagramGenerator *generator, smtk::task::Task *task, QGraphicsItem *parent=nullptr)
 
QRectF boundingRect () const override
 Get the bounding box of the node, which includes the border width and the label.
 
virtual QRectF contentBoundingRect () const
 Get the bounding box of the center content alone.
 
double contentHeightOffset () const
 Get the scale factor for the text height.
 
double sideTotalWidth () const
 Width of the side items.
 
void updateTaskState (smtk::task::State prev, smtk::task::State next, bool active) override
 Deals with state updates.
 
double roundingRadius () override
 Return the rounding radius used at the corners of the task node. More...
 
void dataUpdated () override
 Handle renames, etc.
 
- Public Member Functions inherited from smtk::extension::qtBaseTaskNode
 smtkSuperclassMacro (qtBaseObjectNode)
 
 smtkTypeMacro (smtk::extension::qtBaseTaskNode)
 
 qtBaseTaskNode (qtDiagramGenerator *generator, smtk::task::Task *task, QGraphicsItem *parent=nullptr)
 
smtk::common::UUID nodeId () const override
 Return the task's UUID as the node's UUID.
 
smtk::resource::PersistentObjectobject () const override
 Return the task as this node's persistent object.
 
smtk::task::Tasktask () const
 Return the task this node represents.
 
qtTaskEditoreditor () const
 Return the Task Editor for the node.
 
virtual void setOutlineStyle (OutlineStyle cs)
 Set/get how the node's boundary should be rendered.
 
OutlineStyle outlineStyle () const
 
bool isActive () const
 Return true if the task is currently active (i.e., being worked on by the user).
 
virtual bool setupContextMenu (QMenu *)
 Setup a context menu to be displayed by the node's underlying widget. More...
 
virtual void updateToMatchModifiedTask ()
 Deal with task updates (e.g., name or other configuration change). More...
 
- Public Member Functions inherited from smtk::extension::qtBaseObjectNode
 smtkSuperclassMacro (qtBaseNode)
 
 smtkTypeMacro (smtk::extension::qtBaseObjectNode)
 
 qtBaseObjectNode (qtDiagramGenerator *generator, smtk::resource::PersistentObject *obj, QGraphicsItem *parent=nullptr)
 
std::string name () const override
 Return the object's name as the node's name.
 
- Public Member Functions inherited from smtk::extension::qtBaseNode
 smtkSuperclassMacro (QGraphicsObject)
 
 smtkTypeMacroBase (smtk::extension::qtBaseNode)
 
 qtBaseNode (qtDiagramGenerator *scene, QGraphicsItem *parent=nullptr)
 
QRectF boundingRect () const override
 Return a dummy bounding-rect. More...
 
qtDiagramGeneratorgenerator () const
 Return the generator responsible for this node.
 
qtDiagramdiagram () const
 Return the diagram which owns the generator of this node.
 
qtDiagramScenescene () const
 Return the scene this node belongs to.
 
virtual void setContentStyle (ContentStyle cs)
 Set/get how much data the node should render inside its boundary.
 
ContentStyle contentStyle () const
 

Protected Member Functions

void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
 
int updateSize () override
 Update the node bounds to fit its content.
 
- Protected Member Functions inherited from smtk::extension::qtBaseNode
QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 
void addToScene ()
 Adds the node to the scene. More...
 

Protected Attributes

qtTaskNameItemm_textItem
 
qtTaskStatusItemm_statusItem
 
qtTaskCompletionItemm_completionItem
 
double m_contentHeightOffset = 30.0
 
double m_roundingRadius = 8.0
 
double m_sideTotalWidth = 50.0
 
double m_width
 
smtk::task::Task::Observers::Key m_taskObserver
 
- Protected Attributes inherited from smtk::extension::qtBaseTaskNode
smtk::task::Taskm_task { nullptr }
 
OutlineStyle m_outlineStyle { OutlineStyle::Normal }
 
- Protected Attributes inherited from smtk::extension::qtBaseNode
qtDiagramGeneratorm_generator { nullptr }
 
ContentStyle m_contentStyle { ContentStyle::Minimal }
 

Additional Inherited Members

- Public Types inherited from smtk::extension::qtBaseTaskNode
enum  OutlineStyle : int { OutlineStyle::Normal, OutlineStyle::Active }
 Determine how the border of the node's visual representation should be rendered. More...
 
- Public Types inherited from smtk::extension::qtBaseNode
enum  ContentStyle : int { ContentStyle::Minimal, ContentStyle::Summary, ContentStyle::Details }
 Determine how the node is presented to users. More...
 
- Signals inherited from smtk::extension::qtBaseNode
void nodeResized ()
 
void nodeMoved ()
 
- Properties inherited from smtk::extension::qtBaseTaskNode
OutlineStyle outlineStyle
 
- Properties inherited from smtk::extension::qtBaseObjectNode
smtk::resource::PersistentObject object
 
- Properties inherited from smtk::extension::qtBaseNode
ContentStyle contentStyle
 

Detailed Description

A implementation of a qtBaseTaskNode.

This implementation only depends qtGraphicItems and does not use Qt Widgets. The result is both a cleaner looking design and also does not suffer from the transformation problems that was noticed on Macs.

The new qtTaskNode is composed of 3 main graphics items:

Member Function Documentation

◆ roundingRadius()

double smtk::extension::qtTaskNode::roundingRadius ( )
inlineoverridevirtual

Return the rounding radius used at the corners of the task node.

Note that this does not mean the rounded corners are represented by circular arcs but in some cases are approximations based on quadratic curves.

Reimplemented from smtk::extension::qtBaseTaskNode.


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