Carousel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
ToolBase Class Reference

The ToolBase class overrides all ITool methods with empty implementation for further convenience of inheritance. More...

#include <ToolBase.h>

Inherits Operation, and ITool.

Public Member Functions

 ToolBase (QActionGroup *actionGroup=nullptr)
 
 ToolBase (const QString &text, QActionGroup *actionGroup=nullptr)
 
 ToolBase (const QIcon &icon, const QString &text, QActionGroup *actionGroup=nullptr)
 
void execute ()
 
void initialize (IServiceLocator *serviceLocator)
 
bool onContextMenu (QContextMenuEvent *event)
 
void onDoubleClick (QMouseEvent *event)
 
void onKeyDown (QKeyEvent *event)
 
void onKeyUp (QKeyEvent *event)
 
void onMouseDown (QMouseEvent *event)
 
void onMouseMove (QMouseEvent *event)
 
void onMouseUp (QMouseEvent *event)
 
void stopExecuting ()
 
- Public Member Functions inherited from Operation
 Operation (QActionGroup *actionGroup=nullptr)
 
 Operation (const QString &text, QActionGroup *actionGroup=nullptr)
 
 Operation (const QIcon &icon, const QString &text, QActionGroup *actionGroup=nullptr)
 
QString category () const
 
QString name () const
 
- Public Member Functions inherited from QAction
 QAction (QObject *parent)
 
 QAction (const QString &text, QObject *parent)
 
 QAction (QObject *parent, const char *name)
 
 QAction (const QString &text, const QKeySequence &shortcut, QObject *parent, const char *name)
 
 QAction (const QIcon &icon, const QString &text, QObject *parent)
 
 QAction (const QIcon &icon, const QString &text, const QKeySequence &shortcut, QObject *parent, const char *name)
 
QKeySequence accel () const
 
QActionGroupactionGroup () const
 
void activate (ActionEvent event)
 
void activated (int i)
 
bool addTo (QWidget *w)
 
QList< QGraphicsWidget * > associatedGraphicsWidgets () const
 
QList< QWidget * > associatedWidgets () const
 
bool autoRepeat () const
 
void changed ()
 
QVariant data () const
 
QFont font () const
 
void hover ()
 
void hovered ()
 
QIcon icon () const
 
QIcon iconSet () const
 
QString iconText () const
 
bool isCheckable () const
 
bool isChecked () const
 
bool isEnabled () const
 
bool isIconVisibleInMenu () const
 
bool isOn () const
 
bool isSeparator () const
 
bool isToggleAction () const
 
bool isVisible () const
 
QMenumenu () const
 
MenuRole menuRole () const
 
QString menuText () const
 
QWidgetparentWidget () const
 
Priority priority () const
 
bool removeFrom (QWidget *w)
 
void setAccel (const QKeySequence &shortcut)
 
void setActionGroup (QActionGroup *group)
 
void setAutoRepeat (bool)
 
void setCheckable (bool)
 
void setChecked (bool)
 
void setData (const QVariant &userData)
 
void setDisabled (bool b)
 
void setEnabled (bool)
 
void setFont (const QFont &font)
 
void setIcon (const QIcon &icon)
 
void setIconSet (const QIcon &i)
 
void setIconText (const QString &text)
 
void setIconVisibleInMenu (bool visible)
 
void setMenu (QMenu *menu)
 
void setMenuRole (MenuRole menuRole)
 
void setMenuText (const QString &text)
 
void setOn (bool b)
 
void setPriority (Priority priority)
 
void setSeparator (bool b)
 
void setShortcut (const QKeySequence &shortcut)
 
void setShortcutContext (Qt::ShortcutContext context)
 
void setShortcuts (QKeySequence::StandardKey key)
 
void setShortcuts (const QList< QKeySequence > &shortcuts)
 
void setSoftKeyRole (SoftKeyRole softKeyRole)
 
void setStatusTip (const QString &statusTip)
 
void setText (const QString &text)
 
void setToggleAction (bool b)
 
void setToolTip (const QString &tip)
 
void setVisible (bool)
 
void setWhatsThis (const QString &what)
 
QKeySequence shortcut () const
 
Qt::ShortcutContext shortcutContext () const
 
QList< QKeySequenceshortcuts () const
 
bool showStatusText (QWidget *widget)
 
SoftKeyRole softKeyRole () const
 
QString statusTip () const
 
QString text () const
 
