#include <sxUiDesign.h>
Classes | |
class | PrivateData |
Public Types | |
enum | { ItemConnection, ItemPort, ItemComponent } |
Public Slots | |
void | captureToImage (qreal zoom) |
capture design into image file | |
Signals | |
void | designModified (bool flag) |
void | startExecution () |
void | finishExecution () |
void | displayMessageRequested (const QString &msg, int type) |
Public Member Functions | |
sxUiDesign (const QString &cap=QString(), QObject *parent=0) | |
sxInPort * | CreateInputPort () const |
sxOutPort * | CreateOutputPort () const |
sxConnection * | CreateConnection () |
sxComponent * | CreateComponent (const QString &lname, int type, bool loadMode) |
Allocate new component. | |
void | ExecutionStarted () |
void | ExecutionFinished () |
void | DisplayMessage (const QString &msg, sx::MessageType type=sx::RegularMessage) |
bool | CloseWindowAfterExecution () const |
bool | SaveCustom (QDomElement &root) |
save custom property | |
bool | LoadCustom (const QDomElement &root) |
Load custom property. | |
bool | PromptRunPropertyDialog () |
prompt execution property dialog | |
void | PromptPropertyDialog () |
void | SetModified (bool flag=true) |
bool | IsModified () const |
void | NewDesign (bool askBeforeClear=true) |
void | AddComponent (const QString &libname, int compId) |
Add new component to the design. | |
bool | RemoveAllComponents (bool ask=true) |
Remove all components in this scene. | |
void | RemoveComponent (sxUiComponent *comp) |
bool | LoadDesign (const QString &fname) |
Load design file. | |
bool | SaveDesign () |
bool | SaveDesignAs (const QString &fname) |
bool | StartExecution () |
bool | StopExecution () |
QRectF | BoundingRect () const |
calculate bounding rect for whole items | |
QFont | ItemFont (int itemId) const |
void | SetItemFont (int itemId, const QFont &f, bool upd=true) |
Protected Member Functions | |
void | CenterViews (qreal x, qreal y) |
center view positions at given coordinate | |
void | AdjustComponents (sxUiComponent *uicomp=0) |
adjust componet's ports and caption text. |
void sxUiDesign::AddComponent | ( | const QString & | libname, | |
int | compId | |||
) |
Add new component to the design.
compId | - component id |
References AdjustComponents(), CreateComponent(), and sxComponent::UiComponent().
void sxUiDesign::AdjustComponents | ( | sxUiComponent * | uicomp = 0 |
) | [protected] |
adjust componet's ports and caption text.
after creating/reading component from file, this method need to be called in order to get proper placement of port(s) and text
References sxUiComponent::Adjust(), and sxUiComponent::ReparentPorts().
Referenced by AddComponent(), and LoadDesign().
sxComponent * sxUiDesign::CreateComponent | ( | const QString & | lname, | |
int | type, | |||
bool | loadMode | |||
) | [virtual] |
Allocate new component.
lname | library name which component belongs to | |
id | component type |
Reimplemented from sxNetwork.
References sxComponent::UiComponent().
Referenced by AddComponent().
bool sxUiDesign::LoadDesign | ( | const QString & | fname | ) |
Load design file.
fname | Name of design file. Design file is saved in XML format. |
References AdjustComponents(), BoundingRect(), CenterViews(), sxNetwork::Load(), and RemoveAllComponents().