Results 1 to 4 of 4

Thread: Trying to create custom QDial

  1. #1
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Trying to create custom QDial

    Guys,

    I am trying to create custom QDial using Style Sheet. I was able to do it successfully with QSlider, but QDial does not work. I have read some where that QDial doesn't support stylesheet in full form. I want a confirmation to that if you know more about it. I am using Qt 4.6.

    I am able to set the color of QDial but, cannot set the background image. Below is style sheet code which I am using.

    QDial{
    color:red; /*this works*/
    background-image: url(:/Resources/bckgrnd.png); /*this doesn't */
    }

    Any help is appreciated.

    Thanks

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Trying to create custom QDial

    why do you need red background if you put an image on your QDialog?

  3. #3
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Trying to create custom QDial

    this color:red is the color of notches that would be drawn along the dial.
    background-color:red is to set the background color.

  4. #4
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Trying to create custom QDial

    I think I will have to subclass QDial and overload paintEvent(). I am able to achieve desired behavior doing so. Wanted to use Stylesheet for this. Let me know if you have a solution with Stylesheet.
    Thanks

Similar Threads

  1. How to create Custom Slot upon widgets
    By ashukla in forum Qt Programming
    Replies: 6
    Last Post: 8th September 2007, 14:07
  2. create custom widgets
    By nimmyj in forum General Discussion
    Replies: 1
    Last Post: 20th November 2006, 08:24
  3. How to create a custom Button?
    By Mister_Crac in forum Qt Programming
    Replies: 18
    Last Post: 22nd October 2006, 23:59
  4. QDial
    By mickey in forum Newbie
    Replies: 4
    Last Post: 18th June 2006, 12:01
  5. How to create custom slot in Qt Designer 4.1?
    By jamadagni in forum Qt Tools
    Replies: 31
    Last Post: 18th January 2006, 20:46

Tags for this Thread

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.