Commit Graph

98 Commits

Author SHA1 Message Date
wmayer
552b1f48b1 Gui: fix some important linting warnings:
* cppcoreguidelines-explicit-virtual-functions
* google-explicit-constructor
2023-10-12 11:48:16 +02:00
Zheng, Lei
bf9584a90b Gui: add support for transparent overlay docking widget 2023-10-11 09:58:53 +02:00
wmayer
89bb28239e MSVC: fix several compiler warnings 2023-09-12 22:57:26 +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
54bb9c9c62 Gui: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
Chris Hennes
ec8fe448dc Gui: Don't show raw exception to user 2023-05-24 20:57:43 +02:00
xtemp09
1e162671a2 Setting initial color of QColorDialog
This commit fixes issue #7322
2023-04-16 13:56:19 +07:00
wmayer
0d23594107 Core: add functions setPackedARGB and fromPackedRGBA 2023-02-26 10:11:53 +01:00
wmayer
2e5cb03261 Gui: move to new style connect() 2023-02-01 13:49:35 +01: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
Zheng, Lei
26e38309c8 Gui: fix transparency saving in PrefColorButton 2022-12-03 17:08:17 -06:00
wmayer
21f47cf2ec Gui: fix warnings reported by GH Actions:
* Fix trailing spaces
* Replace tabs
* Mark constructors with one argument explicit
* Fix typos
* Include FCGlobal.h to fix parsing errors
2022-11-11 09:56:43 +01:00
Zheng, Lei
b48458673c Gu: fix readonly AccelLineEdit 2022-11-10 23:20:18 +01:00
Zheng, Lei
af920dd625 Gui: fix shortcut editor 2022-11-10 23:20:18 +01:00
wmayer
af0a014cf2 Qt6 port:
* QApplication::setFallbackSessionManagementEnabled has been removed
* QString::medRef() has been removed. Use QString::mid() again.
* QTextStream::setCodec has been removed
* Use operator QVariant of the QFont class to make code Qt5 and Qt6 compatible
* Signature of QTreeWidget::mimeData() has changed in Qt6. Remove TreeWidget::mimeData() because it doesn't change the implementation
* QLayout::setMargin() is deprecated in Qt5 and has been removed in Qt6. Use QLayout::setContentsMargins()
* QDateTime::toTime_t() is deprecated in Qt5 and has been removed in Qt6. Use QDateTime::toSecsSinceEpoch()
* QDesktopWidget is deprecated in Qt5 and has been removed in Qt6. Use QScreen
2022-11-01 16:55:40 +01:00
wmayer
4c6e123c00 Gui: create modal color dialog on the heap if its parent widget is used in the property editor
For more details see: https://forum.freecadweb.org/viewtopic.php?f=23&t=70655
2022-10-22 21:42:21 +02:00
wmayer
c5a7654285 Gui: create modal dialog on the heap if its parent widget is used in the property editor
For more details see: https://forum.freecadweb.org/viewtopic.php?f=23&t=70655
2022-10-22 18:36:52 +02:00
wmayer
bf81c8035f Gui: fix regression of 2ef4b7a06 2022-09-25 10:36:08 +02:00
Uwe
2ef4b7a06b [Gui] fix some CI warnings
- narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined
- floating point literal has suffix 'f', which is not uppercase
- narrowing conversion from 'double' to 'float'
- Slots named on_foo_bar are error prone
- also tome Clang style fixes

(see here for the reports: https://github.com/FreeCAD/FreeCAD/pull/7522/commits/d9c2efcc)
2022-09-24 19:58:11 +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
berniev
0c70d45c83 Gui: Use override etc 2 2022-08-09 12:43:23 +02:00
wmayer
6ee2c7f865 Fix several clazy issues:
* C++11 range-loop might detach Qt container [-Wclazy-range-loop-detach]
2022-07-24 23:48:37 +02:00
andrea
3018985f80 Remove unused code into GUI 2022-07-17 03:53:11 +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
wmayer
a999a249e3 Qt: remove some more leftovers of Qt4 2022-03-19 23:27:28 +01:00
Uwe
8e6e3f47ff [Gui] Widgets and Window: remove unused includes 2022-02-21 00:39:24 +01:00
Uwe
dd5a681fd8 [Gui] remove unused headers 2022-02-19 03:41:28 +01:00
0penBrain
aed8864cd9 Modernize signal/slot connection for real :) 2022-02-08 17:51:36 +01:00
wmayer
4a18442e04 Gui: [skip ci] change placeholder text of ModifierLineEdit 2022-01-24 17:23:37 +01:00
wmayer
4f8ebf8d07 Gui: harmonize AccelLineEdit and ModifierLineEdit 2022-01-24 17:07:25 +01:00
0penBrain
fc269c6273 [Macro] Use a key catcher line edit to get modifier(s) for recent macros 2022-01-24 17:00:36 +01:00
0penBrain
410d835dfc Inline documentation fix 2022-01-24 17:00:36 +01:00
wmayer
66358a8e38 Gui: in AccelLineEdit use the provided placeholder text and enable the clear button 2022-01-24 15:46:53 +01:00
Dirk Olbrich
321c8b66ed [Core] set Backspace key as shortcut 2022-01-24 15:07:54 +01:00
wmayer
513d15886d Gui: move options to use native or Qt dialogs to class DialogOptions 2021-12-30 17:31:00 +01:00
mwganson
31175b5788 [core] Add new parameter to BaseApp/Preferences/Dialog called DontUseNativeColorDialog, default to true 2021-12-30 17:07:25 +01:00
wmayer
792277a848 Gui: add button group that allows to uncheck all buttons in exclusive mode 2021-11-22 23:00:30 +01:00
wmayer
563743e7e6 Gui: do not include generated ui file inside header file 2021-11-22 16:50:21 +01:00
Chris Hennes
23622c8e08 [Gui] Refactor StatefulLabel coloring 2021-10-12 11:23:13 -05:00
Chris Hennes
6bcda71712 Merge branch 'master' into sketcherMoveColorsToPrefs 2021-10-11 12:31:08 -05:00
Chris Hennes
70ad1396ea Gui: Add option to show alpha in QColorDialog 2021-10-10 20:17:44 -05:00
Chris Hennes
7237495d79 [Gui] Migrate UrlLabel to use QDesktopServices
UrlLabel predates QDesktopServices' ability to ask the host OS to launch
a URL, and resorted to a Python workaround that on Windows resulted in
launchin Internet Explorer regardless of the default system browser.
2021-10-10 11:12:36 -05:00
Chris Hennes
6858d938cc [Gui] Add ability for stylesheet to override prefs 2021-10-06 11:43:06 -05:00
Chris Hennes
224ffe37e2 [Gui] New widget supporting per-state styles
The new StatefulLabel widget is designed to be customizable by optional
preferences entries, Qt stylesheets, and default styles, set on a
per-state basis, where "state" is a Qt property that can be changed
dynamically at runtime.
2021-10-05 23:20:29 -05:00
Chris Hennes
c4878487ba [Gui] Add StatefulLabel 2021-10-02 22:15:47 -05: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