Commit Graph

158 Commits

Author SHA1 Message Date
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
Zheng, Lei
714d20895e Gui: fix tree view lingering sub element selection 2019-10-08 10:21:46 +02:00
Zheng, Lei
d8adbca942 Gui: minor fix of tree view drag move 2019-10-08 10:20:01 +02:00
luz.paz
7b7797f4f3 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
68aca247ee Gui: remove FC_TREEPARAM, add document for class TreeParams 2019-09-27 15:49:42 +02:00
Zheng, Lei
cdd31fb10c Gui: fix tree view auto expand 2019-09-27 15:49: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
56d8f22fc5 Gui: restore tree view content menu action order 2019-09-10 14:17:06 +02:00
Zheng, Lei
b991b8c591 Gui: fix active object highlight 2019-09-10 14:17:06 +02:00
Zheng, Lei
636f5e9a9a Gui: minor change to tree view document restore handling 2019-09-07 17:00:13 +02:00
Zheng, Lei
be320a8733 Gui: more exception handling in tree view 2019-08-30 15:01:25 +02:00
Zheng, Lei
ec3541ae79 Gui: handle exception in tree view double click 2019-08-30 14:52:09 +02:00
Zheng, Lei
8e2a059e70 Gui: fix tree view document double click activating 2019-08-30 14:50:52 +02:00
Zheng, Lei
b39771aa84 Gui: use ExpressionLineEdit for tree view object search
Tree view is already using expression for object search. This patch
adds the expression completer feature for search result suggestion.
2019-08-30 14:50:15 +02:00
Zheng, Lei
c2254a64aa Gui: expose MainWindow:showStatus()
Tree view now uses this to show error on hovering over object in error.
2019-08-30 14:33:31 +02:00
wmayer
5172c3bc08 Fix clang compiler warnings:
+ fix -Winconsistent-missing-override
+ fix -Wunused-variable
+ fix -Wbraced-scalar-init
+ fix -Wparentheses (View3DInventorViewer::checkGroupOnTop: operator '?:' has lower precedence than '+'; '+' will be evaluated first)
+ fix -Wundefined-bool-conversion (MainWindow::updateActions)
+ suppress -Woverloaded-virtual but fix later
2019-08-17 19:52:12 +02:00