Commit Graph

43 Commits

Author SHA1 Message Date
Kris Wilk
d1c04fd193 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
6175bdc985 Gui: Fix segfault in Expression Editor/VarSet 2024-10-02 20:31:20 -06:00
Chris Hennes
ea9f0c7a67 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
636fa43c99 MSVC: Fix warnings and build failure 2024-06-12 10:36:58 -05:00
Pieter Hijma
bfec0992f4 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
aa58cef2f9 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 (2f4cec5e8a5d) 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
246c24ec32 [Gui] modernize some UI connections 2023-01-30 18:11:37 -07:00
wmayer
09ae3b2ab8 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
b77ad300a2 Gui: support of range checks in DlgExpressionInput 2022-12-19 13:47:15 +01:00
berniev
ae53c9b0a4 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
2db561561e Gui: use empty 2022-08-06 16:35:45 +02:00
Uwe
c40e476a5b [Gui] remove some more superfluous nullptr checks 2022-07-18 13:15:38 +02:00
andrea
7886d3cbf4 Remove unused code into GUI 2022-07-17 03:53:11 +02:00
0penBrain
80f692ca9c Gui: if expression is emptied, pressing Enter discards expression 2022-04-06 13:42:18 +02:00
wmayer
1178df06b4 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
b7a6c51cdb [Gui] DlgEditor etc.: remove unused includes 2022-03-16 22:57:13 +01:00
Chris Hennes
098d7b9aee [GUI] Remove code for Qt < 5.9 2021-04-02 10:10:37 +02:00
Benjamin Nauck
d69bbaa51b [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
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
Christopher Coley
8d9d57d60d Gui: automatically activate the DlgExpressionInput dialog; fixes #4384 2020-09-04 18:39:09 +02:00
Thomas Gimpel
85846b7e58 Gui: automatically activate the DlgExpressionInput dialog; fixes #4384 2020-07-11 20:02:06 +02:00
wmayer
8dbe26a95f Qt5: 'int QFontMetrics::width' is deprecated since Qt 5.11: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
8a10b77400 Expression: move handling of invalid quantities (NaN) from FunctionExpression to DlgExpressionInput 2020-06-07 18:00:35 +02:00
wandererfan
10bc0c0875 [Gui]fix canConvert for Qt4 2020-05-10 07:14:12 -04:00
wmayer
66c3ba206b 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
685e22d23d [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
38c47d6e95 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
087349c07a 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
8b3ef8faf5 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
0735f612a6 by default disable the option NoSystemBackground to avoid possible OpenGL glitches 2019-02-12 21:47:50 +01:00
wmayer
fb7094bf31 use specialized exception classes 2017-04-28 18:49:11 +02:00
wmayer
a34c441373 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
2af6bb6e49 replace deprecated auto_ptr with unique_ptr 2016-09-22 13:01:20 +02:00
wmayer
2b8af7be1f + issue: #0002440: 0.16 Build rev 6395 Several display issues 2016-03-13 12:56:08 +01:00
wmayer
2dadb1f260 + do not hide expression dialog when using the line edit's context-menu 2016-03-12 22:35:36 +01:00
wmayer
f0e1df82ed + Allow to select item in completion box with mouse 2015-10-17 13:40:47 +02:00
wmayer
094b3b9d70 + remove SubWindow flag on OSX to put the expression input on top and get focus 2015-10-04 12:54:25 +02:00
wmayer
18434a36b9 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
9b273a723b + 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
0ecf7762a9 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
181e90471f first take on alternative expression ui input dialog 2015-09-26 19:09:07 +02:00
Eivind Kvedalen
12e79ba65c QuantitySpinBox: Fixed placement of expression editor pop-up. 2015-09-23 18:48:22 +02:00
Eivind Kvedalen
8e5619f7a0 Added expression support to QuantitySpinBox and InputField classes. 2015-09-21 14:51:08 +02:00