Commit Graph

50 Commits

Author SHA1 Message Date
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
Chris Hennes
50c7ee36bf [GUI] Remove code for Qt < 5.9 2021-04-02 10:10:37 +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
Chris Hennes
a5c0ac6d16 [GUI] Make UrlLabel in About styleable
The UrlLabel in the About FreeCAD box was not styleable because its
rich-text contents overrode any styling applied to it. This commit
converts it to a plain text label that can then be styled in a
stylesheet using the Gui--UrlLabel selector. If no stylesheet is
applied, the UrlLabel styles itself using the old-school blue text with
an underline, but any applied stylesheet completely overrides this
default.

This does not affect the "clickability" of a UrlLabel widget, which is
handled independently of the label's content (including its textual
hyperlink, which was and still is ignored).
2021-03-02 16:45:03 +01:00
wmayer
a99a601948 Gui: [skip ci] Fix Qt warning 'Unable to set geometry ...' 2020-12-09 16:22:14 +01:00
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
wmayer
571ab1b6e6 Qt5: make StatusWidget derive from QDialog instead of QWidget to avoid code duplication and using deprecated API functions 2020-10-18 14:45:31 +02:00
wmayer
2c113442a7 Qt5: 'void QTime::start()' / 'int QTime::elapsed() const' / 'int QTime::restart()' are deprecated: Use QElapsedTimer instead [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
1ee3d79d7c Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
3f212ad8ac Porting Py3.8/Py3.9:
Since Py3.3: 'Py_ssize_t PyUnicode_GetSize(PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'PyObject* PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*)' is deprecated [-Wdeprecated-declarations]
Since Py3.9: 'void PyEval_InitThreads()' is deprecated [-Wdeprecated-declarations]
2020-06-12 17:51:33 +02:00
wmayer
d195cd5c98 Qt5: 'Qt::DropAction QDrag::start(Qt::DropActions)' is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations] 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
52bee70c6d Gui: [skip ci] fix ColorButton to pre-select current color in dialog 2020-03-16 09:46:09 +01: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
f14dfd41cd Gui: fix ExpLineEdit::apply()
ExpLineEdit was originally created for editing PropertyString with
optional expression. It has since been extended to be used by any type
of property.
2019-10-07 17:24:31 +02: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
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
wmayer
b852d1490e add method to check if key sequence is none 2019-01-18 00:54:49 +01:00
wmayer
8358d7f876 Qt5: don't use native color dialog 2019-01-03 16:14:12 +01:00
wmayer
583917dc17 fix several bugs in LabelEditor to handle PropertyStringList 2018-12-20 23:20:23 +01:00
Peter Lama
556d68680e Fix macOS button layout in property editor
The size of the "..." button calculated by QMacStyle was not correct,
causing other widgets in the layout to be clipped.

Also, set the size of all "..." buttons the same way.
2017-09-26 10:56:55 -03:00
Peter Lama
76474951d2 Attacher UX enhancements
- New editor for MapMode with button to open attacher dialog
- Hide attachment properties when they are not applicable
- Disable super placement ui in attacher dialog when object is not attached
- Always select used mode in mode list
2017-09-20 19:24:35 +02:00
wmayer
44e5ee4da6 fix clang warning: -Wunused-private-field 2017-04-22 15:55:18 +02:00
wmayer
bd23414dcf fix build failure 2017-04-22 15:23:21 +02:00
wmayer
0335e2a21c Extend task panel for filling function 2017-04-22 14:46:26 +02:00
wmayer
5b0c93f57c add lineedit class with clear button 2017-04-22 11:11:13 +02:00
wmayer
d2cb4e4af9 Qt4/Qt5 neutral changes:
+ remove QCoreApplication::UnicodeUTF8/QApplication::UnicodeUTF8
+ remove QCoreApplication::CodecForTr/QApplication::CodecForTr
2016-12-12 14:52:09 +01:00
wmayer
ddd4c4560c support to auto change color when color dialog is modal 2016-10-02 19:57:01 +02:00
wmayer
f19d424d8b fix -Wextra in FreeCADGui 2016-09-21 20:54:52 +02:00
wmayer
3f9fd3d54f avoid expensive fromUtf8 method where not needed 2016-09-21 11:42:23 +02:00
Yorik van Havre
cc167bd2c8 Allow to edit PropertyLists directly in the property editor - fixes #2535,#2689 2016-09-05 13:25:32 -03:00
wmayer
8e71e4038b fix Coverity issues 2016-08-21 23:13:22 +02:00
Yorik van Havre
a38a78f6d6 Allow to enter empty values in PropertyFloatList and PropertyIntegerList - issue #2535 2016-04-29 23:00:11 -03:00
Mateusz Skowroński
7d0e892d36 Qt4's qglobal.h defined TRUE and FALSE. Qt5 does not do it anymore. Replace it with true and false.
158f39ec78

This change is Qt4/Qt5 neutral.
2016-01-05 16:43:33 +01:00
Mateusz Skowroński
3b463f2138 Qt::WFlags is obsolete in Qt5. Replace it with Qt::WindowFlags.
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:58 +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
Mateusz Skowroński
d5c074f80d QString::toAscii() is obsolete in Qt5. Replace it with toLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:06:48 +01:00
Mateusz Skowroński
c2a31fe04b qVariantValue() is obsolete in Qt4. Replace it with equivalent QVariant::value<T>(value).
This change is Qt4/Qt5 neutral.
2015-12-24 12:49:26 +01:00
wmayer
28a142d94e + alternative paintEvent implementation for ColorButton 2015-06-30 01:04:43 +02:00
wmayer
c1823efe38 + fix build failure 2014-12-16 17:06:05 +01:00
wmayer
5aac822c71 + issue #0001038: Improve and show List properties in Tree View 2014-12-16 14:31:36 +01:00
wmayer
6e5118c9c8 + fixes #0001038: Improve and show List properties in Tree View 2014-12-15 23:54:55 +01:00
Simon Pasquet
55cf9ddeaa Customized keyboard shortcuts now accept up to 4 keys 2014-08-26 10:31:54 -03:00
wmayer
0b6c21c716 + Fix icons names 2013-11-14 19:00:51 +01:00
wmayer
0623cd9b5e Use ActionSelector in Loft panel and expose to Python by UiLoader 2012-06-03 14:22:05 +02:00
wmayer
5174778cc0 0000719: Implement a KActionSelector-like widget 2012-06-03 12:11:38 +02:00
wmayer
3858f8a268 Start implementing ActionSelector class 2012-06-03 01:26:55 +02:00
wmayer
2549b555bc doing merge 2012-04-26 15:10:48 +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