Commit Graph

45 Commits

Author SHA1 Message Date
Ladislav Michl
0907c7bfda Base: Units: return std::string 2024-12-23 17:48:42 +01: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
Kris Wilk
ffa1189634 Prevent using reserved names for properties or aliases (Fix #16846) (#16902)
* Prevent naming properties with reserved words (Fix #16846)

* Prevent using reserved constant names for properties or aliases

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* App: Add unit test for isTokenAConstant

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2024-10-03 10:03:10 -05:00
Pieter Hijma
eab82038ba Gui: Fix segfault in Expression Editor/VarSet 2024-10-02 20:31:20 -06:00
Chris Hennes
e52ef2a525 GUI: Update MacOS detection macros
For GUI-specific things use Q_OS_MACOS, and for other things use
Q_OS_APPLE.
2024-08-12 11:34:39 -04:00
wmayer
9b198c7704 MSVC: Fix warnings and build failure 2024-06-12 10:36:58 -05:00
Pieter Hijma
fc40c22ecc Core: Add VarSet support to expression dialog
This allows users to directly add properties to variable sets from
within the expression input dialog improving a workflow for
parameterized design.
2024-06-03 10:39:30 -05:00
wmayer
2cdc94e15c Gui: Fix using context-menu of ExpressionLineEdit
If for the DlgExpressionInput the user config parameter 'NoSystemBsckground' is set to True it's not used as a normal dialog but as a pop-up window.
In this mode the context-menu of the ExpressionLineEdit isn't working. A previous commit (a3036d16f1) fixed a crash but not this issue.

For Qt4 DlgExpressionInput has overridden the eventFilter() to handle using the context-menu but this is not working any more for Qt5 or Qt6.
Luckily, it has appeared that with Qt5 and Qt6 it works out-of-the box now and the event filter is not needed any more.
2024-03-11 16:04:00 +01:00
Uwe
8801836321 [Gui] modernize some UI connections 2023-01-30 18:11:37 -07:00
wmayer
81d2361d9f Gui: Qt6 port
* QString::indexOf() is now marked as [[nodiscard]]
* Replace deprecated methods of QMessageBox
* QMouseEvent::globalPos() is deprecated, use globalPosition().toPoint()
* QWidget::enterEvent() requires a QEnterEvent as argument
* QLibraryInfo::location() is deprecated, use path()
* QVariant::Type is deprecated, use QMetaType::Type
* QVariant::canConvert(int) is deprecated, use QVariant::canConvert(QMetaType) or QVariant::canConvert<T>()
* QMessageBox::standardIcon is deprecated, use QStyle::standardIcon()
* Replace deprecated method QMessageBox::question(), ...
* QApplication::fontMetrics() is deprecated
* QDropEvent::mouseButtons() is deprecated, use buttons()
* QDropEvent::keyboardModifiers() is deprecated, use modifiers()
* Constructor of QFontDatabase is deprecated, use static methods instead
* Qt::AA_DisableHighDpiScaling is deprecated
* Qt::AA_EnableHighDpiScaling is deprecated
* Qt::AA_UseHighDpiPixmaps is deprecated
2022-12-31 21:54:45 +01:00
wmayer
9cc78c4d9e Gui: support of range checks in DlgExpressionInput 2022-12-19 13:47:15 +01: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
d88729d2c4 Gui: use empty 2022-08-06 16:35:45 +02:00
Uwe
3e99d39d05 [Gui] remove some more superfluous nullptr checks 2022-07-18 13:15:38 +02:00
andrea
3018985f80 Remove unused code into GUI 2022-07-17 03:53:11 +02:00
0penBrain
bd832490e8 Gui: if expression is emptied, pressing Enter discards expression 2022-04-06 13:42:18 +02:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
eb0e8e215a [Gui] DlgEditor etc.: remove unused includes 2022-03-16 22:57:13 +01: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
luz paz
298c677873 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
Christopher Coley
4cfefb1938 Gui: automatically activate the DlgExpressionInput dialog; fixes #4384 2020-09-04 18:39:09 +02:00
Thomas Gimpel
2ae385fcb2 Gui: automatically activate the DlgExpressionInput dialog; fixes #4384 2020-07-11 20:02:06 +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
89ddab33f6 Expression: move handling of invalid quantities (NaN) from FunctionExpression to DlgExpressionInput 2020-06-07 18:00:35 +02:00
wandererfan
fdd99d2b28 [Gui]fix canConvert for Qt4 2020-05-10 07:14:12 -04:00
wmayer
8c9cdef2a9 Gui: [skip ci] use a widget's text property instead of casting to a specific subtype
This way DlgExpressionInput can be used together with the class InputField
2020-05-09 11:25:30 +02:00
0penBrain
ba4d70e7a4 [Expression] Default to current 'constant' value when editing if no expression set yet ; fixes #4298
Move signals connecting before value initialization so it's not needed to call them manually
 Only spin boxes implemented (should be the major usage)
2020-05-09 10:20:30 +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
9bf21592ce Gui: add warning to DlgExpressionInput
Warn when binding expression with unit to unit-less properties.
2019-08-30 15:52:03 +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
3b708c7f84 by default disable the option NoSystemBackground to avoid possible OpenGL glitches 2019-02-12 21:47:50 +01:00
wmayer
1673ab801e use specialized exception classes 2017-04-28 18:49:11 +02:00
wmayer
1cdee20953 Qt4/Qt5 neutral changes:
+ replace Q_WS_WIN with Q_OS_WIN
+ replace Q_WS_X11 with Q_OS_LINUX
+ replace Q_WS_MACX with Q_OS_MACX
+ set explicit cast to HWND
2016-12-12 14:09:21 +01:00
wmayer
f944ab3846 replace deprecated auto_ptr with unique_ptr 2016-09-22 13:01:20 +02:00
wmayer
18f0cc6346 + issue: #0002440: 0.16 Build rev 6395 Several display issues 2016-03-13 12:56:08 +01:00
wmayer
a2b1c3915f + do not hide expression dialog when using the line edit's context-menu 2016-03-12 22:35:36 +01:00
wmayer
b6c2f8f822 + Allow to select item in completion box with mouse 2015-10-17 13:40:47 +02:00
wmayer
c5246875b1 + remove SubWindow flag on OSX to put the expression input on top and get focus 2015-10-04 12:54:25 +02:00
wmayer
cff628737b To see if the DlgExpressionInput can be closed check if it's under the cursor
Add some test code to deal with modal dialogs on Windows
2015-09-27 16:56:44 +02:00
wmayer
309373c404 + fix transparent background for Windows systems
+ set application-wide event filter and handle mouse press events
+ fix expressPosition() to return exact position of line edit
+ fix warnings in ui file
+ use DlgExpressionInput as non-modal dialog in QuantitySpinBox
2015-09-26 19:36:11 +02:00
Stefan Tröger
ae033fc046 Fix usability bugs of new expression input
- click on background closes popup
- size on open is now correct if expression is set initially
2015-09-26 19:09:07 +02:00
Stefan Tröger
96998d390a first take on alternative expression ui input dialog 2015-09-26 19:09:07 +02:00
Eivind Kvedalen
28fe9b481d QuantitySpinBox: Fixed placement of expression editor pop-up. 2015-09-23 18:48:22 +02:00
Eivind Kvedalen
897f8b78b8 Added expression support to QuantitySpinBox and InputField classes. 2015-09-21 14:51:08 +02:00