Commit Graph

155 Commits

Author SHA1 Message Date
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
Zheng, Lei
03770fc725 Gui: restore tree view content menu action order 2019-09-10 14:17:06 +02:00
Zheng, Lei
0936ebd3c9 Gui: fix active object highlight 2019-09-10 14:17:06 +02:00
Zheng, Lei
05ca5b82e1 Gui: minor change to tree view document restore handling 2019-09-07 17:00:13 +02:00
Zheng, Lei
778ccc2692 Gui: more exception handling in tree view 2019-08-30 15:01:25 +02:00
Zheng, Lei
5bc298cf18 Gui: handle exception in tree view double click 2019-08-30 14:52:09 +02:00
Zheng, Lei
4b74659308 Gui: fix tree view document double click activating 2019-08-30 14:50:52 +02:00
Zheng, Lei
8a99ef34ec 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
a6da78b4e5 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
4068df6483 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
Zheng, Lei
1fecb7c4cc Gui: fix tree view selection focus problem 2019-08-17 15:32:51 +02:00
Zheng, Lei
f36714974a Command: disable auto transaction if triggering editing
Each command will create an App::AutoTransaction to auto create and
commit a transaction for proper undo/redo. But if the command starts
editing, the current transaction may be required to out live the current
command.

Note that the command can only detect editing if the code calls
Gui::Document::setEdit(). There are objects that starts editing by
calling its own ViewProvider::setEdit(), e.g. various TechDraw
ViewProviders. In this case, to avoid auto committing, one can call
App::Application::setActiveTransaction() with the second argument set to
true, or call App::AutoTransaction::setEnable(false).
2019-08-17 15:32:51 +02:00
Zheng, Lei
5f5ea31ec8 TreeView: update status on manual object touch 2019-08-17 15:32:51 +02:00