Commit Graph

109 Commits

Author SHA1 Message Date
Shane Ringrose df5f622418 Fix TerminalData memory leak in Terminal destructor
Terminal stores its TerminalData* as member d but never deletes it.
Every Element creation (placing on diagram, loading icon for the
element browser, drag previews) leaks one TerminalData per terminal.
ASan confirmed 112 leaked objects (9856 bytes) in a short session
across four call sites all rooted in Element::parseTerminal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 00:38:07 +12:00
Kellermorph 19704cf5ca Potential Isolation option for terminals 2026-05-27 21:20:50 +02:00
Laurent Trinques dbda958261 terminaldata: add No, Nc, Common types for SW contacts
Extend TerminalData::Type enum with three new semantic values:
- No     : Normally Open terminal of a switch (SW) contact
- Nc     : Normally Closed terminal of a switch (SW) contact
- Common : Common terminal of a switch (SW) contact

Update typeToString() and typeFromString() accordingly.
Fully backward compatible: existing Generic/Inner/Outer types
are unchanged. Elements without typed terminals fall back
to the previous behavior (first 2 named terminals).

terminal: expose terminalType() as public accessor

Add Terminal::terminalType() returning the TerminalData::Type
of this terminal. This allows crossrefitem and other consumers
to filter terminals by semantic role (No, Nc, Common) without
accessing TerminalData internals directly.

terminaleditor: add No, Nc, Common entries to type combobox

Expose the three new TerminalData types (No, Nc, Common) in
the element editor UI so users can assign a semantic role to
each terminal of a SW contact element.

Also fix a pre-existing bug in updateForm() where m_type_cb
was incorrectly using m_orientation_cb->findData() instead
of m_type_cb->findData(), preventing the type from being
restored correctly when selecting a terminal.

terminaleditor: add No, Nc, Common entries to type combobox

Expose the three new TerminalData types (No, Nc, Common) in
the element editor UI so users can assign a semantic role to
each terminal of a SW contact element.

Also fix a pre-existing bug in updateForm() where m_type_cb
was incorrectly using m_orientation_cb->findData() instead
of m_type_cb->findData(), preventing the type from being
restored correctly when selecting a terminal.
2026-05-23 02:09:32 +02:00
Laurent Trinques 4044d04cc5 One year
Auto-build doxygen docs / doxygen (push) Has been cancelled
Auto-build doxygen docs / deploy (push) Has been cancelled
2026-01-16 15:24:35 +01:00
plc-user 757df90951 minor: added some English comments 2025-03-13 21:05:21 +01:00
plc-user 2b0dd1b188 comments and whitespace 2025-03-07 18:13:53 +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 e0b26592c7 fix typos 2025-02-28 20:36:38 +01:00
plc-user 181680e6f1 add English comments 2025-02-22 09:20:46 +01:00
Laurent Trinques 43f0107eb1 Revert "Try Clazy fix-its"
Segfault on old Qt versions!
This reverts commit dba7caed30.
2025-02-14 16:17:58 +01:00
Laurent Trinques dba7caed30 Try Clazy fix-its
clazy is a compiler plugin which allows clang to understand Qt
semantics. You get more than 50 Qt related compiler warnings, ranging
from unneeded memory allocations to misusage of API, including fix-its
for automatic refactoring.

https://invent.kde.org/sdk/clazy
2025-02-14 15:52:23 +01:00
plc-user 516eb9eb45 fixed English comments 2025-02-12 14:02:30 +01:00
plc-user 940ae0c34a formatting / whitespace - unify declarations 2025-01-26 14:29:52 +01:00
Laurent Trinques 77bfe84a4c One year 2025-01-04 13:37:40 +01:00
plc-user f9073ca5fb add terminal-names to connection in qet-file 2024-06-16 15:53:09 +02:00
Laurent Trinques e73cf633ce 2023->2024 2024-03-29 10:09:48 +01:00
Laurent Trinques 9afef79629 Update Copyright date 2023-01-01 17:05:57 +01:00
joshua 11b8ef927b Revert "Merge branch 'XMLPropertiesNew'"
**Break a lot of thing.**

