Open dlyongemallo opened 8 months ago
Hi, @dlyongemallo @RazinShaikh check this commit commit
show_error_msg
function to accept a parent parameter. This parameter is then used to specify the parent of the QMessageBox
so that the error message box is modal to the parent. show_error_msg
, i ensured to pass the parent parameter. This means I added a parent argument to the signature of those fucntions if it's not already there. I did modification in the function import_diagram_from_file
.The original problem of dialog windows being hidden behind the main window is now solved. I have renamed the issue as per @dlyongemallo 's suggestion. The following still needs to be updated:
In several dialog-showing functions, the parent parameter is sometimes typed QWidget and sometimes typed MainWindow, and it's sometimes the first parameter and sometimes the last. The API would be nicer if this was made consistent.
In Qt, the parent is always the first parameter, so that is probably the way to go. I think in general the parent should be the closest QWidget above it, and so the type should be QWidget.
In
dialogs.py
, the various dialogs don't always take aparent
parameter consistently. In particular,show_error_msg
doesn't take aparent
at all, and error messages can sometimes show up behind the main window which is rendered inactive, which is a confusing state for the user.Also: in other dialog-showing functions, the
parent
parameter is sometimes typedQWidget
and sometimes typedMainWindow
, and it's sometimes the first parameter and sometimes the last. The API would be nicer if this was made consistent.