Results 1 to 4 of 4

Thread: Custom SpinBox

  1. #1
    Join Date
    Mar 2006
    Posts
    4
    Thanks
    1

    Default Custom SpinBox

    I need to customize the drawing for the QSpinBox. I implemented the paintEvent method in my subclass but the base class QSpinBox insists on drawing a small borderless rectangle over part of my drawing. How do I stop this?

  2. #2
    Join Date
    Feb 2006
    Location
    Boulder, Colorado, USA
    Posts
    63
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Custom SpinBox

    Try spinbox>setFrame(false);

  3. #3
    Join Date
    Mar 2006
    Posts
    4
    Thanks
    1

    Default Re: Custom SpinBox

    Thanks. Tried that but it didn't help. I don't understand why this is happening. The QSpinBox must be creating a child widget that is doing the drawing. Is there some way to intercept paint events going to the children of a widget?

  4. #4
    Join Date
    Mar 2006
    Posts
    4
    Thanks
    1

    Default Re: Custom SpinBox

    AHA! It was the QSpinBox's QLineEdit object. I just moved the QLineEdit over to the proper location for my custom SpinBox and all is well.

Similar Threads

  1. Custom Widget - First Steps
    By sekatsim in forum Qt Programming
    Replies: 8
    Last Post: 26th June 2008, 17:19
  2. Replies: 2
    Last Post: 16th May 2008, 14:39
  3. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 14:06
  4. Custom proxy model issue
    By Khal Drogo in forum Qt Programming
    Replies: 13
    Last Post: 30th November 2007, 12:41
  5. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.