ExperimentManager script class  1.1.0.1
The Experiment Manager script class reference.
Public Slots | Signals | Public Member Functions | List of all members
QML2Viewer Class Reference

The QML2Viewer class. More...

Inheritance diagram for QML2Viewer:
ExperimentEngine

Public Slots

QString addPixmapToImageBuffer (const QPixmap &pixmap)
 Adds a QPixmap to the internal Image Buffer. More...
 
bool executeQML2Document (const QString &strSource, bool bIsFile=true)
 Executes a QML document. More...
 
bool getPixmapFromImageBuffer (QPixmap *pixmap, const QString &ID)
 Retrieves a QPixmap to the internal Image Buffer. More...
 
QVariant invokeQml2Method (QString strRootObjectName, QString strMethodName, QVariant inputValue1=QVariant(), QVariant inputValue2=QVariant(), QVariant inputValue3=QVariant(), QVariant inputValue4=QVariant(), QVariant inputValue5=QVariant(), QVariant inputValue6=QVariant(), QVariant inputValue7=QVariant(), QVariant inputValue8=QVariant(), QVariant inputValue9=QVariant())
 Invokes a QML Method. More...
 
bool removePixmapFromImageBuffer (const QString &ID)
 Removes a QPixmap inside the internal Image Buffer. More...
 
void setTopLeftWindowPosition (const int &nXposition, const int &nYposition)
 Sets the top-left position of the presentation window and allows to specify whether this window should be a frame-less window or not. More...
 
void setWindowMode (const bool &bIsFullScreen, const bool &bIsFrameless=true)
 Sets the presentation window mode. More...
 
bool updatePixmapFromImageBuffer (QPixmap *pixmap, const QString &ID)
 Updates a QPixmap inside the internal Image Buffer. More...
 
bool updatePixmapIDFromImageBuffer (const QString &oldID, const QString &newID)
 Updates the ID string of a corresponding QPixmap inside the internal Image Buffer. More...
 
- Public Slots inherited from ExperimentEngine
virtual QScreen * getActiveStimuliOutputScreen ()
 Returns a QScreen object representing the active Stimuli Output Screen. More...
 
QScriptValue getExperimentObjectParameter (const int &nObjectID, const QString &strName)
 retrieves the current value of an Experiment Parameter variable. More...
 
int getObjectID ()
 Returns this Object ID. More...
 
void incrementExternalTrigger ()
 Increments the External Trigger. More...
 
bool insertExpObjectBlockParameter (const int nObjectID, const QString sName, const QString sValue, bool bIsInitializing=true, bool bIsCustom=false, bool bForceImmediateParse=false)
 Update or insert an Experiment Block Parameter that can be parsed. More...
 
virtual bool setActiveStimuliOutputScreen (int nScreenNumber)
 Sets a Screen referred by it's Screen Number as the current active Stimuli Output Screen. More...
 
bool setExperimentObjectParameter (const int &nObjectID, const QString &strName, const QScriptValue &sScriptVal, const bool &bBufferTillChanged=false)
 Sets the current value of an existing Experiment Parameter variable. More...
 

Signals

void NewSourceLoaded (QString sFileURL)
 The NewSourceLoaded Signal. More...
 
- Signals inherited from ExperimentEngine
void ExperimentStructureChanged (int nBlock, int nTrial, int nInternalTrigger)
 The ExperimentStructureChanged Signal. More...
 
void ExternalTriggerIncremented (int nTrigger)
 The ExternalTriggerIncremented Signal. More...
 
void NewInitBlockTrial (void)
 The NewInitBlockTrial Signal. More...
 
void ObjectShouldStop (void)
 The ObjectShouldStop Signal. More...
 
void ObjectStateHasChanged (ExperimentSubObjectState expSubObjectState)
 The ObjectStateHasChanged Signal. More...
 
void PrepareNewInitBlockTrial (void)
 The PrepareNewInitBlockTrial Signal. More...
 
void UserWantsToClose (void)
 The UserWantsToClose Signal. More...
 

Public Member Functions

 QML2Viewer (QObject *parent=NULL)
 The QML2Viewer constructor. More...
 
 ~QML2Viewer ()
 The QML2Viewer destructor. More...
 
- Public Member Functions inherited from ExperimentEngine
 ExperimentEngine (QObject *parent=NULL)
 The ExperimentEngine constructor. More...
 
 ~ExperimentEngine ()
 The ExperimentEngine destructor. More...
 

Detailed Description

The QML2Viewer class.

The QML2Viewer class can be used in combination with the ExperimentManager for presenting visual or other kind of stimuli using QML/QtQuick.

Constructor & Destructor Documentation

QML2Viewer::QML2Viewer ( QObject *  parent = NULL)

The QML2Viewer constructor.

You do not need to specify the parent object. The BrainStim script engine automatically retrieves the parent role

QML2Viewer::~QML2Viewer ( )

The QML2Viewer destructor.

You do not need call the destructor. The BrainStim script engine automatically performs the garbage collection after you set the object to NULL and the script ends

Member Function Documentation

QString QML2Viewer::addPixmapToImageBuffer ( const QPixmap &  pixmap)
slot

Adds a QPixmap to the internal Image Buffer.

This function can add a QPixmap to the internal Image Buffer. These images can then be rapidly presented because they are already loaded in memory.

