Commit Graph

190 Commits

Author SHA1 Message Date
Zheng, Lei
3e68a27960 Minor code changes according to suggestions 2021-12-21 21:41:02 -07:00
Zheng, Lei
0877d20a60 Gui: expose 'Expression...' property editor menu action
For expression binding of all type of property. Previously this action
is only available if 'Show all' is activated.
2021-12-21 21:41:02 -07:00
Zheng, Lei
5229f5776f App: support CopyOnChange property in Link
New property status bit 'CopyOnChange' is added for any document object
to publish any property as a 'Configuration' option. When Link is
linked to any object with such property, it will duplicate those
properties and added it Link itself as dynamic properties. If the user
changes any of these dynamic properties, the Link will auto copy the
linked to object and apply the new configuration to it.

The Link has a new property 'LinkCopyOnChange' to allow user to
enable/disable this feature.

Spreadsheet's 'Configuration Table' feature will publish its
configuration property with 'CopyOnChange'.

Currently, once the linked object is copied, it will be independent with
the original object. There is no mechanism to auto sync changes back to
the copy.
2021-12-21 21:41:02 -07:00
Zheng, Lei
b65f24d61d Gui: fix property view linked property highlight 2021-12-21 21:41:02 -07:00
Zheng, Lei
50ab1c558b Gui: handle exception in property item display 2021-12-21 21:41:02 -07:00
Zheng, Lei
7e272d00f8 App/Gui: allow change dynamic property group and documentation
Exposed as PropertyContainerPy.setGroup/DocumentationOfProperty.

Added a menu action to property view for rename dynamic property group.
2021-11-14 20:45:09 -06:00
Zheng, Lei
26ba872aa6 App/Gui: improve expression binding of PropertyEnumeration
The enumeration items are exposed through sub path '.Enum'. When
'ShowAll' is enabled in property view, this sub path is exposed as a
sub property item named 'Enum', and can be either manually edited or
bound with an expression.
2021-11-14 20:45:09 -06:00
wmayer
8f08fea670 Gui: add class RotationHelper to reduce code duplication of PropertyRotationItem and PropertyPlacementItem 2021-10-29 15:59:55 +02:00
wmayer
2e5b29d180 Gui: implement editor for PropertyRotation 2021-10-29 12:41:03 +02:00
Yorik van Havre
24d1a3f054 Merge pull request #5023 from marioalexis84/gui-encoding
Gui:  Harmonize encoding/decoding between view, property editor and command line.
2021-10-14 12:24:49 +02:00
Zheng, Lei
2a62233641 Gui: handle exception in property item display 2021-10-12 14:49:15 -05:00
marioalexis
a4e56fbc87 Gui: Fix Unicode and UTF-8 encoding character behavior 2021-09-23 21:21:24 -03:00
Syres916
88aa1a796b [Gui] PropertyItem change Base Quantity Format 2021-08-12 10:52:25 +01:00
wmayer
7f66f3f4dc Gui: properly handle small quantities in property editor 2021-04-20 17:10:33 +02:00
Chris Hennes
48b4a9d7c9 Remove unneeded Qt version checks 2021-03-28 17:41:27 +02:00
Chris Hennes
be0d3e1157 Remove deprecated Qt constants
Qt has deprecated the following constants, this commit replaces them
with their new equivalent/replacement:

Qt::TextColorRole -> Qt::ForegroundRole
Qt::BackgroundColorRole -> Qt::BackgroundRole
QPainter::HighQualityAntialiasing -> QPainter::Antialiasing
QPalette::Foreground -> QPalette::WindowText
2021-03-28 17:03:09 +02:00
wmayer
a3c2190c35 Gui: [skip ci] handle number of decimals in PropertyUnitItem, PropertyVectorDistanceItem and PropertyPlacementItem 2021-03-27 18:31:49 +01:00
Benjamin Nauck
d69bbaa51b [Gui] Use std::shared_ptr instead of boost::shared_ptr
There's no need to use boost version when stl has support for shared_ptr
2021-03-06 19:32:03 +01:00
wmayer
dd4dd204d0 App/Gui: fix memory leaks:
+ add function to cleanup units and quantities in debug build
+ fix reference leak in PropertyVector::getPyPathValue()
+ fix reference leak in PropertyPlacement::getPyPathValue()
+ in InterpreterSingleton::init() use a static std::vector<wchar_t*> instead of a C array
  to free memory at program end
+ in MainWindow::closeEvent() explicitly delete all task watchers
+ in ReportOutputObserver constructor pass parent to QObject
+ in PropertyEditor destructor explicitly delete QItemEditorFactory
2021-02-27 10:56:19 +01:00
wmayer
88d49cd982 Gui: [skip ci] improve exception handling:
* handle all exceptions in Application::onLastWindowClosed because this method can be (indirectly)  called from ~BaseView and would otherwise trigger std::terminate()
* handle exceptions in PropertyEditor::closeTransaction() because when recomputing a document while closing it leaves the editor in a bad state
2021-02-25 12:23:13 +01:00
wmayer
a9bf90cd17 Gui: [skip ci] Fix coverity warning
Coverity warnings fixed:

