Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Differences between CSS styling QDialog and QWidget
Forum Updated to NodeBB v4.3 + New Features

Differences between CSS styling QDialog and QWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 174 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Strangelove
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved