Commit Graph

44 Commits

Author SHA1 Message Date
berniev
d88729d2c4 Gui: use empty 2022-08-06 16:35:45 +02:00
wmayer
6ee2c7f865 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
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
c4f5628899 [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
57fe294c3e [Gui] PropertyEditor: remove unused includes 2022-03-03 03:59:48 +01:00
wmayer
a8d17ae270 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
b42462ba14 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
ccf10b8867 Minor code changes according to suggestions 2021-12-21 21:41:02 -07:00
Zheng, Lei
a9895e4f04 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
4f29e81d0c 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
8cf3cf330b 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
df0f979f3b 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
5b864424db 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
5e00309368 Gui: [skip ci] add possibility to auto-expand items in property editor 2021-02-08 18:53:07 +01:00
wmayer
91435c96f7 Gui: [skip ci] support undo/redo for view properties in editor 2021-02-08 13:22:14 +01:00
Zheng, Lei
e8f5c66435 Gui: fix property editor transaction closing 2020-09-18 13:56:20 +02:00
Zheng, Lei
685fc401a8 Gui: improve transaction handling in PropertyEditor 2020-09-04 16:01:21 +02:00
Zheng, Lei
24d935096d 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
da19c8489a 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
b50b21576e 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
fd0f4f5654 Split App::AutoTransaction into its own file 2019-09-10 14:17:07 +02:00
Zheng, Lei
69d124a93c Gui: fix property view flickering 2019-09-10 14:17:07 +02:00
Zheng, Lei
ddb17b23b0 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
378314aafb 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
088c282e2e PropertyEditor: fix bug when constructing context menu 2019-08-17 15:32:48 +02:00
Zheng, Lei
2bd4795e80 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
16a84b9605 add some comments 2019-03-04 19:25:43 +01:00
wmayer
f24bed170a fix navigation with Tab or Shift+Tab in property editor 2019-03-04 19:15:53 +01:00
wmayer
5f4deea7c9 fixes 0003794: Shortcut-Key is executed in edit field of a constraint (Combo View) 2019-02-16 21:53:23 +01:00
wmayer
442e2dd381 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
571f75204a fixes 0003341: Undoing is missing steps 2018-10-13 12:21:17 +02:00
wmayer
aae8062f15 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
3a81bd5103 PropertyEditor: improve editing experience 2018-09-11 14:51:03 +02:00
Travers Carter
c71b579f97 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
0ec81d2760 + add properties with 'hidden' mode to property editor but hide the item 2016-03-05 18:24:58 +01:00
wmayer
948ccac021 + dynamically hide/show and enable/disable item in property editor 2016-03-05 13:13:23 +01:00
wmayer
60e0c447ca + make PropertyEditor class ready to be customized with Qt style sheet 2016-02-20 16:00:35 +01:00
wmayer
1225a7ac06 + support of adding/removing dynamic properties in property editor 2015-11-16 22:47:29 +01:00
wmayer
ba21766096 + property editor handles case when dynamic property is removed 2015-11-16 15:24:36 +01:00
wmayer
29f827a575 + do not update item while editor is active 2015-09-15 00:30:28 +02:00
wmayer
043dc1616d + fixes #0002197: Buggy Placement dialog when using Euler angles 2015-09-13 15:17:44 +02:00
wmayer
2bfb120ff7 + fixes #0001484: Do not sort properties in alphabetical order 2014-03-21 15:04:35 +01:00
wmayer
fa3bbd093a 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