Commit Graph

174 Commits

Author SHA1 Message Date
Zheng, Lei
5ec19fc5a1 Reduce debug log output 2022-04-23 16:21:49 +02:00
0penBrain
e8ed31f391 Gui: add parameter switch to optionally stretch 'Description' column of Tree view 2022-04-15 18:22:02 +02:00
wmayer
aea110ba15 Gui: clean-up Selection API
Replace the int of the SubType of SelectionChanges with an enum class.
The meaning of it is nowhere documented and some magic numbers like 0,1,2 are used in several places in the code.
2022-04-09 23:07:02 +02:00
wmayer
9eac35cf5d Gui: clean-up Selection API
Replace the int of the 'resolve' argument of several functions with a proper enum class.
* This avoids the inconsistencies in client code where often true/false is passed when an int is expected
* This avoids the use of magic numbers like 0, 1, 2 or the undocumented 3
2022-04-09 17:03:43 +02:00
Chris Hennes
bedf920702 Gui: PR6497 move return statement to new line 2022-03-29 12:33:50 -05:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
andrea reale
13e09b36f8 remove QT4 references 2022-03-19 23:07:38 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
wmayer
95c70e7f4c App: use forward declarations 2022-03-04 21:09:46 +01:00
Uwe
d4f72d7562 [Gui] Tree: fix another typo 2022-02-19 01:55:06 +01:00
Uwe
ee295d0376 [Gui] Tree: fix typo 2022-02-19 01:48:07 +01:00
Uwe
82132e39bb [Gui] CommandView and Tree: remove unused headers 2022-02-19 01:24:24 +01:00
Zheng, Lei
29ae8b0502 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
ca5c799ce2 Gui: rename methods of SelectionObserver to clarify intention in client code 2021-12-07 14:17:07 +01:00
Uwe
04be1a4af9 [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 92a8e0e3d8 and then MSVC found many more)
2021-12-04 02:57:34 +01:00
0penBrain
92a8e0e3d8 [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
c9a74d40d2 Revert "Merge pull request #4626 from pavltom/GUI_TreeView_Item_Ordering"
This reverts commit c62239d0ba, reversing
changes made to bef1df4d40.

See forums discussion: https://forum.freecadweb.org/viewtopic.php?p=549120
2021-11-24 09:03:35 -06:00
Tomas Pavlicek
345dcd5252 [Gui] Issue #3923 - Arbitrary Tree item ordering + tests 2021-10-26 19:09:34 +02:00
donovaly
67e8fd0b6a [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
525f5dd709 [GUI] new icon to mark for recomputation
The icon is from @bitacovir
2021-04-14 14:57:40 +02:00
donovaly
c712b2feb6 [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
f45207fcb1 Gui: [skip ci] add some separators to context-menu to group recompute related functions 2021-03-29 11:11:12 +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
e5e07445dc Gui: [skip ci] fixes #0004569: Part Design Workbench - New Bodies selection issues 2021-02-20 02:06:27 +01:00
Benjamin Nauck
05c61e349a 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
87c9f83bd6 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
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
0324d2de64 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
690cc3e180 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
ff0f8b0d85 Gui: [skip ci] fix crash in DocumentObjectData::updateChildren() when canceling a pending task 2020-09-16 13:41:03 +02:00
wmayer
2c744264d6 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
d6748a030f Gui: enable search box in stand alone TreeView dockable 2020-09-13 18:35:02 +02:00
Zheng, Lei
4f5a2e923c 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
46209e7f77 Gui: fix view object global coordinate space showable checking 2020-09-10 14:30:50 +02:00
luz paz
5cd408687b 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
b25dee58d5 Coverity: Uninitialized scalar/pointer field 2020-07-20 17:34:30 +02:00
wmayer
4a494fec69 Coverity: Dereference null return value 2020-07-20 17:34:26 +02:00
wmayer
af9c5274b4 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
536051179b 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
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
deb39c4321 Qt5: 'QModelIndex QModelIndex::child(int, int) const' is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
4ec45b545e 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
da6cb8a963 Qt5: 'bool QTreeWidget::isItemSelected(const QTreeWidgetItem*) const' is deprecated: Use QTreeWidgetItem::isSelected() instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
47c9f01d22 Gui: [skip ci] handle unicode in tool tips of tree view 2020-06-02 20:15:42 +02:00
Zheng, Lei
50f4c012b4 Gui: change tree view select all behavior
Only select all objects of the current document
2019-12-08 15:07:36 +01:00
wmayer
1e7628f436 convert enum to enum class to fix -Wgnu-redeclared-enum 2019-11-13 22:39:27 +01:00
Zheng, Lei
6afe7071cd Gui: fix tree view option sync placement 2019-10-08 10:26:16 +02:00
Zheng, Lei
4eadbd038d 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
5c3e7d0925 Gui: fix missing tree view sync after drag and drop 2019-10-08 10:23:21 +02:00