void toggle ()
 
void toggled (bool checked)
 
QString toolTip () const
 
void trigger ()
 
void triggered (bool checked)
 
QString whatsThis () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 
- Public Member Functions inherited from IOperation
virtual void executingStopped ()=0
 

Additional Inherited Members

- Signals inherited from Operation
void executingStopped ()
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from Operation
void connectToSignals ()
 
void disconectFromSignals ()
 
void setCategory (const QString &category)
 
void setName (const QString &name)
 
- Protected Member Functions inherited from QAction
virtual bool event (QEvent *e)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QAction
 autoRepeat
 
 checkable
 
 checked
 
 enabled
 
 font
 
 icon
 
 iconText
 
 iconVisibleInMenu
 
 menuRole
 
 priority
 
 shortcut
 
 shortcutContext
 
 softKeyRole
 
 statusTip
 
 text
 
 toolTip
 
 visible
 
 whatsThis
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The ToolBase class overrides all ITool methods with empty implementation for further convenience of inheritance.

You can derive your tools for the components from this class, if you don't want to override all members. The ToolBase class also set QAction::checkable() property to the true.

Constructor & Destructor Documentation

ToolBase::ToolBase ( QActionGroup actionGroup = nullptr)

Initializes a new instance of the ToolBase class with action group, if any. If the action group not null, this tool will be automatically inserted into the group.

ToolBase::ToolBase ( const QString text,
QActionGroup actionGroup = nullptr 
)

Constructs a tool with action group, if any. If the action group not null, this tool will be automatically inserted into the group.

The ToolBase uses a stripped version of text (e.g. "&Menu Option..." becomes "Menu Option") as descriptive text for tool buttons. You can override this by setting a specific description with setText(). The same text will be used for tooltips unless you specify a different text using setToolTip().

ToolBase::ToolBase ( const QIcon icon,
const QString text,
QActionGroup actionGroup = nullptr 
)

Constructs a tool with action group, if any. If the action group not null, this tool will be automatically inserted into the group.

The ToolBase uses a stripped version of text (e.g. "&Menu Option..." becomes "Menu Option") as descriptive text for tool buttons. You can override this by setting a specific description with setText(). The same text will be used for tooltips unless you specify a different text using setToolTip().

Member Function Documentation

void ToolBase::execute ( )
virtual

Called when this tool is activated by user (button/menu is clicked, or shortkey pressed).

The ToolBase sets itself to the IInteractionService as the active tool when this method is invoked.

Write the code that performs the action when the tool is clicked in this method.

Note
Do not forget to call parent method ToolBase::execute();

Implements IOperation.

void ToolBase::stopExecuting ( )
virtual

Occurs when user switch off this operation explicitly or implicitly (by selecting other tool).

Does nothing by default, just calls parent one.

Reimplemented from Operation.

void ToolBase::initialize ( IServiceLocator serviceLocator)
virtual

Called by carousel interactivity system to gives the operation a hook into the application. When subclassing ToolBase, use the initialize() method to get a hook to the application.

Reimplemented from Operation.

bool ToolBase::onContextMenu ( QContextMenuEvent event)
virtual

Context menu event occured at the given in event location.

When impting Ito create a custom tool, write code to display a custom context menu the right mouse button is pressed when this tool is the active too * If your tool displays a custom context menu, it should let the application know that it handled the onContextMenu event by returning true. If you don't do this, the standard context menu will be displayed.

Implements IInputReceiver.

void ToolBase::onDoubleClick ( QMouseEvent event)
virtual

Occurs when a mouse button is double clicked when this tool is active.

Implements IInputReceiver.

void ToolBase::onKeyDown ( QKeyEvent event)
virtual

Occurs when a key on the keyboard is pressed when this tool is active.

Implements IInputReceiver.

void ToolBase::onKeyUp ( QKeyEvent event)
virtual

Occurs when a key on the keyboard is released when this tool is active.

Implements IInputReceiver.

void ToolBase::onMouseDown ( QMouseEvent event)
virtual

Occurs when a mouse button is pressed when this tool is active.

Implements IInputReceiver.

void ToolBase::onMouseMove ( QMouseEvent event)
virtual

Occurs when the mouse is moved when this tool is active.

Implements IInputReceiver.

void ToolBase::onMouseUp ( QMouseEvent event)
virtual

Occurs when a mouse button is released when this tool is active.

Implements IInputReceiver.