Provide a dialog that allow user to copy a property in an existing property or in a new one.
More...
#include <CopyPropertyDialog.h>
Public Member Functions |
| CopyPropertyDialog (QWidget *parent=0) |
void | init (tlp::Graph *graph, tlp::PropertyInterface *toCopy) |
| Init dialog with required parameters. To make the copy this dialog need to have a valid source property and destination graph.
|
tlp::PropertyInterface * | copyProperty (QString &errorMsg) |
| Perform the copy of the property in function of the parameters given by user. If parameters are invalid return a null pointer and fill the errorMsg with the description of the error.
|
QString | destinationPropertyName () const |
| Get the name of the destintation property.
|
PropertyScope | destinationPropertyScope () const |
| Return the scope where the new property will be created.
|
Static Public Member Functions |
static PropertyInterface * | copyProperty (tlp::Graph *graph, tlp::PropertyInterface *source, bool askBeforePropertyOverwriting=false, QWidget *parent=NULL) |
| This is a convenience static function that copy property in function of user parameters. If the user presses Cancel or an error occur, it returns a null pointer.
|
Detailed Description
Provide a dialog that allow user to copy a property in an existing property or in a new one.
The easiest way to use this class is to use the copyProperty static function.
Graph* g;
PropertyInterface* source = g->getLocalProperty<BooleanProperty>("viewSelection");
QWidget* parent;
Member Enumeration Documentation
Constructor & Destructor Documentation
tlp::CopyPropertyDialog::CopyPropertyDialog |
( |
QWidget * |
parent = 0 | ) |
|
Member Function Documentation
tlp::PropertyInterface* tlp::CopyPropertyDialog::copyProperty |
( |
QString & |
errorMsg | ) |
|
Perform the copy of the property in function of the parameters given by user. If parameters are invalid return a null pointer and fill the errorMsg with the description of the error.
This function don't hold observers during the copy process. It's up to user to call Observable::holdObserver and Observable::unholdObserver before and after calling this funtion.
static PropertyInterface* tlp::CopyPropertyDialog::copyProperty |
( |
tlp::Graph * |
graph, |
|
|
tlp::PropertyInterface * |
source, |
|
|
bool |
askBeforePropertyOverwriting = false , |
|
|
QWidget * |
parent = NULL |
|
) |
| |
|
static |
This is a convenience static function that copy property in function of user parameters. If the user presses Cancel or an error occur, it returns a null pointer.
The function creates a modal property copy dialog with the given source property, graph and parent widget.
- Parameters
-
graph | The graph to use as parent for the properties to create. |
source | The property to copy. |
askBeforePropertyOverwriting | If set to true and user try to create a new property with the same name than another existing ask user before overwriting them. |
QString tlp::CopyPropertyDialog::destinationPropertyName |
( |
| ) |
const |
Get the name of the destintation property.
PropertyScope tlp::CopyPropertyDialog::destinationPropertyScope |
( |
| ) |
const |
Return the scope where the new property will be created.
void tlp::CopyPropertyDialog::init |
( |
tlp::Graph * |
graph, |
|
|
tlp::PropertyInterface * |
toCopy |
|
) |
| |
Init dialog with required parameters. To make the copy this dialog need to have a valid source property and destination graph.