-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rtf popup QMainWindow #3
Conversation
src/newstuff/rtfPopup.cpp
Outdated
@@ -8,18 +8,18 @@ | |||
|
|||
#include "../interop/QtDotNetConverters.h" | |||
|
|||
RtfPopup::RtfPopup(System::String^ rtfText, QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f) | |||
RtfPopup::RtfPopup(System::String^ rtfText, QWidget* parent, Qt::WindowFlags f) : QMainWindow(nullptr, f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we still take the parent argument if we're always using nullptr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the parameter and use it but now I pass nullptr
explicitly when needed so that we can still pass other parents.
New set of questions now I've tried this out:
|
You can add a
I think the problem is that the Rtf popup does not have a parent. As you mentioned in the linked issue, we would probably need to create a custom hierarchy (with a "fake" widget) to fix this. Maybe it's not a bad idea to have the "init" dialog show in permanence and use it as parent for all dialog but the Rtf popup? |
If I'm reading things correctly, keeping the init dialog around would only fix the DarNified UI stuff, not the readme stuff. |
It would make the readme popup stay on top of the main window but other dialogs will be put on top of it (but not modal). |
I don't see any reason why it would. Can you explain (or open another PR proving me wrong)? |
That's how I understand Qt documentation. Currently, the readme dialog has no parent, and it's Window modal, so it does not actually block anything and when a new Window modal dialog (or application modal) dialog with a parent is shown, everything is put on top of the readme dialog (the new dialog + the parent). If we set the parent of the readme dialog to You want the readme dialog and the init dialog to be "cousin", which may require adding a fake invisible widget in the hierarchy, and then have the other install dialogs be children of the init dialog, something like (maybe we don't need both fake widgets):
|
I think I see what you're driving at now. With extra dummy widgets in the hierarchy, what you're saying makes more sense, but I thought you were suggesting an alternative to using dummy widgets. I don't think we want the readme dialogue to actually be modal, though. For example, at least one mod I've got in my test suite installs, but doesn't try to activate, several optional ESP files, and what they do is described in the readme. Users will probably want to be able to enable them in the plugins tab while they still have the readme open. I think the ideal outcome would be if it floated on top of MO2 without being modal, a bit like running task manager with Always on top on, except obviously we'd want to let non-MO2 windows cover it. |
popup.show(); | ||
QEventLoop loop; | ||
connect(&popup, SIGNAL(closed()), &loop, SLOT(quit()), Qt::DirectConnection); | ||
loop.exec(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New question. The popup's constructor sets WA_DeleteOnClose
, but it's stack-allocated here. Is there anything guaranteeing we don't end up with a double-free?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never encountered issues with this when testing but I did not manage to find a clear answer for this in Qt documentation so it's probably better to move the setAttribute
outside of the constructor.
Catch and rethrow .NET exceptions in OMODFrameworkWrapper constructor
Based on
frednet
, tested:new_omod_2
withDisplayText
- The popup is modal as expected (had to add aQEventLoop
).WindowModal
.