Results 1 to 10 of 10

Thread: Multiple inheritance of QGraphicsView and QGraphicsItem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    21
    Thanks
    11
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Multiple inheritance of QGraphicsView and QGraphicsItem

    I'm writing a program that contains a table of buttons, each button has the ability to blink, and if it's clicked, all buttons underneath the clicked button (in the same column) should be moved down.

    Initially, I was able to do this if all buttons of one column are in the same QGraphicsView. However one blinking button requires re-painting of the whole view, which results in taking up ~17% CPU. So I changed my code to put one button in a QGraphicsView; then put all the ButtonViews in another QGraphicsView (i.e. the button itself is a graphics item for animation as well as a view). Now one blinking button only takes up 9% CPU, but the animation no longer works.

    I'm guessing there must be something wrong with my design, and hoping the Qt experts could help me with a better one.

    I've attached the code here. I use Qt 4.5.3 under Unix/X11
    Attached Files Attached Files
    Last edited by cookie1909; 4th May 2009 at 18:17. Reason: removed inline code

Similar Threads

  1. QGraphicsView, QGraphicsItem, QGraphicsScene
    By Shuchi Agrawal in forum Newbie
    Replies: 10
    Last Post: 23rd March 2011, 20:50
  2. Replies: 5
    Last Post: 31st December 2010, 11:49
  3. destruction of QGraphicsItem
    By killkolor in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2009, 10:31
  4. Replies: 2
    Last Post: 12th February 2009, 09:53
  5. (QT4.2-RC1) QGraphicsScene QGraphicsView QGraphicsItem
    By antonio.r.tome in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 10:56

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.