add class ElementProvider and build small ui for the properties of folio report element

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2672 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2013-12-28 13:28:27 +00:00
parent c44f8704f9
commit 38e3e26ff8
10 changed files with 250 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ class Element : public QetGraphicsItem {
QSize dimensions;
QPoint hotspot_coord;
QPixmap preview;
QList <Element *> connected_elements;
// methods
public:
@@ -79,6 +80,7 @@ class Element : public QetGraphicsItem {
virtual int minTerminalsCount() const = 0;
/// @return the maximum number of terminals for this element
virtual int maxTerminalsCount() const = 0;
bool isFree () const;
/**
Draw this element
*/
@@ -131,6 +133,10 @@ class Element : public QetGraphicsItem {
void updatePixmap();
};
inline bool Element::isFree() const {
return (connected_elements.isEmpty());
}
/**
Indicate whether this element allows internal connections, i.e. whether its
terminals can be linked together using a conductor.