Commit Graph

94 Commits

Author SHA1 Message Date
Uwe
316a869b26 [Gui] remove superfluous nullptr checks 2022-07-18 03:17:42 +02:00
andrea
3018985f80 Remove unused code into GUI 2022-07-17 03:53:11 +02:00
wmayer
201f4c9a5a Core: replace PyObject_IsTrue with Base::asBoolean 2022-07-16 14:04:05 +02:00
marioalexis
f78412c75b Gui: Use PyObject_IsTrue in combination with conditional ternary operator 2022-06-22 19:50:03 -04: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
d0485c6bef Gui: add enum class to Selection Python API 2022-04-09 18:03:45 +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
wmayer
9160f06e1c Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError 2022-03-17 14:45:48 +01:00
wmayer
d69defaa3c Py: replace BaseExceptionFreeCADError with more suitable exception types 2022-03-17 13:54:23 +01:00
Uwe
c4f5628899 [Gui] So headers: remove unused includes
- also sort out some headers to be used in precompiled headers
- also move a boost header to precompiled headers
2022-03-16 02:01:32 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Uwe
fe3feb30df [Gui] Selection: remove unused includes 2022-03-05 04:21:58 +01:00
Uwe
b4fff07d9e [App] Expression and Extension: remove unused includes 2022-02-25 18:06:57 +01:00
Uwe
862047010b [Gui] Selection and MainWindow: remove unused headers 2022-02-19 04:55:50 +01:00
marioalexis
062e30d42f Gui: Fix some docstrings in Selection module 2022-01-29 23:53:33 +01:00
marioalexis
0620911da1 Gui: Change signature in some Python Selection module functions 2022-01-29 11:09:33 +01:00
marioalexis
cf2e1a0aa5 Gui: Improve docstrings of Python Selection module functions 2022-01-29 11:09:33 +01:00
wmayer
ca5c799ce2 Gui: rename methods of SelectionObserver to clarify intention in client code 2021-12-07 14:17:07 +01:00
flachyjoe
6f0662c716 format Selection API doc 2021-05-13 13:10:40 +02:00
luz paz
6a7184139d Gui: remove Py2 code from several src/Gui .cpp files 2021-04-14 14:56:02 +02:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
ad7fbee066 Part: [skip ci] fix crash when closing document while face colors panel is open 2020-08-06 11:26:24 +02:00
wmayer
44f42a8e2c LGTM: [skip ci] fix: Declaration hides parameter
A local variable hides a parameter. This may be confusing. Consider renaming one of them.
2020-07-27 10:57:34 +02:00
wmayer
b480a207c0 Coverity: Uncaught exception 2020-07-20 17:34:29 +02:00
wmayer
a0d51baaf2 PVS: V547 Expression is always true/false 2020-07-18 10:59:27 +02:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
033ddff089 cast between incompatible function types from 'PyObject* (*)(PyObject*, PyObject*, PyObject*)' {aka '_object* (*)(_object*, _object*, _object*)'} to 'PyCFunction' {aka '_object* (*)(_object*, _object*)'} [-Wcast-function-type] 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
3df91974b8 Gui: [skip ci] fix unicode handling when showing units in status bar 2020-06-04 16:27:58 +02:00
Zheng, Lei
3f2f8ce039 Gui: fix crash on selecting removing object
The crash happens if some code calls Gui::Selection().addSelect() of a
removing object in response to App::Document::signalDeletedObject.
2020-06-04 09:34:27 +02:00
wmayer
08dca736e3 Gui: let each coordinate use its own unit to avoid that the displayed values can become very huge 2020-05-30 17:16:32 +02:00
wmayer
0821649a7f Gui: implement a static function schemaTranslatePoint to avoid code duplication 2020-05-30 16:46:35 +02:00
0penBrain
b0084cd43d [FC] Status bar preselection coordinates are aware of user unit setting ; fixes #4148 2020-05-30 12:29:58 +02:00
Zheng, Lei
e6fc155591 Gui: check object existence before SelBack/Forward 2020-05-03 19:18:46 +02:00
Zheng, Lei
39959f9500 App: add new convenient class SubObjectT
Derived from App::DocumentObjectT to add support of sub object

Also some minor changes to App::DocumentObjectT

Changed Gui::SelectionChanges to make use of SubObjectT
2020-02-11 15:40:27 -05:00
luz.paz
f11783a498 src/Gui: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Gui` files
2019-12-25 11:39:17 +01:00
asapelkin
e951094af9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
luz.paz
1c981e8f14 Fix typos and misc. formatting [skip ci]
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-21 16:02:23 -03:00
Zheng, Lei
c98549a40a Gui: fix python documents in Gui.Selection methods 2019-10-13 17:02:32 +02:00
Zheng, Lei
bf27b115c0 Gui: fix SelectionSingleton::checkSelection()
This affects sub-object selection detection
2019-10-13 17:02:32 +02:00
wmayer
bea009c1d5 fix description of 'resolve' in Selection 2019-10-13 14:32:23 +02:00
Zheng, Lei
1e69eb0d8e Gui: improve SelectionSingleton::setVisible()
Change argument to enum type. Make setVisible() robust against
unexpected selection change.
2019-10-08 10:21:06 +02:00
Zheng, Lei
94f6f984e0 Gui: fix SelectionSingleton::checkSelection() 2019-09-03 12:25:09 +02:00
Zheng, Lei
848fbf6035 Gui: allow SelectionSingleton::hasSubSelection() check for sub-element
This is used by relative link command activation for sub-element
selection
2019-08-30 14:43:04 +02:00
wandererfan
f4bb395387 [TD]Prevent crash in SelectionSingleton
- in SelectionSingleton::setVisible, if the selection changes during
  loop, a crash may occur.
- in QGraphicsScene, hiding an item changes its selected status.
2019-08-28 12:20:42 -04:00
luz.paz
0f67e8ddfa Fix typos in src/Gio 2019-08-17 15:32:49 +02:00
Zheng, Lei
49b6944a20 Gui: Selection API changes
Mostly about API changes to SelectionSingleton. Also include related
changes to SelectionObject, SelectionChange, and SelectionView.

Please check out the summary of changes [here](https://git.io/fjimC)
2019-08-17 14:52:10 +02:00
Dion Moult
7ecc9cfb21 Add python binding for setPreselect function via Selection.SetPreselection() 2019-05-08 10:26:55 -03:00