-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[processing] Show a modal progress dialog when running algorithms
which cannot run in background tasks This is not fantastic UX, but we have lots of constraints here: - The algorithm dialog itself cannot be made modal. There's child widgets (such as the point and extent parameter widgets) which interact with the main QGIS window. - There is no reliable way in Qt to make a dialog modal after it's shown (e.g. make it modal only when the algorithm is running). Trust me - I've tried everything, and all approaches break with some corner case. - For non-background algorithms, we must have processEvents calls in order to show the algorithm feedback and progress to users, and detect cancel button clicks. Yet these processEvents calls means that users can interact with other parts of QGIS, e.g. removing layers from a project, and other operations which could cause the algorithm to crash. So we MUST have some modal dialog in order to block interactions outside of allowing the cancel button clicks/progress repainting. I've tried many approaches, but this is the only one which works reliably...
- Loading branch information
1 parent
2eb68de
commit 240c52a
Showing
5 changed files
with
180 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/ui/processing/qgsprocessingalgorithmprogressdialogbase.ui
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>QgsProcessingProgressDialogBase</class> | ||
<widget class="QDialog" name="QgsProcessingProgressDialogBase"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>1603</width> | ||
<height>1239</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Dialog</string> | ||
</property> | ||
<property name="sizeGripEnabled"> | ||
<bool>true</bool> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QTextEdit" name="mTxtLog"> | ||
<property name="readOnly"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0"> | ||
<property name="topMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<widget class="QProgressBar" name="mProgressBar"> | ||
<property name="value"> | ||
<number>0</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="mButtonBox"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |