Results 1 to 9 of 9

Thread: Drawing over a button

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Awareness Guest

    Default Re: Drawing over a button

    Thanks for your answer.

    Maybe this image can explain my question better:


    paint2.jpg


    How can I do this using QPainter?Please click on the image (to make it larger), in small version the red line's borders are not visible clearly.
    Last edited by Awareness; 16th October 2013 at 01:57.

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Drawing over a button

    One way i can think of is to have the button embedded in QGraphicsScene as QGraphicsProxyWidget (via QGraphicsScene::addWidget). Then you can draw whatever you want on it with QPainter.

  3. The following user says thank you to stampede for this useful post:


  4. #3
    Awareness Guest

    Default Re: Drawing over a button

    Actually,after I sent my previous message with picture,I thought it was not a good idea to do it like I do it in the picture(at least for my current little project) and I used ChrisW67 's code in his reply,it is working good.But I didn't take my last question back,because I thought I may need the answer in the future and also I wondered if it was possible to do it in Qt.Thank you both ChrisW67 and stampede for your answers.

Similar Threads

  1. Replies: 2
    Last Post: 26th April 2011, 11:44
  2. Replies: 5
    Last Post: 26th January 2011, 19:12
  3. Replies: 6
    Last Post: 21st August 2010, 21:09
  4. Replies: 1
    Last Post: 2nd August 2010, 05:40
  5. drawing a 3d button in 2d view
    By wagmare in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2009, 13:02

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.