Commit Graph

3426 Commits

Author SHA1 Message Date
joshua
a9632600b6 fix [diagram editor] : fix crash on search and replace widget
Qet crash when double click on an element/text/conductor in the tree
widget of the search and replace widget and the item is deleted from
diagram. (Call of Diagram::showme to a nullptr).
2025-12-01 12:23:22 +01:00
joshua
4e695de914 chore : Add message box for advise use hpdi round factor is unsafe
Add a message box to advise user that use a hdpi round factor can cause
strange render according to :
1 - the selected value
2 - the dpi of the screen
3 - Edit the project on another computer and/or screen who don't have
the same parameters as point 1 and 2.
2025-11-14 21:23:29 +01:00
joshua
3cf9095899 refactor[diagram editor] close bug.
Close bug report #324
https://qelectrotech.org/bugtracker/view.php?id=324

See commit #1b671990ee8435616725afdffba438fdfcd18069
2025-10-20 23:31:48 +02:00
joshua
3a1398d752 refactor[diagram editor]: remove unused include 2025-10-20 23:09:03 +02:00
joshua
67a7d277f4 refactor(diagram editor) : remove unused code 2025-10-20 23:02:52 +02:00
joshua
e26f7fdaaa refactor[deiagram editor]: mutualize code.
The features used to jump to linked element and xref now use the same
function.
2025-10-20 22:58:12 +02:00
joshua
f74fed9f3f refactor(diagram editor): remove unused checkbox
Remove the checkbox "export terminal in nomenclature" in the general
configuration page because it's a dead code.
2025-10-20 22:10:39 +02:00
plc-user
410c9293d1 adjust variable-names and comments; minor change in length-compare of conductor-segments 2025-10-19 15:48:03 +02:00
plc-user
07c34d7358 add and correct English comments 2025-10-19 15:37:07 +02:00
plc-user
6d7d1ea23b NamesList: Set empty string for name, when no name is set
This should fix an issue with empty fields in titleblocks.
2025-10-19 15:09:24 +02:00
Laurent Trinques
58339f9016 Fix copyright years 2025-10-17 09:58:39 +02:00
joshua
f83a5b3a79 Merge branch 'terminal_strip' 2025-10-15 23:30:54 +02:00
joshua
7e5d41b474 Terminal strip Xref is clickable
When user hover the Xref string of a terminal, the string color change
to blue to advise user the xref is clickable. Double click on the blue
Xref go the folio of the terminal and zoom the view to the terminal.
2025-10-14 22:12:38 +02:00
joshua
f0ec416a91 Terminal strip graphic item can display Xref of terminal 2025-10-03 21:49:21 +02:00
joshua
f6ba47277d Minor : revamp
Use QGIUtility::drawBoundingRectSelection for draw the selection rect
of element instead of a method of the element itself.
Less code.
2025-10-02 21:52:40 +02:00
Pascal Sander
84ac394d3b Refactor to more QRectF to be more compatible with QPrinter. #5 2025-08-30 12:08:54 +02:00
Pascal Sander
27b21b38aa Fixed incorrect cast from ElementCollectionItem to FileElementCollectionItem #4 2025-08-22 20:12:27 +02:00
Evilscrack
12b33e15a3 Merge branch 'qelectrotech:master' into master 2025-08-22 19:26:25 +02:00
achim
73ce3ae9fe Correct compositeText alignment on copying
After the commit 'Correcting dynamicElementTextItem alignment on
copying', not all composite text was displayed correctly. As soon as the
composite text contained multiple variables in a line or user text, the
alignment was no longer correct. Furthermore, the text value was not
correctly written to the clipboard, so it was no longer present when
pasting. I have corrected these errors here.
2025-08-19 20:16:31 +02:00
Laurent Trinques
6375136a50 Fix bughttps://qelectrotech.org/bugtracker/view.php?id=329
Modification of the int BACKUP_INTERVAL from 2 min to 20 min used by
KautoSaveFile.

On a large project with a 256 MB folio printed in A0 format, the
graphical interface freezes for 30 seconds when KautoSaveFile writes
this large amount of data to the disk every two minutes.

Even if the programme crashes, you only lose 20 minutes of your work,
which is not a big deal.

Thanks to Enzo for reporting it and finding the problem.
2025-08-18 14:04:27 +02:00
Pascal Sander
ee49086d03 QMenu must set a parent for correct position. #3 2025-08-17 17:48:29 +02:00
Pascal Sander
c31cab34e4 Check QAbstractItemModel for nullptr before access. #2 2025-08-17 10:33:04 +02:00
Evilscrack
a61d70e40e Merge branch 'qelectrotech:master' into master 2025-08-17 09:56:49 +02:00
Laurent Trinques
f43ce82052 Minor: m_autosave_sb QSpinbox set max 99 to 200 minutes
Change singlestep 1 to 10 enable accelerated function

See: https://qelectrotech.org/bugtracker/view.php?id=329
2025-08-17 08:47:19 +02:00
achim
29c362fe4c Better handling of conductors when moving
For conductors, the setPos() function can result in negative
coordinates.
For unknown reasons, this can lead to an offset in the scene coordinate
system, resulting in a free space above and to the left of the drawing
frame. This free space could not be removed.

It is better to set the conductors using the conductor::updatePath()
function. If the conductor text has been moved by the user, the new
position of the text must be calculated.
It is important to position the elements first and then 'connect' the
conductors.
Setting the conductor position via setPos() was done in elemntsmover.cpp
(corrected here) and in Diagram::fromXML (corrected in the commit
'Better handling of conductors when creating from XML').
2025-08-14 22:03:05 +02:00
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