Results 1 to 3 of 3

Thread: addRect doesn't plot specific data

  1. #1
    Join Date
    Dec 2010
    Posts
    33
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    7

    Default addRect doesn't plot specific data

    I have a QGraphicsView *scene.
    I'm plotting rectangles in the scene using addRect(x,y,h,w,QPen,QBrush)
    I'm extracting this data from a file.
    The problem is that the code works fine for one file but doesn't plot anything at all for another.
    The file which is getting plotted has data:
    x:-312 y:0 h:474 w:15
    x:-398 y:20 h:398 w:15
    x:-395 y:40 h:444 w:15
    x:-309 y:60 h:431 w:15
    x:-299 y:80 h:477 w:15
    x:-322 y:100 h:461 w:15
    x:-400 y:120 h:393 w:15
    x:-378 y:140 h:434 w:15
    x:-286 y:160 h:454 w:15
    x:-345 y:180 h:464 w:15
    x:-350 y:200 h:467 w:15
    x:-302 y:220 h:421 w:15
    x:-291 y:240 h:459 w:15
    x:-279 y:260 h:431 w:15
    x:-271 y:280 h:428 w:15
    x:-276 y:300 h:439 w:15
    x:252 y:300 h:225 w:15
    x:-284 y:320 h:459 w:15
    x:259 y:320 h:266 w:15
    x:-398 y:340 h:395 w:15
    And the file which is not getting plotted is as follows:
    x:-400 y:0 h:220 w:15
    x:-179 y:0 h:220 w:15
    x:42 y:0 h:220 w:15
    x:263 y:0 h:219 w:15
    x:484 y:0 h:68 w:15
    x:-400 y:20 h:220 w:15
    x:-179 y:20 h:220 w:15
    x:42 y:20 h:220 w:15
    x:263 y:20 h:219 w:15
    x:484 y:20 h:68 w:15
    x:-400 y:40 h:220 w:15
    x:-179 y:40 h:220 w:15
    x:42 y:40 h:220 w:15
    x:263 y:40 h:219 w:15
    x:484 y:40 h:68 w:15
    x:-400 y:60 h:220 w:15
    x:-179 y:60 h:220 w:15
    x:42 y:60 h:220 w:15
    x:263 y:60 h:219 w:15
    x:484 y:60 h:68 w:15
    x:-400 y:80 h:220 w:15
    Is something wrong with the data of the 2nd file? I cant figure out the problem....

  2. #2
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 12 Times in 11 Posts

    Default Re: addRect doesn't plot specific data

    Did you try to track the values you pass to the addRect method? Data parsing seems to be the only area that you might experience problems with.

  3. #3
    Join Date
    Nov 2010
    Posts
    315
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanked 53 Times in 51 Posts

    Default Re: addRect doesn't plot specific data

    You are doing data loading and apparently this is a problem. We don't see your code so we have no idea what is wrong here. I suspect that you have some error with file (incorrect file name - error with opening the file).
    1. check qt logs - there you can see clues what can be wrong (run it form IDE to see it)
    2. use debugger to check what is the problem
    3. when nr 1 and 2 fails show your code

Similar Threads

  1. Replies: 2
    Last Post: 5th September 2010, 14:06
  2. Simple Plot after Inputing some Data
    By thebrute in forum Qwt
    Replies: 0
    Last Post: 18th August 2010, 14:29
  3. Replies: 1
    Last Post: 23rd January 2010, 22:04
  4. 2D array data plot!
    By kahramonj in forum Qwt
    Replies: 3
    Last Post: 21st March 2009, 11:48
  5. plot only subset of the data
    By pospiech in forum Qwt
    Replies: 3
    Last Post: 14th April 2008, 21:19

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.