Parameters
pixmapthe QPixmap to be added to the internal Image Buffer.
Returns
a Unique string created by the Image Buffer holding a key to access the newly added image. See QML2Viewer::getPixmapFromImageBuffer and QML2Viewer::updatePixmapFromImageBuffer.
bool QML2Viewer::executeQML2Document ( const QString &  strSource,
bool  bIsFile = true 
)
slot

Executes a QML document.

This function can execute a QML document.

Parameters
strSourcethe path to a QML file or the QML code itself.
bIsFilea boolean value determining whether the
strSourceis a path to a QML file, if false then the
strSourceis interpreted as QML code.
Returns
a boolean value determining whether the function could be executed successfully.
bool QML2Viewer::getPixmapFromImageBuffer ( QPixmap *  pixmap,
const QString &  ID 
)
slot

Retrieves a QPixmap to the internal Image Buffer.

This function can retrieve a QPixmap to the internal Image Buffer.

Parameters
pixmapthe retrieved QPixmap from the internal Image Buffer.
IDthe String containing the unique String previously created by the Image Buffer.
Returns
a boolean value representing whether the function executed successfully. See QML2Viewer::addPixmapToImageBuffer.
QVariant QML2Viewer::invokeQml2Method ( QString  strRootObjectName,
QString  strMethodName,
QVariant  inputValue1 = QVariant(),
QVariant  inputValue2 = QVariant(),
QVariant  inputValue3 = QVariant(),
QVariant  inputValue4 = QVariant(),
QVariant  inputValue5 = QVariant(),
QVariant  inputValue6 = QVariant(),
QVariant  inputValue7 = QVariant(),
QVariant  inputValue8 = QVariant(),
QVariant  inputValue9 = QVariant() 
)
slot

Invokes a QML Method.

This function can invoke/call a defined function within the current QML context.

Parameters
strRootObjectNamethe name of the root item containing the function definition in the QML context.
strMethodNamethe name of the function to be called
inputValue1- a parameters that can be automatically passed to the function if it is provided.
inputValue2- a parameters that can be automatically passed to the function if it is provided.
inputValue3- a parameters that can be automatically passed to the function if it is provided.
inputValue4- a parameters that can be automatically passed to the function if it is provided.
inputValue5- a parameters that can be automatically passed to the function if it is provided.
inputValue6- a parameters that can be automatically passed to the function if it is provided.
inputValue7- a parameters that can be automatically passed to the function if it is provided.
inputValue8- a parameters that can be automatically passed to the function if it is provided.
inputValue9- a parameters that can be automatically passed to the function if it is provided.
Returns
a QVariant containing the invoked function return value converted to a QVariant.
void QML2Viewer::NewSourceLoaded ( QString  sFileURL)
signal

The NewSourceLoaded Signal.

You can use this Signal to detect whenever internal QML2 Engine loads a new source.

Parameters
sFileURLa string containing the URL of the loaded file.
bool QML2Viewer::removePixmapFromImageBuffer ( const QString &  ID)
slot

Removes a QPixmap inside the internal Image Buffer.

This function can remove a QPixmap that is stored in the internal Image Buffer.

Parameters
IDthe String containing the unique String previously created by the Image Buffer.
Returns
a boolean value representing whether the function executed successfully. See QML2Viewer::addPixmapToImageBuffer.
void QML2Viewer::setTopLeftWindowPosition ( const int &  nXposition,
const int &  nYposition 
)
slot

Sets the top-left position of the presentation window and allows to specify whether this window should be a frame-less window or not.

This function sets the top-left position of the presentation window and allows to specify whether this window should be a frame-less window or not. this function can only make a difference in a non full-screen presentation window mode, see QML2Viewer::setWindowMode.

Parameters
nXpositiona integer value specifying the top-left X position of the presentation window.
nYpositiona integer value specifying the top-left Y position of the presentation window. See QML2Viewer::setWindowMode.
void QML2Viewer::setWindowMode ( const bool &  bIsFullScreen,
const bool &  bIsFrameless = true 
)
slot

Sets the presentation window mode.

This function sets the mode for the presentation window. It can been shown either full-screen where the root object defined in the QML file is automatically resized to the full-screen window size or in a windowed mode, see also QML2Viewer::setTopLeftWindowPosition, where the size of the window is automatically sized to the size of the root object defined in the QML file.

Parameters
bIsFullScreena boolean value specifying whether the mode for the presentation window should be full-screen (=default mode).
bIsFramelessa boolean value specifying whether the presentation window should be displayed without a frame (=default mode). See QML2Viewer::setTopLeftWindowPosition.
bool QML2Viewer::updatePixmapFromImageBuffer ( QPixmap *  pixmap,
const QString &  ID 
)
slot

Updates a QPixmap inside the internal Image Buffer.

This function can update a QPixmap that is stored in the internal Image Buffer.

Parameters
pixmapthe new QPixmap to which the stored QPixmap inside the Image Buffer should update to.
IDthe String containing the unique String previously created by the Image Buffer.
Returns
a boolean value representing whether the function executed successfully. See QML2Viewer::addPixmapToImageBuffer.
bool QML2Viewer::updatePixmapIDFromImageBuffer ( const QString &  oldID,
const QString &  newID 
)
slot

Updates the ID string of a corresponding QPixmap inside the internal Image Buffer.

This function can update the ID string of a corresponding QPixmap that is stored in the internal Image Buffer.

Parameters
oldIDthe String containing the current ID String, created by the Image Buffer, that should change.
newIDthe String containing the new unique ID string.
Returns
a boolean value representing whether the function could execute successfully.