Commit Graph

317 Commits

Author SHA1 Message Date
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
wmayer
5e0cfc64ee App: use forward declarations 2022-03-04 21:09:46 +01:00
Uwe
3d7be752af [Gui] Tree: fix another typo 2022-02-19 01:55:06 +01:00
Uwe
2aeeb5b907 [Gui] Tree: fix typo 2022-02-19 01:48:07 +01:00
Uwe
2152367ad9 [Gui] CommandView and Tree: remove unused headers 2022-02-19 01:24:24 +01:00
Zheng, Lei
c2656540e5 Gui: remove obsolete/incorrect tree view comments
It's part of the suggestion of this forum post:
https://forum.freecadweb.org/viewtopic.php?p=560433#p560433
2022-01-12 14:44:35 +01:00
wmayer
a6838cf58f Gui: rename methods of SelectionObserver to clarify intention in client code 2021-12-07 14:17:07 +01:00
Uwe
450fb1f48a [GUI] code style fixes for Tree.cpp
tons of style fixes by MSVC

(the idea was initially just to fix the code style issues from commit 82c46586e67c9 and then MSVC found many more)
2021-12-04 02:57:34 +01:00
0penBrain
89706839e0 [Gui] Tree: implement collapse/expand system with keys
Implemented using Alt modifier + arrow keys
 * Alt+Left : collapse selected items
 * Alt+Right : expand selected items
 * Alt+Up : expand selected items with all tier-1 children collapsed
 * Alt+Down : expand selected items with all tier-1 children expanded
2021-12-03 18:08:47 +01:00
Chris Hennes
ded7adb798 Revert "Merge pull request #4626 from pavltom/GUI_TreeView_Item_Ordering"
This reverts commit b0452667c72f330323f6b3366f45bf039d05feef, reversing
changes made to b2d99f3fa7b4c7c305aed4a8d975a8624a6d590f.

See forums discussion: https://forum.freecadweb.org/viewtopic.php?p=549120
2021-11-24 09:03:35 -06:00
Tomas Pavlicek
17f328c7a9 [Gui] Issue #3923 - Arbitrary Tree item ordering + tests 2021-10-26 19:09:34 +02:00
donovaly
1940b5d7a3 [GUI] fix tree object context menu issues
- fix bug that you can select several objects across different document to make them a group
- fix bug that when more than one object is selected you get a context menu to rename, despite it is unclear what object should be renamed
- add feature to select also the child objects of the selection

The latter was also requested long time ago: https://tracker.freecadweb.org/view.php?id=2397
2021-10-25 11:14:53 +02:00
donovaly
a0dd2dbdcf [GUI] new icon to mark for recomputation
The icon is from @bitacovir
2021-04-14 14:57:40 +02:00
donovaly
856f16211c [Gui] add recompute icon to context menu
as discussed here: https://forum.freecadweb.org/viewtopic.php?f=34&t=57139&start=10
2021-03-29 11:12:15 +02:00
wmayer
90dd0f8e91 Gui: [skip ci] add some separators to context-menu to group recompute related functions 2021-03-29 11:11:12 +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
c996988a9d Gui: [skip ci] fixes #0004569: Part Design Workbench - New Bodies selection issues 2021-02-20 02:06:27 +01:00
Benjamin Nauck
67f21d663d Gui: Add support for selecting multiple objects without keyboard
Adds checkboxes to the document tree which makes it possible to
select multiple document objects on devices without physical keyboard.

These checkboxes are opt-in and can be enabled/disabled from:
Edit -> Preferences -> Display -> Navigation -> Selection

Forum thread for feature the request:
https://forum.freecadweb.org/viewtopic.php?f=34&t=53065

We need to iterate the tree to add/remove the selection boxes when
the enable-setting has been changed.

The size for the first column in the tree is adjusted to fit both
name and optional checkbox.
2021-02-03 21:51:56 +01:00
Abdullah Tahiri
4facab0936 Gui: Colorful/Greyable overlay status in icons
===============================================

Before this implementation, specific status via former mergeOverlayIcon() was greyed out
with the visibility.

With this commit, the developer has two options:

a) override mergeGreyableOverlayIcons, in which case the overlay will
be greyed out when the item is greyed out as per former mergeOverlayIcon()

