Differences between CSS styling QDialog and QWidget
-
I have a custom QGroupBox which is displayed as a rectangle on top of my main interface, with a fade-in/out animation. It has some controls such as QLineEdit and QSpinBox. It also has a single QPushButton.
I've been having a lot of trouble making this QPushButon trigger when the user presses Enter.
I've then read that
setDefault()only works with QDialog so I simply changed my class' inheritance from QGroupBox to QDialog and the Enter key works as expected.Problem is, the box is no longer a fixed rectangle in my interface, but a modeless independent window floating outside the main window. Although it's still styled according to my CSS rules, it has an extra border from the OS and can be moved freely (something I'd rather avoid).
Is there a way to make a QDialog appear like my QGroupBox appeared so I can keep the Enter keyboard behavior for the QPushButton?
Thanks.