Commit Graph

159 Commits

Author SHA1 Message Date
Zheng, Lei
85d3abeb8b Gui: put private class to anonymous namespace 2022-04-04 04:53:52 +02:00
Zheng, Lei
03976ff333 Code change according to suggestion 2022-04-04 04:53:52 +02:00
Zheng, Lei
801ece560e Gui: fix property enumeration editor initialization 2022-04-04 04:53:52 +02:00
Zheng, Lei
1433ff166d Gui: support auto grouping editing for PropertyEnumeration
The PropertyEnumeration editor (PropertyEnumItem) will check for
separator characeter '|' in enumeration items to auto create
hierarchical groups of items using sub-menus for user to select.
2022-04-04 04:53:52 +02:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
wmayer
2dc78804b6 Core: Fix several coverity issues:
* CID 350582: Big parameter passed by value
* CID 350639: Big parameter passed by value
* CID 305234: Uncaught exception
* CID 316529: Uncaught exception
* CID 350597: Uncaught exception
* CID 350623: Uncaught exception
* CID 332690: Uncaught exception
* CID 332700: Unchecked return value
* CID 350576: Uninitialized scalar field
* CID 350587: Uninitialized scalar variable
* CID 192606: Uninitialized scalar field
* CID 332699: Uninitialized pointer field
* CID 350561: Dereference null return value
* CID 350610: Dereference null return value
* CID 350567: Dereference after null check
2022-03-13 13:53:32 +01:00
Zheng, Lei
c5a0db5e47 Gui: fix crash on editing PropertyVectorList in property view 2022-03-10 15:31:45 +01:00
wmayer
4ae1ca58d1 App: use forward declaration to reduce compile time 2022-03-04 17:27:53 +01:00
Uwe
57fe294c3e [Gui] PropertyEditor: remove unused includes 2022-03-03 03:59:48 +01:00
wmayer
de56e1b6d8 Gui: cleanup of PR #5516
* instead of breaking encapsulation of PropertyItem apply the attorney idiom
* refactoring of PropertyItemDelegate::createEditor by moving the code to PropertyItem::createPropertyEditorWidget
2022-03-01 17:19:12 +01:00
wmayer
9955c64752 Mod: add string header to dxf.h 2022-03-01 17:18:29 +01:00
Noah
d0b0756cbf Gui: fix use of deprecated Qt::TextColorRole
Qt::TextColorRole (enum ItemDataRole) is deprecated as of Qt 5.13 and will be removed in Qt 6:

- https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/global/qnamespace.h?h=v5.13.0#n1511

It's replaced with `Qt::ForegroundRole` which is available since at least Qt 5.0 (FreeCAD 0.20 will require Qt 5.9 or later).

- https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/global/qnamespace.h?h=v5.0.0#n1374
- https://wiki.freecadweb.org/0.20_Development_Cycle
2022-02-23 17:53:33 +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
Mateusz Skowroński
2f7b919671 Qt::TextColorRole is obsolete. Use ForegroundRole instead. 2022-01-27 14:37:50 -06:00
Zheng, Lei
ccf10b8867 Minor code changes according to suggestions 2021-12-21 21:41:02 -07:00
Zheng, Lei
1f604ec632 Gui: fix property view linked property highlight 2021-12-21 21:41:02 -07:00
Zheng, Lei
b76509bfea Gui: handle exception in property item display 2021-12-21 21:41:02 -07:00
Zheng, Lei
72ae26dfee 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
7a35afdd8e Gui: add class RotationHelper to reduce code duplication of PropertyRotationItem and PropertyPlacementItem 2021-10-29 15:59:55 +02:00
wmayer
61de191771 Gui: implement editor for PropertyRotation 2021-10-29 12:41:03 +02:00
Yorik van Havre
f3ccc6d660 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
51d814d222 Gui: handle exception in property item display 2021-10-12 14:49:15 -05:00
marioalexis
6d51083240 Gui: Fix Unicode and UTF-8 encoding character behavior 2021-09-23 21:21:24 -03:00
Syres916
dddf76b47f [Gui] PropertyItem change Base Quantity Format 2021-08-12 10:52:25 +01:00
wmayer
ab247acd0d Gui: properly handle small quantities in property editor 2021-04-20 17:10:33 +02:00
Chris Hennes
b1f8184858 Remove unneeded Qt version checks 2021-03-28 17:41:27 +02:00
Chris Hennes
b15f134038 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
a3e3487f74 Gui: [skip ci] handle number of decimals in PropertyUnitItem, PropertyVectorDistanceItem and PropertyPlacementItem 2021-03-27 18:31:49 +01:00
Benjamin Nauck
f9ac51b6a6 [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
72b3354a28 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
9a49453802 Gui: [skip ci] fix crash on macOS in editor of vector list property 2021-02-18 21:43:53 +01:00
wmayer
6b2b6a4868 PyCXX: [skip ci] fix compiler warnings due to changes on PyCXX 2020-11-25 16:52:46 +01:00
wmayer
44f42a8e2c 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
864483d550 PVS: V560 A part of conditional expression is always true 2020-07-18 10:59:28 +02:00
wmayer
0a8f4b5103 Gui: [skip ci] improve usability of VectorListEditor 2020-06-29 21:29:12 +02:00
wmayer
602a9a1633 Gui: [skip ci] fix -Wrange-loop-construct 2020-06-22 22:50:55 +02:00
wmayer
771b4738a1 Gui: implement property editor for vector list 2020-06-22 22:28:15 +02:00
wmayer
f9984a0ab1 Gui: [skip ci] fix regression by using UTF-8 encoding in PropertyItem::setPropertyValue 2020-04-03 16:22:35 +02:00
wmayer
110ea2c68e [skip ci] improve whitespaces 2020-04-03 16:19:24 +02:00
wmayer
5c4ddf42ee Gui: [skip ci] bind spin boxes to object in Placement dialog 2020-03-27 17:08:08 +01:00
wmayer
ec8b1bc072 [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
34c35f8eff 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
0633abb70d 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
wmayer
4318375a51 Gui: allow user to set an expression for property editor of vectors 2019-12-28 17:36:41 +01:00
Zheng, Lei
b0c9325432 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
86b22fe3f6 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
c4fec26aaa Gui: improve PropertyXLink display in property view 2019-10-08 10:21:31 +02:00
Tomas Pavlicek
7157a4ac4d TechDraw - Fix Annotation and Symbol international characters mangling 2019-10-07 16:56:09 -04:00
Zheng, Lei
29f5ac736b 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
be951cc0d8 Gui: fix missing expression highlight in property editor 2019-10-07 17:24:31 +02:00