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.
Closes#12785. The cause of the segmentation fault is access to the
already deleted _QMenu_. Simple setting attribute `Qt::WA_DeleteOnClose`
and removal of `delete menu` prevented it. To reproduce the crash, one
needs to mess up the `user.cfg` file in the way described in the issue.
Here is the fragment from the issue to mess up the `user.cfg` file:
```xml
<FCParamGroup Name="Expression">
<FCText Name="EditorTrigger">=</FCText>
<FCBool Name="AntoHideEditorIcon" Value="1"/>
<FCBool Name="NoSystemBackground" Value="1"/>
<FCInt Name="EditDialogBGAlpha" Value="1"/>
<FCInt Name="EditDialogWidth" Value="300"/>
<FCInt Name="EditDialogHeight" Value="214"/>
<FCInt Name="EditDialogTextHeight" Value="35"/>
</FCParamGroup>
```
---
This commit changes also unconnected things:
- usage of `QObject::connect` instead of if statements
- relocation of a separator and an action inside the if statement (I saw
no reason to have a separator and an action for _ExpressionCompleter_ if
there is no expression completer)
- usage of asynchronous `QMenu::popup()` instead of synchronous
`QMenu::exec()`. This way is used within [the source code of Qt]
(https://github.com/qt/qtbase/blob/5.15/src/widgets/widgets/
qlineedit.cpp#L2191-L2197).
The commit 028739df caused a regression by breaking MinGW builds because the line
'#if defined(__MINGW32__)' has been removed.
As a result the 'if defined (FC_OS_WIN64) || defined (FC_OS_WIN32)' has become active
where the types '__int64' or 'unsigned __int64' that are not defined for MinGW
* Updated ts files
* Merged crowdin translations
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Some instances of TimeInfo serve the sole purpose of measuring time
duration. Using system time is unfortunate as it returns wall clock,
which is not guaranteed to be monotonic. Replace such a usage with
the new TimeElapsed class based on steady clock.