Results 1 to 3 of 3

Thread: how to subclass a qwidget in ui file

  1. #1
    Join Date
    Jul 2015
    Posts
    26
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default how to subclass a qwidget in ui file

    I made a ui file with designer. It has a push button ui.btnOK.
    But in my application I need to create a new class
    class MyButton : QPushButton
    {
    };
    to replace ui.btnOK. How do I do it?

    Thanks for your help.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,316
    Thanks
    314
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to subclass a qwidget in ui file

    Reading the Qt Designer docs might be a good place to start.

  3. #3
    Join Date
    Jul 2015
    Posts
    26
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to subclass a qwidget in ui file

    got it. Thanks a lot

Similar Threads

  1. QWidget subclass drawing in wrong place
    By guidupas in forum Qt Programming
    Replies: 13
    Last Post: 7th June 2014, 15:03
  2. Replies: 3
    Last Post: 25th September 2012, 20:11
  3. When is the geometry of a QWidget subclass set?
    By Luc4 in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2011, 21:14
  4. Replies: 4
    Last Post: 17th January 2011, 13:05
  5. Replies: 2
    Last Post: 1st January 2008, 13:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.