CID 305123 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach the expression this->linked inside this statement: if (role == Qt::TextColorRole && linked)
2021-02-21 16:53:23 +01:00
wmayer
2aca60be85 Gui: [skip ci] fix crash on macOS in editor of vector list property 2021-02-18 21:43:53 +01:00
wmayer
ff85177c3f Gui: [skip ci] add possibility to auto-expand items in property editor 2021-02-08 18:53:07 +01:00
wmayer
fdd2e0e315 Gui: [skip ci] support undo/redo for view properties in editor 2021-02-08 13:22:14 +01:00
wmayer
23059c13d3 PyCXX: [skip ci] fix compiler warnings due to changes on PyCXX 2020-11-25 16:52:46 +01:00
Zheng, Lei
32f8c66e02 Gui: fix property editor transaction closing 2020-09-18 13:56:20 +02:00
Zheng, Lei
60e018e666 Gui: improve transaction handling in PropertyEditor 2020-09-04 16:01:21 +02:00
wmayer
45e0673645 LGTM: [skip ci] fix: Declaration hides parameter
A local variable hides a parameter. This may be confusing. Consider renaming one of them.
2020-07-27 10:57:34 +02:00
wmayer
380a448dd1 PVS: V560 A part of conditional expression is always true 2020-07-18 10:59:28 +02:00
wmayer
aad54a2a78 Gui: [skip ci] improve usability of VectorListEditor 2020-06-29 21:29:12 +02:00
wmayer
43ad5ea95b Gui: [skip ci] fix -Wrange-loop-construct 2020-06-22 22:50:55 +02:00
wmayer
ec134598cd Gui: implement property editor for vector list 2020-06-22 22:28:15 +02:00
wmayer
e2e4ecf36c Gui: [skip ci] fix regression by using UTF-8 encoding in PropertyItem::setPropertyValue 2020-04-03 16:22:35 +02:00
wmayer
ff9029938f [skip ci] improve whitespaces 2020-04-03 16:19:24 +02:00
wmayer
26dfcfea8c Gui: [skip ci] bind spin boxes to object in Placement dialog 2020-03-27 17:08:08 +01:00
wmayer
e14e5b845e [skip ci] use QLocale class consistently to make it possible to change it application-wide 2020-03-26 16:37:45 +01:00
Zheng, Lei
4566fb8538 Gui: fix property editor crash on remove dynamic property
The crash happens when the dynamic property is removed due changes of
the very same property.
2020-03-21 15:43:12 +01:00
Zheng, Lei
12690fb566 Gui: refactor link property editor
PropertyLinkItem now support all major types of link property.
PropertyLinkListItem is no longer necessary, but kept for backward
compatible, which is now identical to PropertyLinkItem.

DlgPropertyLink, the link selection dialog, is now made modeless, so
that that user can select geometry sub-element directory from 3D view.
2020-02-11 15:40:27 -05:00
Zheng, Lei
3798aa15c6 Gui: fix missing property editor transaction closing
The problem happens when refreshing property editor while editing.
2020-02-11 15:40:27 -05:00
wmayer
b00f8b0226 Gui: allow user to set an expression for property editor of vectors 2019-12-28 17:36:41 +01:00
Zheng, Lei
e3a6556878 App: fix PropertyXLink file path saving
Also modified ProeprtyLinkItem to show file path as tooltip.
2019-11-10 11:32:59 +01:00
Zheng, Lei
10e2681ab5 Gui: force dynamic property item background and text color
To avoid visual problem under dark theme.
2019-11-09 16:17:19 +01:00
Zheng, Lei
ae067d7a58 Gui: improve PropertyXLink display in property view 2019-10-08 10:21:31 +02:00
Tomas Pavlicek
d54633183c TechDraw - Fix Annotation and Symbol international characters mangling 2019-10-07 16:56:09 -04:00
Zheng, Lei
d68de72578 Gui: sync expression change in property editor
This patch fixes two problems,

When one property item is assigned an expression, auto remove any parent
and child item expressions to avoid expression conflicts.

Disable value update when an property item or any of its parents are
bound by an expression.
2019-10-07 17:24:31 +02:00
Zheng, Lei
1ff5c2f720 Gui: fix missing expression highlight in property editor 2019-10-07 17:24:31 +02:00
Zheng, Lei
0e6ad2056b Gui: fix missing auto update when edit property expression
It only happens when editing expression through property editor context
menu action.
2019-10-07 17:24:31 +02:00
wandererfan
375fe1bd48 [App][Gui]Add Filter for PropertyFile in PropertyEditor 2019-09-20 07:56:52 -04:00
wandererfan
b9374d5e71 [Gui]Fix Py SyntaxError on " in PropertyStringList 2019-09-19 06:59:05 -04:00
wmayer
9fa56345cf core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00