Commit Graph

35 Commits

Author SHA1 Message Date
Benjamin Bræstrup Sayoc
f647d4a1eb Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
tritao
8aa50c4380 Gui: Reorganize the dialog files into a top Dialogs folder. 2025-01-24 16:28:02 -06:00
Ladislav Michl
0ee3c9f8e6 Base: Drop QString-std::string conversion functions from Tools
Convenience helpers function Tools::toStdString and Tools::fromStdString
were implemented for Qt4 or older to perform utf8 aware conversion as
QString::toStdString/QString::fromStdString were using toAscii/fromAscii
internally (see https://dreamswork.github.io/qt4/classQString.html).

Since Qt5 QString uses toUtf8/fromUTf8, which makes the helper functions
obsolete (see https://doc.qt.io/qt-5/qstring.html#fromStdString).
2024-12-02 23:30:53 -05:00
Benjamin Bræstrup Sayoc
e661774a29 [Gui] Center expression icon 2024-11-11 18:32:34 +01:00
ppphp
da7ee06d67 fix: c++20 deprecate [=] 2024-03-31 10:47:32 +02:00
wmayer
5a153e50ff Gui: modernize C++: use default member init 2023-08-23 19:51:44 +02:00
wmayer
c016f1c1fb Gui: modernize C++: use equals default 2023-08-20 18:12:43 +02:00
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
wmayer
bcc9c6654c Gui: don't make QuantitySpinBox dependent on implementation details of its base class 2022-10-26 10:54:07 +02:00
wmayer
71d0490dab Gui: don't make QuantitySpinBox dependent on implementation details of its base class 2022-10-26 00:43:33 +02: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
Uwe
316a869b26 [Gui] remove superfluous nullptr checks 2022-07-18 03:17:42 +02:00
wmayer
d5921e08ec fix (Qt) issues found by clang's clazy tool:
+ -Wclazy-incorrect-emit
+ -Wclazy-strict-iterators
+ -Wclazy-overloaded-signal
+ -Wclazy-qstring-arg
+ -Wclazy-unused-non-trivial-variable
+ -Wclazy-container-anti-pattern
+ -Wclazy-range-loop-reference
+ -Wclazy-const-signal-or-slot
+ -Wclazy-detaching-temporary
+ -Wclazy-qfileinfo-exists
2022-06-29 21:00:54 +02:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
cf5732dfad [Gui] SpinBox etc.: remove unused includes 2022-03-05 16:20:40 +01:00
wmayer
00d6f4f2df Gui: refactor code to reduce code duplication 2022-01-05 20:13:09 +01:00
wmayer
5d49bf78de Gui: QuantitySpinBox inherits from ExpressionSpinBox to reduce code duplication 2021-04-02 22:22:16 +02:00
wmayer
e151f19d41 Gui: add class ExpressionSpinBox to reduce code duplication 2021-04-02 21:36:29 +02:00
wmayer
75bf85eb5b Gui: Change label type to ExpressionLabel in ExpressionBinding
* Add function ExpressionBinding::makeLabel() and use it in subclasses to reduce code duplication
2021-04-02 17:46:42 +02:00
Chris Hennes
64fb634ed1 Add tooltip to f(x) when there is no expression
As suggested by @luzpaz, this adds a tooltip to the f(x) icon of all
of the widgets that use it: QuantitySpinBox, UIntSpinBox, IntSpinBox,
DoubleSpinBox, and ExpLineEdit. These five classes are divided across
three files, and all five classes duplicate the same basic code. In the
existing code, no tooltip is shown if there is no expression. If there
is an expression, it (alone) is used as the tooltip.

This commit modifies that behavior to have explanatory text as the
tooltip when there is no expression, and when there is, to prepend a
short string to the beginning.

To reduce further code duplication, this is implemented by adding a new
function to ExpressionLabel allowing the text of the expression to be set.
It checks that text and if it's empty, uses a preset default string as the
tooltip. If there is expression text, it instead prepends another
bit of text to the front and sets the entire expression+prefix as the
tooltip.

TODO: In the future a lot of the preexisting code duplication could be
removed by making the ExpressionLabel class do more internal management
of the expression.

Thanks to @kisolre for the assistance tracking these down, and
suggesting the default text used.
2021-04-02 16:17:04 +02:00
Benjamin Nauck
f9ac51b6a6 [Gui] Use std::shared_ptr instead of boost::shared_ptr
There's no need to use boost version when stl has support for shared_ptr
2021-03-06 19:32:03 +01:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
877d7e3c49 Gui: [skip ci] workaround for QWindowsStyle to disable spin buttons when it is set read-only 2020-09-11 14:10:45 +02:00
wmayer
b38517b291 Gui: [skip ci] fix bugs in spin box classes:
+ use correct format string when assigning value to an expression
+ do not round value when setting value of a DoubleSpinBox
2020-09-09 09:49:03 +02:00
Thomas Gimpel
33499a5552 Gui: do not drop unhandled key events in *SpinBox::keyPressedEvent() handlers 2020-07-12 11:38:44 +02:00
wmayer
a03244fa1e Gui: [skip ci] when changing expression of a widget then set tooltip only for the label child but not for the widget itself
this allows that a custom tooltip can be set
2020-01-09 21:35:13 +01: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
Eivind Kvedalen
1a2e77cf6e Spinboxes: Fix for issue #3278. 2017-11-29 21:49:01 +01:00
wmayer
f944ab3846 replace deprecated auto_ptr with unique_ptr 2016-09-22 13:01:20 +02: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
Stefan Tröger
580a4e15d1 Expressions: port int spinbox for property editor 2015-12-09 14:08:49 +01:00
Stefan Tröger
4203a6f35b Expressions: Integrate into the property editor
- basic infrastructure for handling of expressions
- port the unit properties editor to support expressions
- port placement editor to support expressions
- expressions for double spinbox
- expressions in sketch constraints
2015-12-09 14:08:48 +01:00
Eivind Kvedalen
cbb4c52310 SpinBox: Added expression binding functionality. 2015-09-30 15:54:18 +02:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00