Commit Graph

3451 Commits

Author SHA1 Message Date
Pascal Sander dad637689d QScopedPointer removes QDrag to early and will still be accessed in another thread. #1 2025-08-13 20:01:22 +02:00
plc-user 0f179a5d49 add and correct English comments 2025-08-09 09:05:34 +02:00
plc-user 3a0546e638 add English comments / translate variable-names to English 2025-08-08 12:46:11 +02:00
achim 96d84bf852 Better handling of conductors when creating from XML
The position of a conductor is determined by the two terminals the
conductor connects. Therefore, it makes no sense to set the position
with 'setPos()'.

It is better to first load all elements (but not the conductors),
position them if necessary, and only then load the conductors and assign
them to the elements (terminals).
2025-08-03 01:04:37 +02:00
achim 0a6efa466e Correcting dynamicElementTextItem alignment on copying
When copying and pasting selected areas, right-aligned dynamic text in
report and slave elements was not displayed correctly. The text
insertion point was always shifted to the left by the text width.

To correct this, the insertion point of dynamicElementTextItems is reset
to its origin insertion point before writing to clipboard.
2025-08-02 23:27:09 +02:00
achim f20ea041b6 correcting the visibility of Variables in CompositeText
When using composite text in report elements, the name of the variable
was displayed when inserting the reportElement into the drawing (e.g.
%{function}). This is corrected here.
Add missing variables to assignvariables.cpp
2025-08-02 22:16:12 +02:00
joshua 74b55f3bf5 Disable deletion if a terminal can't be deleted.
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.
2025-07-24 22:24:15 +02:00
joshua 1607c7f5dc Minor : improve behavior when rotate terminal part.
iIn the element editor, every rotation is made around the center of the
scene, this is usefull when rotate several part but less when only one
need to be rotated, especially when it is the terminal part and we only
want to change the orientation.
This commit solve it. Now when only a terminal part is selected, the
terminal don't rotate around the center of the scene but change the
orientation.

The rotation, flip and mirror of parts are good features but always
rotate around the center of the scene and if the parts are far from the
center of the scene the behavior look inappropriate from the POV of user
(because parts move far from original position and can out of the view).
A good new features should be to solve it (rotate around the center of
the bounding rect of the selection) and probably extract the function
rotate/flip/mirror from the parts class and create a new class with for
only goal to calculate and apply these modifiaction trough an undo
command.
2025-07-15 22:47:33 +02:00
plc-user 07c6ac6c9f correct some English comments 2025-07-09 15:23:01 +02:00
joshua a121fbe530 Add undo / redo command
The undo/redo command of diagram editor is
shared to the terminal strip editor.
2025-07-01 23:37:16 +02:00
joshua a2ae8255ac Minor fix
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.
2025-07-01 22:46:18 +02:00
joshua d711d8fb4a Terminal strip editor can now edit multiple 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.
2025-06-11 22:43:41 +02:00
joshua 3a6b4807db Fix crash.
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.
2025-06-09 21:35:00 +02:00
joshua d699faf501 Change some int to qreal
Made this change to be more compliant with svg
2025-06-08 21:40:32 +02:00
joshua 95e401a266 Class TerminalStripLayoutPattern can be save/load from xml
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.
2025-06-05 23:04:56 +02:00
plc-user 1868f91ff8 use symbolic links to collect all licenses in one directory and adjust sourcecode 2025-06-01 11:01:32 +02:00
plc-user 5ba984be56 add copyright-sign to about-dialog 2025-05-30 10:49:32 +02:00
plc-user 1b671990ee prevent crash, when adding text to element in diagram-editor 2025-05-30 09:42:22 +02:00
plc-user ce18bd1666 use "%" for string-concatenation (less memory-usage) 2025-05-30 09:40:11 +02:00
plc-user e371fe9845 add font-links to about-dialog – tab "libraries" 2025-05-22 22:35:09 +02:00
plc-user ad29893842 use "%" for string-concatenation
Qt-Docs says it's less memory-usage...
2025-05-22 21:33:32 +02:00
plc-user c7ed744481 Include some fonts to QElectroTech
- include Liberation-Fonts and osifont
  (thanks elevatormind!)
- use "Liberation Sans" as default-font
- adjust License-Tab in About-Form
- Bugfix: When selecting a font, the current
  font is highlighted in dialog
