In case of user try to delete a terminal element who is bridged
or belong to a physical terminal with more than one level, the deletion
is aborted to avoid mistake in the terminal strip parent of the terminal
element. A dialog is opened when the deletion can't be to explain to
user what to do for enable the deletion.
During the development, we saved some terminal strip with "phantom"
terminal (terminal added to the strip and after the terminal was removed
from the project but keep in the terminal strip data) and this mistake
was saved in the xml. When we open this project the phantom terminal
don't appear in the layout but the empty physical terminal is still here
in the terminal strip data because the position of the terminals in the
strip is wrong (sometime bigger than the size of the strip, sometime
with a gap, sometime don't start at 0). This commit fix this mistake
when we open a project.
Before this this commit the terminal strip editor couldn't only work on
the first project opened into this editor, all other project opened
after couldn't be edited.
This is now past, terminal strip editor can now edit every project open
in QElectroTech.
Fix crash when :
1°-Open a project with terminal strip and open the terminal strip editor
2°-Close the terminal strip editor and the project (keep qelectrotech
open).
3°-redo step 1 and click on an item in the tree at left of the window,
qet crash.
Qet don't crash anymore but the terminal strip editor continue to work
with the terminal strip of the first opening (exactly the pointer of the
terminal strip) who don't exist anymore. Need more work.
Add a new class TerminalStripLayoutPatternXml used to
save / load a TerminalStripLayoutPattern class into a xml.
Also create the namespace QETSVG used to read/write some
svg element / attribute to xml. This class is used by the
class TerminalStripLayoutPatternXml.
Initially it was planned to have separate text configuration for every
terminal level. It's not useful, use same properties for every level is
sufficient and visually more consistent.
By consequent every QVector related to these properties was replaced by
a single value.
The bounding rectangle used to define the position of the terminal text
can be edited. The y position and height can now be edited. The width is
not editable because is always the width of the rectangle of the of the
terminal.
Add a little function used to convert if needed the size of a font set
in dpi to pixel. Because the conversion from pdi to pixel can't
be exactly identical, the text size in the diagram can be a little
different, in the other side the switch between screens with different
dpi is no more a problem.
TerminalStripLayoutPattern class is now a shared pointer between all
terminal strip item.
QETProject have now a new class : ProjectPropertiesHandler
the goal of this class is to manage every kind of properties used in the
project, this class will be strongly used in future.
* terminal_strip:
Terminal strip item can saved / loaded to .qet file
See previous commit...
Move terminal strip drawer class in is own file
Fix wrong use of QStringLiteral and QLatin1String
Double click a TerminalStripItem open the editor
Minor change about checkable QAction of QetDiagramEditor
Minor : corrects a minor aesthetic defect when unbridge terminals
Revamp code
Add and move terminal strip item are now managed by undo command
TerminalStripItem : Draw terminal bridge
Terminal strip item can be added to diagram
Minor : add QGIUtility namespace