Results 1 to 9 of 9

Thread: 2 different custom paintevents are not working

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: 2 different custom paintevents are not working

    So you have two labels that draw the same data and you are surprised that they look identical?

    Cheers,
    _

  2. #2
    Join Date
    Jul 2014
    Posts
    32
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: 2 different custom paintevents are not working

    I found my mistake by trying it with another approach (promoting a custom class via the gui). I put all the globals into the custom label class and now every label has its own values. Damn i forgot about the the attributes of an objects.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: 2 different custom paintevents are not working

    You know, I asked you if the two instances had different data.
    A reasonable approach would have been to check that before answering yes despite the facts pointing to the opposite.

    Cheers,
    _

  4. #4
    Join Date
    Jul 2014
    Posts
    32
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: 2 different custom paintevents are not working

    I thought they were different. At least I thought that the MousePos were Screen Positions. Because the coordinates are based on the widget coordinates they are also appearing in the 2nd widget.

    And in my last reply I already said that I did a mistake.

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: 2 different custom paintevents are not working

    Quote Originally Posted by jho View Post
    I thought they were different. At least I thought that the MousePos were Screen Positions. Because the coordinates are based on the widget coordinates they are also appearing in the 2nd widget.
    No, that's not the cause at all.
    What the data contains is totally irrelevant.

    You are using the same list of points, literally the exactly the same data.

    Cheers,
    _

Similar Threads

  1. custom table model is not working
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 8th May 2012, 20:02
  2. PaintEvents() don't erase content before call
    By sagirahmed in forum Qt Programming
    Replies: 3
    Last Post: 12th October 2010, 05:44
  3. Qt Designer Custom Widget Not Working
    By davidpiedra in forum Qt Programming
    Replies: 0
    Last Post: 19th February 2010, 18:36
  4. Qt Designer Custom Widget Not Working
    By davidpiedra in forum Qt Programming
    Replies: 0
    Last Post: 19th February 2010, 18:30
  5. Help with getting my custom model working
    By thomaspu in forum Qt Programming
    Replies: 19
    Last Post: 29th July 2007, 18: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.