Results 1 to 8 of 8

Thread: Native vs Raster

  1. #1
    Join Date
    Nov 2009
    Posts
    22
    Thanks
    2

    Default Native vs Raster

    Greetings,

    Today I encountered a problem in my project (using Qt 4.6.0 under Linux), and later I noticed that setting the '-graphicssystem' option to 'raster' was the root cause. I also ran the diagramscene example with 'raster' setting to see if I get similar results because that part of my project is similar to the Qt example diagramscene.

    Running diagramscene, if you create two items and connect an arrow from one to the other, and then move one of the items across and over the other, the arrow disappears. Moving the item will not bring the arrow back; you'll have to click on the item that you didn't move originally. This happens if you set the graphicssystem option to 'raster'. Setting it to 'native' works fine and the arrow doesn't disappear forever.

    I have a very similar problem in my project. If I click on the item to initiate a line draw, but before connecting it to the next item, only a small portion of the line is drawn. The other end of the line right under the mouse pointer moves as it should, but it's not visible; only the end attached to the item is drawn. Again, this only happens in 'raster' mode, not 'native'.

    I don't have to have it set to 'native', but it does appear to be little faster. At first I thought I was doing something wrong, till I tried the diagramscene demo in 'raster' mode. Does anyone know a fix to this problem other than not running in 'raster' mode? And can someone also explain this behavior?

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Native vs Raster

    If you see differences between two different graphics backends, it is either a bug in your code or a bug in the graphcissystem. I tested the diagrammscene example here on my mac with both the native graphics backend and raster. I see the behaviour you describe that the arrow disappears in both of them when moving the arrow around. However, I think it is not a bug in the graphicssystem but in the graphicsview. See whether you can confirm what I observe:

    I created two square objects a and b and connected them with a line. Lets say a is in the center of a clock and we move b around. Assuming that b is at 11 o'clock: When moving from 11 over the center to 4 o'clock, the arrow dissappears. When moving back along the same line, the arrow is shown again. When moving back in a circle shape clockwise or counter clockwise, the arrow appears again when passing 6/12 o'clock.

    When moving around the clock, the arrow stays visible all the time.
    It's nice to be important but it's more important to be nice.

  3. #3
    Join Date
    Nov 2009
    Posts
    22
    Thanks
    2

    Default Re: Native vs Raster

    What you described is what I was trying to explain; the arrow basically disappears when in raster mode.

    The software rasterizer "is the reference implementation and the only paint engine that implements all possible feature combinations that QPainter offers." I find it hard to believe that the bug is in the raster implementation, but you never know. Also, I was under the impression that the raster mode is the default, but on my system it seems that the native mode is the default, which explains why I have never noticed this bug in diagramscene or in my project.

    I can't verify that the bug is in the raster implementation, so I'm going to assume that the bug is in diagramscene. I'll be playing with it to see if I can get it fixed, which in turn might give me the fix for my project.

    axeljaeger, could you also tell me your version of Qt?

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Native vs Raster

    I used Qt-4.6.1 on a mac.
    It's nice to be important but it's more important to be nice.

  5. #5
    Join Date
    Nov 2009
    Posts
    22
    Thanks
    2

    Default Re: Native vs Raster

    I fixed the bug in diagramscene. All I had to do was add this line to DiagramItem constructor:
    Qt Code:
    1. setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
    To copy to clipboard, switch view to plain text mode 

    Before that the DiagramItem::itemChange() wasn't getting called when moving an item.

    I don't know why I thought this bug was only active when in raster mode. It is active in both, but the bug that I have is active only in raster mode.

  6. #6
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Native vs Raster

    Probably this was a behaviour change between Qt 4.5 and 4.6. I read that they did something like this to improve performance. However, the example should be fixed then in the distribution also: May you write a bug report for that example?
    It's nice to be important but it's more important to be nice.

  7. #7
    Join Date
    Nov 2009
    Posts
    22
    Thanks
    2

    Default Re: Native vs Raster

    Someone has already made a bug report: http://bugreports.qt.nokia.com/browse/QTBUG-7646
    It's about two weeks old. I wonder if there is a better fix than what I have.

  8. #8
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Native vs Raster

    You can vote for that bug or add a comment that you encounter the same problem.
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. using native kde-dialogs
    By #andi# in forum Newbie
    Replies: 2
    Last Post: 11th August 2009, 10:50
  2. Native QFileDialog
    By bgougeon in forum Qt Programming
    Replies: 3
    Last Post: 6th June 2009, 01:33
  3. MS Sql native driver??
    By LordQt in forum Qt Programming
    Replies: 4
    Last Post: 9th October 2007, 13:41
  4. Native Mac Address
    By genny77 in forum Qt Programming
    Replies: 3
    Last Post: 4th August 2007, 10:02
  5. Can Native Api be Used?
    By iGoo in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2006, 11:44

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.