QDaq  0.2.6
Qt-based Data Aqcuisition
 All Classes Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Public Slots | Signals | Public Member Functions | Properties | List of all members
QDaqRoot Class Reference

QDaq root object class. More...

#include <QDaqRoot.h>

Inheritance diagram for QDaqRoot:
Inheritance graph
[legend]
Collaboration diagram for QDaqRoot:
Collaboration graph
[legend]

Public Slots

QStringList classNames ()
 Return the names of registered object classes.
 
- Public Slots inherited from QDaqObject
QString errorBacktrace (int maxItems=10) const
 Print a backtrace of recent errors in this QDaqObject.
 
QString path () const
 Return the object's path in the QDaq tree. More...
 
QString objectTree () const
 Output in a string the object hierarchy beneath this object.
 
QString listProperties () const
 List the objects properties.
 
QString listFunctions () const
 List the objects scriptable functions.
 
QDaqObjectparent () const
 
QDaqObjectList children () const
 Return a list of children of this object.
 
bool hasChildren () const
 Returns true if the object has children.
 
QDaqObjectappendChild (QDaqObject *obj)
 Adds a new child QDaqObject, as the last child and returns a pointer to it.
 
QDaqObjectinsertBefore (QDaqObject *newobj, QDaqObject *existingobj)
 Adds a new child QDaqObject, before an existing child and returns a pointer to it.
 
QDaqObjectclone ()
 Clone a QDaqObject with its child objects.
 
QDaqObjectremoveChild (QDaqObject *obj)
 Remove a child and return a pointer to it.
 
QDaqObjectreplaceChild (QDaqObject *newobj, QDaqObject *oldobj)
 Replace a child and return a pointer to the old child.
 
QDaqObjectfindChild (const QString &name) const
 Find the first child QDaqObject with objectName equal to name.
 

Signals

void daqWindowsChanged ()
 Fired when a top level window is opened or closed.
 
void objectAttached (QDaqObject *obj)
 Fired when object is attached.
 
void objectDetached (QDaqObject *obj)
 Fired when object is detached.
 
- Signals inherited from QDaqObject
void propertiesChanged ()
 Fired when object properties have changed.
 
void updateWidgets ()
 Fired when widgets need update.
 

Public Member Functions

QDaqObjectcreateObject (const QString &name, const QString &className)
 Create a QDaqObject with name name and class className. More...
 
void postError (const QDaqError &e)
 Called to post an error at the QDaq error queue. More...
 
QWidgetList daqWindows () const
 Return a list of QDaq top level windows.
 
QDaqIDE * ideWindow ()
 Return a pointer to the QDaq IDE window.
 
QDaqIDE * createIdeWindow ()
 Create the QDaq IDE window and return a pointer to it.
 
QDaqSession * rootSession ()
 Returns a pointer to the root script session.
 
const QDaqErrorQueue * errorQueue () const
 Returns a pointer to the QDaq error queue.
 
void registerClass (const QMetaObject *metaObj)
 Register a QDaqObject-derived class type Registered classes can be created by createObject(). More...
 
QList< const QMetaObject * > registeredClasses () const
 Returns list of registered class metaObjects.
 
- Public Member Functions inherited from QDaqObject
Q_INVOKABLE QDaqObject (const QString &name)
 Construct a QDaqObject with a name. More...
 
virtual void attach ()
 Attach this QDaqObject to the QDaq tree. More...
 
virtual void detach ()
 Detach this QDaqObject from the QDaq tree. More...
 
bool isAttached () const
 Returns true is this object is attached to the QDaq tree.
 

Properties

QString rootDir
 The application root directory.
 
QString logDir
 The directory where log files are written.
 

Additional Inherited Members

- Static Public Member Functions inherited from QDaqObject
static QDaqRootroot ()
 Obtain a pointer to the one-and-only QDaqRoot object.
 
static QDaqObjectfromPath (const QString &path)
 Return a pointer to an object given its full path in the QDaq tree. More...
 
- Public Attributes inherited from QDaqObject
QMutex comm_lock
 A recursive mutex for synching thread access to this object.
 
- Protected Member Functions inherited from QDaqObject
void pushError (const QString &type, const QString &descr=QString()) const
 Push an error in the error queue.
 
void throwScriptError (const QString &msg) const
 Throw a script error with message msg.
 
bool checkName (const QString &name) const
 Check if name is a legal name for an QDaqObject. More...
 
virtual void writeh5 (H5::Group *g, QDaqH5File *f) const
 Write contents of the object to a H5 group. More...
 
virtual void readh5 (H5::Group *g, QDaqH5File *f)
 Read contents of the object from a H5 group. More...
 

Detailed Description

QDaq root object class.

At the top of the QDaq tree structure there is an object of type QDaqRoot. It is a subclass of QDaqObject.

The QDaq root is a single static object which can be accessed by QDaqObject::root().

The QDaq root should be instantiated in the main function, after QApplication.

int main()
{
QApplication app;
QDaqRoot qdaq;
// do something
return app.exec();
}

The name of QDaq root is "qdaq".

A number of static items available to all QDaq objects are defined under QDaqRoot:

Definition at line 59 of file QDaqRoot.h.

Member Function Documentation

QDaqObject * QDaqRoot::createObject ( const QString &  name,
const QString &  className 
)

Create a QDaqObject with name name and class className.

Calls the constructor of className with name as the single argument.

The class with name className must be previously be registered with registerClass.

Typically used by QDaqScriptEngine to create QDaq objects in script code.

Definition at line 98 of file QDaqRoot.cpp.

void QDaqRoot::postError ( const QDaqError e)
inline

Called to post an error at the QDaq error queue.

This function is thread safe.

Definition at line 101 of file QDaqRoot.h.

void QDaqRoot::registerClass ( const QMetaObject *  metaObj)

Register a QDaqObject-derived class type Registered classes can be created by createObject().

Parameters
metaObjmeta-object of the class

Definition at line 120 of file QDaqRoot.cpp.


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