mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-04 11:30:52 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user