- adjust some whitespace and English comments
2025-05-18 14:15:20 +02:00
plc-user d007035237 whitespace and comment 2025-03-28 20:21:09 +01:00
plc-user c1559d2a99 Fix signal for KColorButton 2025-03-28 20:16:37 +01:00
plc-user 936a27500c BugFix: Font for titleblock was hardcoded to Sans Serif
Because of a typo it was never read from settings.
2025-03-23 07:25:37 +01:00
plc-user 757df90951 minor: added some English comments 2025-03-13 21:05:21 +01:00
plc-user eeb453f120 only calculate grid-point-size, when min != max 2025-03-13 20:46:04 +01:00
Laurent Trinques 6afd9fe48d Merge pull request #386 from elevatormind/master
Mouse hover text for dynamic text items
2025-03-13 11:07:40 +01:00
joshua 2c1b840f9c Use same properties for every terminal level
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.
2025-03-12 21:48:18 +01:00
Magnus Hellströmer c9304892e0 Mouse hover text for dynamic text items
- Added text for dynamic text item to indicate that shift needs to be held down to move the text.
2025-03-12 21:16:25 +01:00
joshua 2d89d70682 Add possibility to adjust terminal text position
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.
2025-03-12 21:10:16 +01:00
joshua 7747223dfa Terminal strip item font is editable
The font used in the terminal strip item can be edited
trough the terminal strip layout editor widget
2025-03-12 19:22:30 +01:00
joshua ae5e188866 Add converter for dpi to pixel font size
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.
2025-03-12 19:14:45 +01:00
plc-user 0084dcf289 fix typo with function-name 2025-03-07 20:53:07 +01:00
plc-user 0804d3524a improvement: ajust size of grid-dots with zoom-factor
Introduced additional spinboxes in config-page for
setting min- and max-size of grid-dots separately for
diagram- and element-editor.
That assures maximal flexibility for setting the grids.
Don't want the grid-dots to change over zooming-levels?
Set min- and max-values to the same number.
Preset-values for all min-/max-values is "1".
If the adjustable range of 1 to 5 is not sufficient, it
can be easily adjusted. Only need feedback for this.
2025-03-07 20:16:21 +01:00
plc-user 2b0dd1b188 comments and whitespace 2025-03-07 18:13:53 +01:00
plc-user 27cff81ee7 adjust zoom-factor to use cosmetic-line and fixed comments 2025-03-07 10:58:47 +01:00
plc-user 45afd9af0e element-editor: fix jumping positions when rotate, mirror or flip 2025-03-07 07:43:20 +01:00
plc-user 9044d532ac corrected English comments 2025-03-06 08:07:49 +01:00
plc-user 50efc318e0 change to run code with Qt5 & Qt6 as described in forum 2025-03-06 08:06:36 +01:00
plc-user e4d2dbd2a6 a minor change is enough to run code in Qt5 & Qt6 - no need to differentiate anymore 2025-03-05 15:24:07 +01:00
plc-user ddf40854dc fix comment 2025-03-05 11:54:58 +01:00
plc-user ef0fa6e7ac same change for polygons as for other primitives to support Qt5 & Qt6 2025-03-05 09:49:16 +01:00
plc-user 237c21bad8 use same code for Qt5 & Qt6 for XRef-list 2025-03-05 07:05:12 +01:00
plc-user 260ce2a8bc unify NamesList "imported elements" to be used with Qt5 & Qt6; still need to decide whether to use list of QChars or written text in utf-8; kept both variants for now... 2025-03-05 07:03:38 +01:00
plc-user 6199367166 remove unused NamesList from qetproject.* 2025-03-05 06:59:09 +01:00
plc-user d073e810b8 set default-value for QFont::Weight to prevent warning at runtime 2025-03-05 06:55:14 +01:00
plc-user 6c52d95201 same simplifications as in #376 "use the same code for Qt5 & Qt6" 2025-03-03 22:41:44 +01:00
plc-user 4009e6aaab simplify and use the same code for Qt5 & Qt6
When reading and comparing Qt5-docs and Qt6-docs, I read,
that there are no differences in the functions!
So it is not necessary to have the differentiation
between the Qt-Versions.
Code compiles without errors or warnings for Qt5 and Qt6.
2025-03-02 18:56:34 +01:00
plc-user 513927424f bordertitleblock: use same code for Qt5 & Qt6 for "numbering" rows 2025-03-02 08:48:19 +01:00