Overview     Modules     Class Hierarchy     Classes     Members  
tlp::CopyPropertyDialog Class Reference

Provide a dialog that allow user to copy a property in an existing property or in a new one. More...

#include <CopyPropertyDialog.h>

List of all members.

Public Types

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;
 PropertyInterface* clonedProperty = PropertyCreationDialog::createNewProperty(g,souce,parent);

Member Enumeration Documentation

Enumerator:
NEW 
LOCAL 
INHERITED 

Constructor & Destructor Documentation


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:
graphThe graph to use as parent for the properties to create.
sourceThe property to copy.
askBeforePropertyOverwritingIf set to true and user try to create a new property with the same name than another existing ask user before overwriting them.

Get the name of the destintation property.

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.



Tulip Software by LaBRI Visualization Team    2001 - 2012