cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
Public Types | Public Member Functions | List of all members
QuXtraWidgetI Class Referenceabstract

QuXtraWidgetI defines an interface for widgets created by an implementation of QuXtraWidgetPluginI. More...

#include <quxtrawidgetplugininterface.h>

Public Types

enum  Type {
  Reader = 0x1 , Writer = 0x2 , ReaderWriter = 0x3 , Reader = 0x1 ,
  Writer = 0x2 , ReaderWriter = 0x3
}
 
enum  Type {
  Reader = 0x1 , Writer = 0x2 , ReaderWriter = 0x3 , Reader = 0x1 ,
  Writer = 0x2 , ReaderWriter = 0x3
}
 

Public Member Functions

virtual ~QuXtraWidgetI ()
 
virtual CuContextgetContext () const =0
 getContext subclasses must provide a pointer to the CuContext in use More...
 
virtual QString link () const =0
 link returns the name of the link (i.e. the source of a reader or the target of a writer) More...
 
virtual void setLink (const QString &s)=0
 setLink sets the name of the link (source or target) More...
 
virtual void unsetLink ()=0
 unsetLink remove the source [target] linked to the reader [writer] More...
 
virtual Type getType () const =0
 getType returns a combination of QuXtraWidgetI::Type flags More...
 
virtual ~QuXtraWidgetI ()
 
virtual CuContextgetContext () const =0
 getContext subclasses must provide a pointer to the CuContext in use More...
 
virtual QString link () const =0
 link returns the name of the link (i.e. the source of a reader or the target of a writer) More...
 
virtual void setLink (const QString &s)=0
 setLink sets the name of the link (source or target) More...
 
virtual void unsetLink ()=0
 unsetLink remove the source [target] linked to the reader [writer] More...
 
virtual Type getType () const =0
 getType returns a combination of QuXtraWidgetI::Type flags More...
 

Detailed Description

QuXtraWidgetI defines an interface for widgets created by an implementation of QuXtraWidgetPluginI.

Since QuXtraWidgetPluginI::create methods instantiate a QWidget, QuXtraWidgetI can be accessed through a dynamic_cast.

Best practise
To avoid dynamic casting to QuXtraWidgetI from QWidget, it is a good practise to provide access to the widget useful methods through etither slots or properties. For example, the source property could be a shortcut to the link and setLink methods. For example:
class QuTextView : public QTextEdit, public QuXtraWidgetI, public CuDataListener
{
Q_OBJECT
Q_PROPERTY(QString source READ link WRITE setLink)
// ...
}
QuXtraWidgetI defines an interface for widgets created by an implementation of QuXtraWidgetPluginI.
Definition: plugin_ifaces/quxtrawidgetplugininterface.h:49
Note
Since QuXtraWidgetI subclasses can either be readers, writers or both, the usual source, target, setSource and setTarget methods have been unified under the names setLink and link. Through the Qt property system it is possible to map the link methods to either source or target property names, as aforementioned.
Real time plot example.
Please read the real time plot tutorial for an example.
See also
QuXtraWidgetPluginLoader
QuXtraWidgetPluginI

Member Enumeration Documentation

◆ Type [1/2]

Enumerator
Reader 
Writer 
ReaderWriter 
Reader 
Writer 
ReaderWriter 

◆ Type [2/2]

Enumerator
Reader 
Writer 
ReaderWriter 
Reader 
Writer 
ReaderWriter 

Constructor & Destructor Documentation

◆ ~QuXtraWidgetI() [1/2]

virtual QuXtraWidgetI::~QuXtraWidgetI ( )
inlinevirtual

◆ ~QuXtraWidgetI() [2/2]

virtual QuXtraWidgetI::~QuXtraWidgetI ( )
inlinevirtual

Member Function Documentation

◆ getContext() [1/2]

virtual CuContext * QuXtraWidgetI::getContext ( ) const
pure virtual

getContext subclasses must provide a pointer to the CuContext in use

Returns
a pointer to the CuContext used by the subclass.

◆ getContext() [2/2]

virtual CuContext * QuXtraWidgetI::getContext ( ) const
pure virtual

getContext subclasses must provide a pointer to the CuContext in use

Returns
a pointer to the CuContext used by the subclass.

◆ getType() [1/2]

virtual Type QuXtraWidgetI::getType ( ) const
pure virtual

getType returns a combination of QuXtraWidgetI::Type flags

◆ getType() [2/2]

virtual Type QuXtraWidgetI::getType ( ) const
pure virtual

getType returns a combination of QuXtraWidgetI::Type flags

◆ link() [1/2]

virtual QString QuXtraWidgetI::link ( ) const
pure virtual

link returns the name of the link (i.e. the source of a reader or the target of a writer)

Returns
a string with the name of the source or target of data

This is the equivalent of either source or target and must be implemented by subclasses.

Subclasses are advised to provide either a source or target property mapped to link and setLink to read and write the property, respectively:

\codeline Q_PROPERTY(QString source READ link WRITE setLink)

◆ link() [2/2]

virtual QString QuXtraWidgetI::link ( ) const
pure virtual

link returns the name of the link (i.e. the source of a reader or the target of a writer)

Returns
a string with the name of the source or target of data

This is the equivalent of either source or target and must be implemented by subclasses.

Subclasses are advised to provide either a source or target property mapped to link and setLink to read and write the property, respectively:

\codeline Q_PROPERTY(QString source READ link WRITE setLink)

◆ setLink() [1/2]

virtual void QuXtraWidgetI::setLink ( const QString &  s)
pure virtual

setLink sets the name of the link (source or target)

Parameters
sthe name of the link to connect to the desired engine.

This is the equivalent of either setSource or setTarget and must be implemented by subclasses.

Subclasses are advised to provide either a source or target property mapped to link and setLink to read and write the property, respectively.

\codeline Q_PROPERTY(QString source READ link WRITE setLink)

◆ setLink() [2/2]

virtual void QuXtraWidgetI::setLink ( const QString &  s)
pure virtual

setLink sets the name of the link (source or target)

Parameters
sthe name of the link to connect to the desired engine.

This is the equivalent of either setSource or setTarget and must be implemented by subclasses.

Subclasses are advised to provide either a source or target property mapped to link and setLink to read and write the property, respectively.

\codeline Q_PROPERTY(QString source READ link WRITE setLink)

◆ unsetLink() [1/2]

virtual void QuXtraWidgetI::unsetLink ( )
pure virtual

unsetLink remove the source [target] linked to the reader [writer]

Must be implemented by subclasses.

◆ unsetLink() [2/2]

virtual void QuXtraWidgetI::unsetLink ( )
pure virtual

unsetLink remove the source [target] linked to the reader [writer]

Must be implemented by subclasses.


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