Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Solved]painting a widget inside a subclass of QAbstractButton
QtWS25 Last Chance

[Solved]painting a widget inside a subclass of QAbstractButton

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 2.3k Views
  • 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
    sinjar
    wrote on last edited by
    #1

    Can I set a custom widget to display inside a QAbstractButton.. if yes then where do i put it.. in the constructor and set the parent as "this", then i guess i dont need to do anything in paintEvent() assuming i dont need to draw borders, etc...

    or is it better to implement mouse press event in my widget directly..
    then in this case how do i paint it to highlight in the same way as a normal push button would do?? (ie the native highlighting scheme of buttons pressed-- that depends on the theme etc)..

    PLEASE ADVISE..

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sinjar
      wrote on last edited by
      #2

      inheriting from QPushButton did the job.. ;)

      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