Commit Graph

143 Commits

Author SHA1 Message Date
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
Zheng, Lei
20c628fc0c Gui: fix tree view selection focus problem 2019-08-17 15:32:51 +02:00
Zheng, Lei
d0ca893b3e 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
78ce18ace4 TreeView: update status on manual object touch 2019-08-17 15:32:51 +02:00
Zheng, Lei
d4f066f4e9 TreeView: fix selection sync problem 2019-08-17 15:32:50 +02:00
Zheng, Lei
e047b8764c TreeView: fix potential crash on deleting object 2019-08-17 15:32:50 +02:00
Zheng, Lei
0d77bcdd88 TreeView: fix bug in selection sync 2019-08-17 15:32:50 +02:00
luz.paz
0f67e8ddfa Fix typos in src/Gio 2019-08-17 15:32:49 +02:00
Zheng, Lei
a738c7fafa TreeView: fix missing update on item expansion 2019-08-17 15:32:48 +02:00
Zheng, Lei
c18bf11821 Gui: refactor tree view
* Major refactor of tree view to support external linking.

* Item update and selection change are now mostly handled by timer for
  performance improvement.

* Major change to drag and drop for better support of switching between
  copy, move and replace action, and auto adjustment of placement and
  relative link.

* Add second column for user changable object description.

* Unified tree view options and action into command group
  Std_TreeViewActions.

* Modified object search function to find external objects using
  Expression syntax.
2019-08-17 15:08:33 +02:00
wmayer
747a2823eb Set Move as default drop action 2019-07-11 19:08:11 +02:00
wmayer
4e973324ae when restoring object then only expand single items, not its parent items 2019-02-24 00:37:53 +01:00
wmayer
a4e46d1fa1 Undo/Redo of renaming an object via context-menu 2019-02-23 22:26:21 +01:00
Mateusz Skowroński
317bcd59c9 Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] Thanks Clazy! 2019-02-11 15:39:14 +01:00
wmayer
42d7c7afd3 disconnect boost signals when destroying tree view 2019-01-18 16:33:48 +01:00
plgarcia
792bb8282a Drags and drop with groups 2018-11-29 21:25:28 +01:00