mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-28 14:50:52 +01:00
Translate documentation + Fix indentation
This commit is contained in:
@@ -66,7 +66,10 @@ QET::ScalingMethod CustomElementPart::preferredScalingMethod() const {
|
||||
@param points List of points when the movement started, in scene coordinates.
|
||||
@return The list of points mapped from initial_selection_rect to new_selection_rect
|
||||
*/
|
||||
QList<QPointF> CustomElementPart::mapPoints(const QRectF &initial_selection_rect, const QRectF &new_selection_rect, const QList<QPointF> &points) {
|
||||
QList<QPointF> CustomElementPart::mapPoints(
|
||||
const QRectF &initial_selection_rect,
|
||||
const QRectF &new_selection_rect,
|
||||
const QList<QPointF> &points) {
|
||||
QList<QPointF> new_points;
|
||||
if (!points.count()) return(new_points);
|
||||
|
||||
|
||||
@@ -29,21 +29,27 @@ class QGraphicsItem;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
|
||||
/**
|
||||
This abstract class represents a primitive of the visual representation of an
|
||||
electrical element. The Element, FixedElement and CustomElement classes do not
|
||||
embed its attributes and methods in order to remain lightweight; indeed, there
|
||||
is no point for those classes to store their visual representation with
|
||||
anything more complex than a QImage.
|
||||
@brief The CustomElementPart class
|
||||
This abstract class represents a primitive of
|
||||
the visual representation of an electrical element.
|
||||
The Element, FixedElement and CustomElement classes do not embed
|
||||
its attributes and methods in order to remain lightweight; indeed,
|
||||
there is no point for those classes to store their visual representation
|
||||
with anything more complex than a QImage.
|
||||
*/
|
||||
class CustomElementPart {
|
||||
// constructors, destructor
|
||||
public:
|
||||
/**
|
||||
@brief CustomElementPart
|
||||
Constructor
|
||||
@param editor Element editor this primitive is attached to
|
||||
*/
|
||||
CustomElementPart(QETElementEditor *editor) : element_editor(editor) {}
|
||||
/// Destructor
|
||||
/**
|
||||
@brief ~CustomElementPart
|
||||
Destructor
|
||||
*/
|
||||
virtual ~CustomElementPart() {}
|
||||
|
||||
private:
|
||||
@@ -78,13 +84,15 @@ class CustomElementPart {
|
||||
virtual bool isUseless() const = 0;
|
||||
virtual QRectF sceneGeometricRect() const = 0;
|
||||
/**
|
||||
Inform this part a user-induced transformation is about to begin. This method can be used to save data required by handleUserTransformation().
|
||||
Inform this part a user-induced transformation is about to begin.
|
||||
This method can be used to save data required by handleUserTransformation().
|
||||
*/
|
||||
virtual void startUserTransformation(const QRectF &) = 0;
|
||||
/**
|
||||
Make this part fit into the provided rectangle.
|
||||
*/
|
||||
virtual void handleUserTransformation(const QRectF &, const QRectF &) = 0;
|
||||
virtual void handleUserTransformation(const QRectF &,
|
||||
const QRectF &) = 0;
|
||||
/// @return a pointer to the parent element editor
|
||||
virtual QETElementEditor *elementEditor() const;
|
||||
/**
|
||||
@@ -106,6 +114,9 @@ class CustomElementPart {
|
||||
virtual QET::ScalingMethod preferredScalingMethod() const;
|
||||
|
||||
protected:
|
||||
QList<QPointF> mapPoints(const QRectF &, const QRectF &, const QList<QPointF> &);
|
||||
QList<QPointF> mapPoints(
|
||||
const QRectF &,
|
||||
const QRectF &,
|
||||
const QList<QPointF> &);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -133,12 +133,15 @@ void PartTerminal::setOrientation(Qet::Orientation ori)
|
||||
updateSecondPoint();
|
||||
emit orientationChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
@brief PartTerminal::setName
|
||||
@param name
|
||||
*/
|
||||
void PartTerminal::setName(QString& name)
|
||||
{
|
||||
if (d->m_name == name) return;
|
||||
d->m_name = name;
|
||||
emit nameChanged();
|
||||
if (d->m_name == name) return;
|
||||
d->m_name = name;
|
||||
emit nameChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user