This reverts commit 1db1800572, reversing
changes made to 4c563821e8.
2021-03-11 19:52:50 +01:00
Martin Marmsoler 5d3710c4b2 copy all toXML() from master commit 4b82c3a0c4 into the current branch, because the new concept will be used only for user properties 2021-03-07 10:09:45 +01:00
Martin Marmsoler 058824f29a move all static xml functions to qetxml 2021-03-06 20:01:31 +01:00
Martin Marmsoler 9d4b90da1a Add userProperties 2021-03-04 19:18:28 +01:00
Martin 02b7ead041 fix compile issues 2021-02-24 18:48:59 +01:00
Martin ea364f9c4e merge 2021-02-23 17:35:55 +01:00
joshua a00404bc9f clean terminal and terminaldata class 2021-02-21 19:40:32 +01:00
joshua e2ebb445a8 Terminal : remove unused code 2021-02-21 19:40:32 +01:00
Laurent Trinques ef58f34c14 Update Copyright date 2021-02-20 12:13:46 +01:00
joshua 0c4f87bd76 Replace AddItemCommand class by AddGraphicsObjectCommand
The class is the same except the name and the use of QPointer to avoid
segfault with deleted QGraphicsObject.
2021-02-07 16:20:55 +01:00
joshua 2513961cd6 Revert "Update Copyright date"
This reverts commit d04bccc384.
2021-02-06 19:00:48 +01:00
Laurent Trinques d04bccc384 Update Copyright date 2021-02-06 18:33:42 +01:00
Simon De Backer d15443cf93 Wip Fix preprocessor on Cmake 2020-12-10 18:49:35 +01:00
Simon De Backer 10c4c3d528 Wip Fix preprocessor on Cmake 2020-12-08 19:57:35 +01:00
Martin Marmsoler 9658a88c18 fix compile issues 2020-10-20 08:54:56 +02:00
Martin Marmsoler 12e301b887 replace 4 spaces by a tab 2020-10-20 08:54:56 +02:00
Martin Marmsoler f3097fc537 rebase XMLProperties_New (c0d9bf9) to master 2020-10-20 08:54:14 +02:00
Martin Marmsoler 73b394527d replace tabs by 4 spaces 2020-10-20 08:53:43 +02:00
Simon De Backer c1e93fc442 QT6: QStyleOptionGraphicsItem 2020-10-03 15:48:40 +02:00
Simon De Backer 36dbe65457 Add TODO compile var + Fix doxygen issue
You can make your code warn on compile time for the TODO's
In order to do so, uncomment the following line. in pro file
DEFINES += TODO_LIST
2020-09-24 17:01:33 +02:00
Simon De Backer 5d92393ee7 Wrap code for better readability 2020-09-07 22:03:40 +02:00
Simon De Backer 666f20856e Fix some doxygen issues 2020-08-19 21:26:36 +02:00
Simon De Backer 566747eb2b Improve code style, Wrap code for better readability 2020-08-18 21:29:12 +02:00
Simon De Backer 8e956df8d8 Fix some doxygen issues 2020-08-18 21:28:52 +02:00
Simon De Backer d4ee161c07 Mod doc set style de same 2020-08-16 11:19:36 +02:00
Simon De Backer 7834d6fb84 Mod doc, Improve code style 2020-08-08 23:58:17 +02:00
Simon De Backer 2a53f09a37 Translate documentation + Fix indentation 2020-08-02 12:09:08 +02:00
Simon De Backer d7e1d326a2 Wrap code for better readability + Mod doc 2020-07-15 18:34:42 +02:00
Simon De Backer 2cdfce18ec Mod doc to set style de same + Fix indentation code 2020-07-15 18:31:04 +02:00
Simon De Backer 251dfdf37a add documentation 2020-07-15 18:29:04 +02:00
Laurent Trinques e10ae8ce2e Update Copyright date 2020-06-15 17:42:53 +02:00
Martin Marmsoler 81992bc777 remove inline, because it creates compile issues in release mode. see #48 2020-06-14 13:29:26 +02:00
Martin Marmsoler af989b1cd8 Use uuid instead of an index to connect multiple elements 2020-06-14 13:29:25 +02:00