Commit Graph

41 Commits

Author SHA1 Message Date
wmayer
103de43a4e Gui: fix possible problems with new style connect
* In UIntSpinBox rename the signal to not overwrite the signal of the base class
* In UIntSpinBox use the (ambiguous) signal 'valueChanged' of the base class QSpinBox
* To avoid that connect() fails use the function pointer of the Qt class where the signal is defined
2023-01-12 17:02:59 +01:00
Uwe
ed995b5a15 [Gui] modernize some connect() settings
- addresses #6166
2023-01-12 15:13:16 +01:00
Uwe
4091db4739 [skip ci] [Gui] ExpressionCompleter: fix a typo
- found by the CI
2023-01-12 04:20:40 +01:00
luz paz
c16e88845b Gui: fix trailing whitespace 2022-12-02 19:18:54 -06:00
berniev
75acacd1b7 Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
2022-09-14 13:25:13 -05:00
berniev
0c70d45c83 Gui: Use override etc 2 2022-08-09 12:43:23 +02:00
berniev
d88729d2c4 Gui: use empty 2022-08-06 16:35:45 +02:00
Uwe
316a869b26 [Gui] remove superfluous nullptr checks 2022-07-18 03:17:42 +02:00
wmayer
2dd9d69112 Gui: fix crash in ExpressionCompleter::slotUpdate
Forum thread: https://forum.freecadweb.org/viewtopic.php?f=3&t=69931
2022-07-16 18:23:42 +02:00
wmayer
d0f98bf45c Conda: ssize_t is a POSIX type and thus not necessarily defined on Windows. Currently this causes build failures with Conda + Py3.10.
The solution is to get rid off all occurrences of ssize_t in FreeCAD code
2022-05-17 11:43:40 +02:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +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
Uwe
c7aed638ed [Gui] compilation fix for ExpressionCompleter
MSVC complained that ssize_t was undefined
2022-03-05 01:12:30 +01:00
Uwe
b9777464c3 [Gui] Expression: remove unused includes 2022-03-02 05:00:21 +01:00
Zheng, Lei
2a3951ca32 Spreadsheet: change alias handling
No longer add dynamic property for alias, simply rely on
get(Dynamic)PropertyByName() to check for aliases.

Add new API PropertyContainer::getPropertyNamedList() so that
ExpressionCompleter can discover properties with aliases.
2021-12-21 21:41:02 -07:00
Zheng, Lei
68fca40983 Spreadsheet: support cell binding
Cell binding allows one to bind a range of cells of one sheet to another
range of cells of an arbitary sheet, including any empty cells in the
range.

The binding is implemented with PropertyExpressionEngine and
PropertySheet::setPathValue(), which binds a special path of
PropertySheet, such as

    .cells.Bind.A1.D1

to an expression, such as

     tuple(.cells, <<A2>>, <<A5>>)

The A1 and D1 in the example above specifies the binding start and end
cell address. And <<A2>> and <<A5>> are the range of cells to bind to.
Note that you can use any expression that evalutes to string for the
binding destination, e.g. <<A%d>> % B1, which uses the value inside B1
to construct the binding destination. The '.cells' in the tuple shown
above is an example to bind cells of the same PropertySheet. It can be
change to to reference to any other spreadsheet, even those outside the
current document, e.g. Document#Spreadsheet001.cells
2021-12-21 21:41:02 -07:00
Chris Hennes
50c7ee36bf [GUI] Remove code for Qt < 5.9 2021-04-02 10:10:37 +02:00
Benjamin Nauck
64e2811192 [Gui] Switch from boost::tuple to std::tuple
It's better to use the standard lib when possible
2021-03-06 19:31:06 +01:00
Benjamin Nauck
db3b35cb5d Gui: Minor cleanup
Cleans up code which was touched in previous commit.

* Don't call popup() twice when not needed
* use nullptr instead of 0 for pointers
2021-02-19 16:22:41 +01:00
Benjamin Nauck
f5b7f645d8 Spreadsheet: Don't autocomplete when writing strings
After pull request https://github.com/FreeCAD/FreeCAD/pull/4215 it
doesn't make much sense helping the user to write expressions without
leading '=', as that content will be parsed as a string.

This change adjusts the behaviour in SpreadsheetGui's LineEdit to avoid
popping up the ExpressionCompleter when no leading equal sign is used.
2021-02-19 16:22:41 +01:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01: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
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
0633abb70d Gui: refactor link property editor
PropertyLinkItem now support all major types of link property.
PropertyLinkListItem is no longer necessary, but kept for backward
compatible, which is now identical to PropertyLinkItem.

DlgPropertyLink, the link selection dialog, is now made modeless, so
that that user can select geometry sub-element directory from 3D view.
2020-02-11 15:40:27 -05:00
Zheng, Lei
ea7eee8061 Expression: split Expression.h to ExpressionParser.h
Split Expression details into a separate header to reduce recompilation
time on changes.
2019-09-28 15:30:41 +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
luz.paz
a1984aeece Fix typos, grammar, and some whitespace issues
Found via `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`
2019-09-07 11:58:38 -04:00
Zheng, Lei
3e0cfb4ba5 Gui: fix ExpressionCompleter for property 2019-08-30 14:51:33 +02:00
Zheng, Lei
c2c6053e71 Gui: improve expression completer
Proper support of completing an edit in the middel of an expression.

Also support 'noProperty' mode in the completer, where no completion is
offered for property names. This will be used by tree view object
search.
2019-08-30 14:49:14 +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
26dad093f6 ExpressionCompleter: fix missing init() call 2019-08-17 15:32:48 +02:00
Zheng, Lei
2bd4795e80 Gui: property view related changes
* Display property from linked object, colored green,

* Change DlgPropertyLink to support external linking and sub-object
  selection

* Improve large selection performance by using a timer

* Improve TAB key behavior in property editor

* Add context menu to show hidden properties, change property status,
  set expression on any and property, and add/remove dynamic properties

* Optimize expression completer model construction, as the original
  implementation gets prohibitively slow for moderate number of objects.
2019-08-17 15:08:33 +02:00
Unknown
d949210aed Typos, grammar & uniformiity
3rd party KDL typos have been submitted upstream https://github.com/orocos/orocos_kinematics_dynamics/pull/121
2017-12-13 00:10:46 -05:00
wmayer
150bd625b8 fix crash in ExpressionCompleter::slotUpdate 2017-12-06 23:02:00 +01:00
Eivind Kvedalen
75d006a97d Expression completer: Fixed issue #3197. 2017-12-05 16:37:12 +01:00
wmayer
0824c5fd3c fix Coverity issues 2016-08-21 14:03:02 +02:00
Mateusz Skowroński
4ef8c9707f Qt5 compatibility changes.
QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
QString::toAscii() is obsolete in Qt5. Replace it with toLatin1().
QChar::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().

This change is Qt4/Qt5 neutral.
2016-02-14 08:23:00 +01:00
Eivind Kvedalen
48b699071c ExpressionCompleter: Remove '=' before tokenizing string, to improve completer when used in the spreadsheet. 2016-01-08 23:09:00 +01:00
Mateusz Skowroński
cd2db00f22 QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:25 +01:00
Eivind Kvedalen
0894d5bdae ExpressionCompleter: Skip all types of links when building completer model. 2015-09-24 09:52:45 +02:00
Eivind Kvedalen
31a6fece52 Added ExpressionCompleter class. 2015-09-21 14:51:07 +02:00