mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
New element panel can display the thumbnail of elements used in a project
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4293 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -90,6 +90,50 @@ CustomElement::CustomElement(const ElementsLocation &location, QGraphicsItem *qg
|
||||
elmt_state = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CustomElement::CustomElement
|
||||
* Constructor build an element from the location @location
|
||||
* @param location : location of the element
|
||||
* @param parent : parent of element
|
||||
* @param state : pointeur used to know the encountered error at creation...
|
||||
- 0 : No error
|
||||
- 1 : The location don't represent an element
|
||||
- 2 : The location can't be readable
|
||||
- 3 : The location isn't valid / exploitable / usable
|
||||
- 4 : The xml document wasn't an element "definition"
|
||||
- 5 : The attributes of the defintion aren't present and/or valid
|
||||
- 6 : The defintion is empty
|
||||
- 7 : The analyze of an xml element that describe a part of the drawing was failed
|
||||
- 8 : No part of the drawing can be loaded
|
||||
*/
|
||||
CustomElement::CustomElement(ElementLocation &location, QGraphicsItem *parent, int *state) :
|
||||
FixedElement(parent),
|
||||
elmt_state(-1),
|
||||
m_location(location),
|
||||
forbid_antialiasing(false)
|
||||
|
||||
{
|
||||
if (!location.isElement())
|
||||
{
|
||||
if (state) *state = 1;
|
||||
elmt_state = 1;
|
||||
}
|
||||
|
||||
//Start from empty lists.
|
||||
list_lines_.clear();
|
||||
list_rectangles_.clear();
|
||||
list_circles_.clear();
|
||||
list_polygons_.clear();
|
||||
list_arcs_.clear();
|
||||
|
||||
buildFromXml(location.xml(), &elmt_state);
|
||||
if (state) *state = elmt_state;
|
||||
if (elmt_state) return;
|
||||
|
||||
if (state) *state = 0;
|
||||
elmt_state = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Construit l'element personnalise a partir d'un element XML representant sa
|
||||
definition.
|
||||
|
||||
Reference in New Issue
Block a user