Results 1 to 4 of 4

Thread: How do I change the color of arc & text in QwtDial ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default How do I change the color of arc & text in QwtDial ?

    I'm trying to create a custom dial (CDial) using QwtDial. The purpose of this is to show the analog meter for some attributes. Now that I've created a dial, I want to change the color of the arc drawn around the scale & also the scale itself. Below is the style code and also the snapshot of it.

    Qt Code:
    1. void CDial::fnSetFeatures()
    2. {
    3. setReadOnly(true);
    4. setFrameShadow(QwtDial::Raised);
    5. setWrapping(false);
    6.  
    7. setStyleSheet("background: white; color: qradialgradient(cx: 0.3, cy: -0.4, fx: 0.3, fy: -0.4, radius: 1.35, stop: 0 #fff, stop: 1 #888);");
    8.  
    9. setTracking(true);
    10. setRange(0, MAG_A_MAX);
    11. setScaleArc(0, 220);
    12. setScale(MAG_A_MAX/10, MAG_A_MAX/10, 100);
    13. setOrigin(150);
    14. setScaleTicks(0, 4, 8);
    15. setMass(0.1);
    16.  
    17. oNeedle = new QwtDialSimpleNeedle(QwtDialSimpleNeedle::Arrow, true, Qt::darkGray,
    18. QColor(Qt::gray).light(130));
    19. oNeedle->setWidth(10);
    20. setNeedle(oNeedle);
    21. }
    To copy to clipboard, switch view to plain text mode 
    CDial.JPG

    Please help me code the arc color and text color. Thank you.
    Last edited by rawfool; 16th July 2012 at 10:15.

Similar Threads

  1. change text color on QRadioButton
    By vonCZ in forum Newbie
    Replies: 4
    Last Post: 7th November 2012, 20:05
  2. Change text color in QTableWidgetItem
    By npascual in forum Qt Programming
    Replies: 0
    Last Post: 10th May 2011, 17:03
  3. Replies: 3
    Last Post: 22nd January 2010, 16:46
  4. how to change text color in QTableView?
    By phillip_Qt in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2008, 10:03
  5. Change the text color tab page
    By gtthang in forum Qt Programming
    Replies: 4
    Last Post: 18th February 2006, 17: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.