Commit Graph

45 Commits

Author SHA1 Message Date
0penBrain
fdeac88239 [Bugfix]Gui: allow set up expression even if property value is currently being edited 2022-09-11 22:01:26 +02:00
berniev
2db561561e Gui: use empty 2022-08-06 16:35:45 +02:00
wmayer
85bd6b5c6b Fix several clazy issues:
* C++11 range-loop might detach Qt container [-Wclazy-range-loop-detach]
2022-07-24 23:48:37 +02:00
wmayer
1178df06b4 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
99191c6679 [Gui] So headers: remove unused includes
- also sort out some headers to be used in precompiled headers
- also move a boost header to precompiled headers
2022-03-16 02:01:32 +01:00
Uwe
75ab31a357 [Gui] PropertyEditor: remove unused includes 2022-03-03 03:59:48 +01:00
wmayer
ae2331b316 Gui: fix warning -Wunused-parameter
The function PropertyEditor::recomputeDocument() accepts a pointer to App::Document that is passed by the calling instance closeTransaction().
Since this is the active document there is no need for PropertyEditor::recomputeDocument() to ignore the argument and determine the active document again.
2022-02-21 15:41:28 +01:00
Zheng Lei
f12ae8a13c Gui: improve PropertyEditor refresh (#3535)
* Gui: fix PropertyView 'Add property' action

* Gui: fix property view font color for linked property

* Gui: improve PropertyEditor refresh

* Gui: show real property name in property view tool tip

* Gui: improve property view tool tip

* Gui: fix auto recompute in property view

* Gui: remove duplicated PropertyModel signal of dataChanged()

* Gui: fix property view update on property change
Including changes in document properties

* Gui: fix transaction closing on property editor change
On editing row removal and on model reset.

* Gui: fix property view auto expansion of previous selected item

* Gui: improve property editor navigation using tab/shift+tab
2022-02-21 12:26:21 +01:00
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
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
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
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
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
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
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
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
Zheng, Lei
f1b569621a Split App::AutoTransaction into its own file 2019-09-10 14:17:07 +02:00
Zheng, Lei
6d770d85dc Gui: fix property view flickering 2019-09-10 14:17:07 +02:00
Zheng, Lei
27a2ebed71 Gui: fix property editor crash on recompute
The actual cause of crash in previous commit 80f70ff6 is
Document::recompute() allows aborting using Base::Sequence, which
uses QApplication::processEvent() to catch 'ESC' key press. This local
event loop causes premature deletion of the editor widget.

This patch moves handling of closeEditor before calling recompute().
2019-08-30 14:25:41 +02:00
Zheng, Lei
6aec9ffed7 Gui: try to fix property editor crash
Crash stack trace
https://forum.freecadweb.org/viewtopic.php?f=8&t=37757&e=1&view=unread#p327901

It appears to by caused by handling QAbstractItemDelegate::closeEditor
signal twice. Once inside PropertyItemDelegate::editorClosed via slot
connection where the editor is closed/destroyed, the other in
PropertyEditor::closeEditor() which tries to access the destroyed
editor.

This patch removes handling of closeEditor signal in
PropertyItemDelegate.
2019-08-30 13:55:24 +02:00
Zheng, Lei
951d872831 PropertyEditor: fix bug when constructing context menu 2019-08-17 15:32:48 +02:00
Zheng, Lei
8b3ef8faf5 Gui: property view related changes
* Display property from linked object, colored green,

* Change DlgPropertyLink to support external linking and sub-object
  selection

* Improve large selection performance by using a timer

* Improve TAB key behavior in property editor

* Add context menu to show hidden properties, change property status,
  set expression on any and property, and add/remove dynamic properties

* Optimize expression completer model construction, as the original
  implementation gets prohibitively slow for moderate number of objects.
2019-08-17 15:08:33 +02:00
wmayer
93c5c76a60 add some comments 2019-03-04 19:25:43 +01:00
wmayer
065f7a644b fix navigation with Tab or Shift+Tab in property editor 2019-03-04 19:15:53 +01:00
wmayer
86b4272971 fixes 0003794: Shortcut-Key is executed in edit field of a constraint (Combo View) 2019-02-16 21:53:23 +01:00
wmayer
06fa64a00d add method to check if an open transaction is empty
This is needed to avoid to incorrectly abort a transaction if a recompute was done between opening and closing an editor in the property view
2018-11-10 14:50:58 +01:00
wmayer
a9e9bc21e4 fixes 0003341: Undoing is missing steps 2018-10-13 12:21:17 +02:00
wmayer
8f3c135a5c minor fixes:
make QtCreator happy by removing const & when connecting signal/slots
fix typo in comment
2018-09-11 15:50:27 +02:00
Zheng, Lei
652e9314bd PropertyEditor: improve editing experience 2018-09-11 14:51:03 +02:00
Travers Carter
7f43851536 Span property group headers across all cells to avoid text truncation
Render the background of property value editor widgets to avoid cell contents showing through the editor
2017-11-26 10:23:03 +01:00
wmayer
c82811fd79 + add properties with 'hidden' mode to property editor but hide the item 2016-03-05 18:24:58 +01:00
wmayer
c15da7f463 + dynamically hide/show and enable/disable item in property editor 2016-03-05 13:13:23 +01:00
wmayer
4db1e6b0a0 + make PropertyEditor class ready to be customized with Qt style sheet 2016-02-20 16:00:35 +01:00
wmayer
ba053abec9 + support of adding/removing dynamic properties in property editor 2015-11-16 22:47:29 +01:00
wmayer
0ec8dd48b1 + property editor handles case when dynamic property is removed 2015-11-16 15:24:36 +01:00
wmayer
8d31ccea89 + do not update item while editor is active 2015-09-15 00:30:28 +02:00
wmayer
f83707d73e + fixes #0002197: Buggy Placement dialog when using Euler angles 2015-09-13 15:17:44 +02:00
wmayer
8e502bc3c2 + fixes #0001484: Do not sort properties in alphabetical order 2014-03-21 15:04:35 +01:00
wmayer
a9f5c120e8 Save position of last edited property item and restore it when selection changes 2013-05-08 15:07:46 +02:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00