Results 1 to 6 of 6

Thread: Qt Svg Module

  1. #1
    Join Date
    Jan 2010
    Location
    Turkey
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Qt Svg Module

    Hi guys

    I want to use QGraphicsSvgItems when modelling a visual object. So I inherit from QGraphicsSvgItem and reimplement paint.
    I want my visual object to have different behavior when IO interaction like mouse click occurs.

    For example lets assume I have a svg graphic that contains a red rectangle. When a mouse click occurs I want my rectangle to have flashing effect.(maybe animation or something like that)

    1- Can it be achieved in one svg file or multiple svg files.
    2- If it can be only achievd with multiple svg files will it be a poor choice because of loading svg files needs to access to disk again and again.

    Can someone help me about these issues?

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

    Default Re: Qt Svg Module

    Can what be achieved with one svg file? So far I don't see the use for multiple files here - you have an svg item and you wish to do something with it.
    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
    Jan 2010
    Location
    Turkey
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Svg Module

    yes I have svg items I wish to do something with them when a user interaction occurs. For instance when I click on svg item i want to change its background color. Is it possible with one svg file? How?

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt Svg Module

    Looks like you need to identify two sub-drawings in your SVG file and then use QGraphicsSvgItem::setElementId() to select the one you wish to have the item draw.

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

    Default Re: Qt Svg Module

    Quote Originally Posted by onurozcelik View Post
    Is it possible with one svg file? How?
    Paint the background and then render the svg.
    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.


  6. #6
    Join Date
    Jan 2010
    Location
    Turkey
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Svg Module

    ChrisW67

    I created sub-drawings and then use setElementId to select one it is working perfectly on static svg drawings. But when I use svg animation elements in svg drawing and then I use setElementId function to select animated drawing the animation does not work, the animation is working if it do not use setElementId

    wysota
    Interesting idea it will give a try

Similar Threads

  1. Zip module for Qt
    By arpspatel in forum Qt Programming
    Replies: 1
    Last Post: 28th October 2009, 06:34
  2. SVG module
    By mind_freak in forum Qt Programming
    Replies: 6
    Last Post: 21st August 2009, 05:01
  3. no phonon module :(
    By losiem in forum Installation and Deployment
    Replies: 2
    Last Post: 8th July 2008, 12:31
  4. How to get Module path.
    By phillip_Qt in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2007, 07:33
  5. SQL-Module
    By phil_ in forum Newbie
    Replies: 7
    Last Post: 22nd January 2006, 16:24

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.