Results 1 to 5 of 5

Thread: hovering problem in QGraphicsItem

  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default hovering problem in QGraphicsItem

    hi friends,
    i tried an QGraphicsPixmapItem() hovering method like the
    example : drilldown

    i add that item to my QGraphicsScene and its working fine ...... i add that GraphicsView to a dialog say .. mainwindowdialog ...
    there also it works fine .. when i hover the mouse over the item it scaled perfectly ..

    the problem starts when i set styleSheet to mainwindowdialog in Qt designer
    right click->changeStyleSheet
    background-color: rgba(107, 121, 118, 220);

    then the scaling of the item become slower comparing to the previous time ... i think the paintEvent takes more time to repaint with the new color value when the mouse hover over the item ...
    i need to set the background color ... so how can i rectify this problem ...
    please help

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: hovering problem in QGraphicsItem

    Don't use stylesheets, use the palette.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: hovering problem in QGraphicsItem

    Quote Originally Posted by wysota View Post
    Don't use stylesheets, use the palette.
    thanks for reply ...
    i will change it to QPalette ... but why..not stylesheet ?

  4. #4
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: hovering problem in QGraphicsItem

    thanks ... it works fine ...
    widget->setPalette(QColor) works fine ... now the rendering speed is normal as previous ... but what is the difference b/w using stylesheet and QPalette in rendering paintEvent ...

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: hovering problem in QGraphicsItem

    Stylesheet is slower, there is more work involved in it. If you can do something using a palette, use palette.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Having problem with QGraphicsItem
    By Kingofhearts_sri in forum Qt Programming
    Replies: 4
    Last Post: 23rd January 2009, 19:10
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. Problem with rotation of QGraphicsItem
    By ashishsaryar in forum Qt Programming
    Replies: 2
    Last Post: 10th July 2008, 15:03
  4. Paint QGraphicsItem problem
    By dreamer in forum Qt Programming
    Replies: 3
    Last Post: 23rd June 2008, 18:18
  5. QGraphicsItem problem - how to save items info ??
    By aamer4yu in forum Qt Programming
    Replies: 3
    Last Post: 17th October 2006, 12:17

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.