b) override mergeColorfulOverlayIcons, in which case the overlay will
be superimposed after the icon is greyed out as it is the case for stardard
error and recompute flags.
2021-01-06 13:54:00 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
3094348ad4 Gui: [skip ci] when closing document via context-menu ask the user first how to continue
See also forum thread: https://forum.freecadweb.org/viewtopic.php?f=3&t=51746
2020-11-03 12:09:28 +01:00
wmayer
067b51b835 Gui: [skip ci] let view provider to decide to whether open a transaction on double-click
The sketcher view provider doesn't need a transaction on double-click or otherwise shows a useless entry in the undo dialog which when undoing leads to weird behaviour
2020-10-24 15:37:04 +02:00
wmayer
c3354a46db Gui: [skip ci] fix crash in DocumentObjectData::updateChildren() when canceling a pending task 2020-09-16 13:41:03 +02:00
wmayer
a7f894d2e8 Gui: several fixes for expression search box:
+ rename method setMatchExact() to setExactMatch()
+ move handling of user-defined parameters to class ExpressionParameter
+ Qt::MatchExactly is not supported by QCompleter, use Qt::MatchStartsWith instead
+ add possibility to change match behaviour via context-menu
2020-09-13 18:35:46 +02:00
Zheng, Lei
885e990606 Gui: enable search box in stand alone TreeView dockable 2020-09-13 18:35:02 +02:00
Zheng, Lei
49150836bd Gui: allow change ExpressionCompleter filter mode
Fixes #4428

Filter mode set to Qt::MatchContains for tree view search and link
property editor object search.

Other usage of the completer (e.g. property editor, speadsheet) defaults
to Qt::MatchContains, but can be changed using parameter,

    BaseApp/Preferences/Expression/CompleterMatchExact
2020-09-13 18:35:02 +02:00
Zheng, Lei
6375b82eb6 Gui: fix view object global coordinate space showable checking 2020-09-10 14:30:50 +02:00
luz paz
6f62fd09df Fix typos in various files [skip-ci]
Found via `codespell 2.0.dev0`  
```
codespell -q 2 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-09-04 10:10:31 +02:00
wmayer
983939b32d Coverity: Uninitialized scalar/pointer field 2020-07-20 17:34:30 +02:00
wmayer
ba683bf241 Coverity: Dereference null return value 2020-07-20 17:34:26 +02:00
wmayer
05d4496d96 PVS: V688 The local variable possesses the same name as one of the class members, which can result in a confusion 2020-07-18 10:59:28 +02:00
Zheng, Lei
36d046d489 App/Gui: introduce temporary document
Add new argument to Application::newDocument() to create a temporary
    document. Also exposed to Python API App.newDocument() with a named
    argument 'temp'.

    The temporary document is marked with status bit 'TempDoc'. The user
    will not be prompt for saving when closing. The undo/redo is disabled.
    The AutoSaver skips it. And the tree view will not show it.
    PropertyXLink allows linking to/from object within a temporary document
    without saving.
2020-07-14 19:36:05 +02:00
wmayer
d6169d6478 boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
ed8a5f2ba7 Qt5: 'QModelIndex QModelIndex::child(int, int) const' is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
730154a684 boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
ca327b6f25 Qt5: 'bool QTreeWidget::isItemSelected(const QTreeWidgetItem*) const' is deprecated: Use QTreeWidgetItem::isSelected() instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
eafdb0b5ab Gui: [skip ci] handle unicode in tool tips of tree view 2020-06-02 20:15:42 +02:00
Zheng, Lei
f29b07c143 Gui: change tree view select all behavior
Only select all objects of the current document
2019-12-08 15:07:36 +01:00
wmayer
f14371bc06 convert enum to enum class to fix -Wgnu-redeclared-enum 2019-11-13 22:39:27 +01:00
Zheng, Lei
ba459fcfdd Gui: fix tree view option sync placement 2019-10-08 10:26:16 +02:00
Zheng, Lei
8d7287b8a6 App/Gui: add ObjectStatus::NoAutoExpand
Used by App::Origin to disable selection auto expanding in tree view.
2019-10-08 10:23:57 +02:00
Zheng, Lei
855e3fd724 Gui: fix missing tree view sync after drag and drop 2019-10-08 10:23:21 +02:00
Zheng, Lei
eb4dbd56a7 Gui: fix tree view lingering sub element selection 2019-10-08 10:21:46 +02:00
Zheng, Lei
75c8c6289a Gui: minor fix of tree view drag move 2019-10-08 10:20:01 +02:00
luz.paz
fb32601746 Fix various (doxy) typos and whitespace issues
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml`
2019-10-03 07:57:13 +02:00
Zheng, Lei
959ec5dad3 Gui: remove FC_TREEPARAM, add document for class TreeParams 2019-09-27 15:49:42 +02:00
Zheng, Lei
475baf5481 Gui: fix tree view auto expand 2019-09-27 15:49: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