Results 1 to 6 of 6

Thread: paintEvent problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default Re: paintEvent problem

    thnx...

    btw suppose i still want to use QPainter's and QWidgets schema....

    is it possible from QWidget :: paintEvent() to trigger using SIGNALs and SLOTs each myCustomPaintEvent of each entity?? ex. myShape :: myCustomPaintEvent() ???


  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: paintEvent problem

    You can create one widget subclass for each shape you want to draw.
    This is the easiest way if you want to use widgets for this.

    Or you can create a single QWidget subclass with methods that draw all the shapes you need, taking as parameter a QPainter pointer. Also you have to add an enum specifying the shape type.
    In the paint event of this widget you can test the shape type and call the right method.

Similar Threads

  1. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 11:35
  2. Replies: 3
    Last Post: 27th November 2006, 10:56
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 15:08
  4. Replies: 16
    Last Post: 7th March 2006, 16:57
  5. Problem with QScrollArea updating from 4.0.1 to 4.1.0
    By SkripT in forum Qt Programming
    Replies: 8
    Last Post: 28th January 2006, 23:35

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.