Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: erratic behavior of graphics items

  1. #1
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default erratic behavior of graphics items

    Hello forum,

    Please Check the attached image. Screenshot-1.jpg. You can see that two elliptical items are connected by an arrow graphics item.

    If the user clicks the small ellipse inside the large ellipse an arrow item is instantiated. The arrow item is extended with the mouse move and mouse release event.

    I also have over-ridden the following function so that the arrow is adjusted even after the position changes of the elliptical items.

    Qt Code:
    1. QVariant H3DHierarchyArrowDockGraphicsItem::itemChange(GraphicsItemChange change, const QVariant &value)
    2. {
    3. switch(change)
    4. {
    5. case ItemPositionHasChanged:
    6. foreach(H3DHierarchyArrowGraphicsItem *arrow, m_hierarchyArrowList)
    7. arrow->adjust();
    8. break;
    9. default:
    10. break;
    11. }
    12.  
    13. return QGraphicsItem::itemChange(change,value);
    14. }
    To copy to clipboard, switch view to plain text mode 



    But at some point i get the following output while moving the items inside the scene.
    Bizarre.jpg



    As you can see the arrow is totally detached from the destination item. And the arrow is attached back while moving the elliptical items - not so pleasant behavior, is it?

    To get a functional one i have taken hint from elastic nodes, diagram scene example and voreen editor( Qt based volume rendering editor), but it seems that i have missed some ideas to get it right.

    To provide me with useful hint i am also attaching the corresponding source files that you need to look into.

    H3DHierarchyArrowGraphicsItem.cppH3DHierarchyArrowDockGraphicsItem.cppArrowGraphicsItem.cpp


    If the arrow has both the source and destination item i am doing the intersection test just as in the diagramscene example of Qt so that the destination point always slides on the arc of the ellipse. All the arrows that are created has the small ellipse and another larger ellipse as the destination item.

    In inside the adjust() function i am trying to update the destination point of the arrow which seems not to be working. Please make some time to go through it.


    Thanks
    Sajjad

  2. #2
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    Hello forum,

    I have not got any reply yet on this issue. Please let me know if my elaboration of the problem is not clear enough.

    If two graphical items of different types are connected to a single arrow at both ends, is mandatory to call the adjust() function of arrow graphics item from the both the graphical items?


    I am looking forward to some feed-back



    Regards
    Sajjad

  3. #3
    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: erratic behavior of graphics items

    It would help if you provided a minimal compilable example reproducing the problem.
    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.


  4. #4
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default graphics view coordinate system

    This post has been merged into this thread!

    Hello forum,

    With the help of the forum i have made some changes to the diagram scene example where i added elliptical item as follows:

    Qt Code:
    1. case Ellipse:
    2. {
    3. //declare an ellipse with the bounding rectange
    4. QGraphicsEllipseItem item(-100,-50,200,100);
    5. myPolygon = item.shape().toFillPolygon();
    6. }
    7. break;
    To copy to clipboard, switch view to plain text mode 

    I wanted to use the very same idea to implement the intersection test in another project. In my project i have the graphical item has the following definitions for bounding rectange and shape functions:

    Qt Code:
    1. QRectF RootGraphicsItem::boundingRect() const
    2. {
    3. //!get the bounding rectangle of the enclosing text
    4. QRectF rect = m_textGraphicsItem->boundingRect();
    5.  
    6.  
    7. //the following condition decides if the boundary needs
    8. //to be changed
    9. if( rect.width() < m_drawRectMinimumWidth )
    10. rect.setWidth(m_drawRectMinimumWidth);
    11.  
    12. if(rect.height() < m_drawRectMinimumHeight)
    13. rect.setHeight(m_drawRectMinimumHeight);
    14.  
    15. //set the rectangle width with the text item spacing
    16. rect.setWidth(rect.width() + getTextItemSpacing() );
    17.  
    18. //and return the rectangle
    19. return rect;
    20. }
    21.  
    22. //the following function is for better collission detection
    23. QPainterPath RootGraphicsItem::shape() const
    24. {
    25. QRectF ellipse_rect = boundingRect();
    26.  
    27.  
    28. path.addEllipse(ellipse_rect);
    29.  
    30. return path;
    31. }
    To copy to clipboard, switch view to plain text mode 

    But if i try to add the arrow item to my root graphics item using the line intersection example i get erratic behavior - the arrow is not attached to the item and disappears once you move the item inside the scene. You can also recreate the problem in the diagram scene example if you do the following changes


    Qt Code:
    1. case Ellipse:
    2. {
    3. //declare an ellipse with the bounding rectange
    4. // QGraphicsEllipseItem item(-100,-50,200,100);
    5. QGraphicsEllipseItem item(0,0,200,100);
    6. myPolygon = item.shape().toFillPolygon();
    7. }
    8. break;
    To copy to clipboard, switch view to plain text mode 

    You also need to add the following line in the mainwindow.cpp and some additional changes in diagramitem.h:

    Qt Code:
    1. layout->addWidget(createCellWidget(tr("Ellipse"),DiagramItem::Ellipse),2,0);
    To copy to clipboard, switch view to plain text mode 


    Qt Code:
    1. enum DiagramType
    2. {
    3. Step,
    4. Conditional,
    5. StartEnd,
    6. Io ,
    7. Ellipse
    8. };
    To copy to clipboard, switch view to plain text mode 


    I think i need to adjust some transformational issue here. But i have not found any good reference to it. The manual is not illustrative enough.

    Any reference to this issue will be very helpful



    Regards
    Sajjad
    Last edited by Lykurg; 8th February 2012 at 08:44. Reason: merged

  5. #5
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    Hi

    I have managed to recreate the same problem i am having in my project by doing the following changes in the diagramscene example:


    Inside the diagramitem.h file i added another item as follows:

    Qt Code:
    1. enum DiagramType
    2. {
    3. Step,
    4. Conditional,
    5. StartEnd,
    6. Io ,
    7. Ellipse
    8. };
    To copy to clipboard, switch view to plain text mode 


    Inside the diagramitem constructor i have added the following:

    Qt Code:
    1. case Ellipse:
    2. {
    3. //declare an ellipse with the bounding rectange
    4. // QGraphicsEllipseItem item(-100,-50,200,100);
    5. QGraphicsEllipseItem item(0,0,200,100);
    6. myPolygon = item.shape().toFillPolygon();
    7. }
    8. break;
    To copy to clipboard, switch view to plain text mode 


    I am sure not how to do this arrow and elliptical intersection test where in my project i have defined the bounding rectangle and shape for the elliptical item as follows:

    Qt Code:
    1. QRectF RootGraphicsItem::boundingRect() const
    2. {
    3. //!get the bounding rectangle of the enclosing text
    4. QRectF rect = m_textGraphicsItem->boundingRect();
    5.  
    6.  
    7. //the following condition decides if the boundary needs
    8. //to be changed
    9. if( rect.width() < m_drawRectMinimumWidth )
    10. rect.setWidth(m_drawRectMinimumWidth);
    11.  
    12. if(rect.height() < m_drawRectMinimumHeight)
    13. rect.setHeight(m_drawRectMinimumHeight);
    14.  
    15. //set the rectangle width with the text item spacing
    16. rect.setWidth(rect.width() + getTextItemSpacing() );
    17.  
    18. //and return the rectangle
    19. return rect;
    20. }
    21.  
    22. //the following function is for better collission detection
    23. QPainterPath RootGraphicsItem::shape() const
    24. {
    25. QRectF ellipse_rect = boundingRect();
    26.  
    27.  
    28. path.addEllipse(ellipse_rect);
    29.  
    30. return path;
    31. }
    To copy to clipboard, switch view to plain text mode 


    There are some affine transformation issues need to be taken care of - i guess and i am not sure how to do it. Do i have call some translation command before calling the ellipse drawing function ? I tried this as well and it became messier.


    Looking forward to some useful hint over this .



    Thanks
    Sajjad

  6. #6
    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: erratic behavior of graphics items

    And where do you call prepareGeometryChange()?
    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.


  7. #7
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    Hi

    i have inserted the function call prepareGeometryChange inside the following function at arrow.cpp of the updated diagram scene example to recreate the problem.


    Qt Code:
    1. void Arrow::updatePosition()
    2. {
    3. prepareGeometryChange();
    4.  
    5. //declare a new line
    6. QLineF line(mapFromItem(myStartItem, 0, 0), mapFromItem(myEndItem, 0, 0));
    7. setLine(line);
    8. }
    To copy to clipboard, switch view to plain text mode 


    And the above function is called as follows:


    Qt Code:
    1. QVariant DiagramItem::itemChange(GraphicsItemChange change,
    2. const QVariant &value)
    3. {
    4. //if the dialgram items change is about the item positional change
    5. //then we need to notify the component items about the changes
    6. if (change == QGraphicsItem::ItemPositionChange)
    7. {
    8. //all the arrows connected to
    9. //it need to update its position
    10.  
    11. foreach (Arrow *arrow, arrows)
    12. {
    13. arrow->updatePosition();
    14. }
    15. }
    16.  
    17. return value;
    18. }
    To copy to clipboard, switch view to plain text mode 


    But i am having the same problem - The arrow does not attach to the intersection point. I am attaching all the sources now. I hope that it will be more

    illustrative to solve the issue. If i change the code in diagramitem.cpp as follows the problem is solved here as i mentioned in my previous post.

    Qt Code:
    1. QGraphicsEllipseItem item(-100,-50,200,100);
    2. myPolygon = item.shape().toFillPolygon();
    To copy to clipboard, switch view to plain text mode 

    But in my original project, the graphical items bounding rectangles starting point is from (0,0,width,height). And i do want to implement this intersection test there as well. Please make some time to go through this and help me solve the problem.



    Regards
    Sajjad

  8. #8
    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: erratic behavior of graphics items

    I meant prepareGeometryChange() for your RootGraphicsItem class. Its bounding rect depends on the size of the text (and possibly some other things) yet you never inform graphics view the size of the item might have changed.
    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.


  9. #9
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    In the last post i missed to include the source that i did some changes. Sorry.


    arrow.cppdiagramitem.cppdiagramitem.harrow.h



    Please go through it and suggest me to get it fixed.


    Regards
    Sajjad


    Added after 9 minutes:


    Quote Originally Posted by wysota View Post
    I meant prepareGeometryChange() for your RootGraphicsItem class. Its bounding rect depends on the size of the text (and possibly some other things) yet you never inform graphics view the size of the item might have changed.
    Yes it is true that the size of the bounding rectangle is based on the size of the text and predefined text spacing. And i am defining the size of the item inside the boundingRect() function, do i need to call the prepareGeometryChange() inside the boundingRect() and even if i do i get the following error:

    Qt Code:
    1. RootGraphicsItem.cpp:671: error: passing ‘const RootGraphicsItem’ as ‘this’ argument of ‘void QGraphicsItem::prepareGeometryChange()’ discards qualifiers
    To copy to clipboard, switch view to plain text mode 


    Regards
    Sajjad
    Last edited by sajis997; 8th February 2012 at 11:25.

  10. #10
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    I call the prepareGeometryhange() inside the definition of boundary rectangle but it gives me the error as follows:

    Qt Code:
    1. RootGraphicsItem.cpp:668: error: passing ‘const RootGraphicsItem’ as ‘this’ argument of ‘void QGraphicsItem::prepareGeometryChange()’ discards qualifiers
    To copy to clipboard, switch view to plain text mode 

    I guess that it is not the right place to call the prepareGeometryChange(), as i am doing it now:

    Qt Code:
    1. QRectF RootGraphicsItem::boundingRect() const
    2. {
    3.  
    4. prepareGeometryChange();
    5.  
    6. //!get the bounding rectangle of the enclosing text
    7. QRectF rect = m_textGraphicsItem->boundingRect();
    8.  
    9. //the following condition decides if the boundary needs
    10. //to be changed
    11. if( rect.width() < m_drawRectMinimumWidth )
    12. rect.setWidth(m_drawRectMinimumWidth);
    13.  
    14. if(rect.height() < m_drawRectMinimumHeight)
    15. rect.setHeight(m_drawRectMinimumHeight);
    16.  
    17. //set the rectangle width with the text item spacing
    18. rect.setWidth(rect.width() + getTextItemSpacing() );
    19.  
    20. //and return the rectangle
    21. return rect;
    22. }
    To copy to clipboard, switch view to plain text mode 


    According to the manual it should be called once the set bounding rectangle is about to change. I am deciding the size before setting the bounding rectangle.

    Any more suggestion ?

  11. #11
    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: erratic behavior of graphics items

    Calling that method from within boundingRect() wouldn't make sense. You need to call it when the actual change occurs (like when the text or spacing is changed).
    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.


  12. #12
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    Hi

    This is what i think as well. I am changing the text later after defining the bounding rectangle.


    Could you please figure out any another reason that the arrow item and elliptical item intersection test is not functioning ?



    Regards
    Sajjad

  13. #13
    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: erratic behavior of graphics items

    Quote Originally Posted by sajis997 View Post
    Could you please figure out any another reason that the arrow item and elliptical item intersection test is not functioning ?
    What's wrong with the original reason? Don't you think we should test one thing at a time?
    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.


  14. #14
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    Hi

    I am sorry. I did not get your last post. Did i cause something to distract from the main issue here. Let me summarize again:

    I am trying to make connections between arrow and elliptical items in my own project and i tried to use the concept of diagramscene example.

    I am having trouble to implement it - as the arrow is not properly attached to the elliptical items and they suddenly disappear once i start to move the elliptical items in the scene view.

    I recreated the problem in the diagram scene example and posted in the forum for your point of view. All the details are mentioned in the previous posts.

    Now please guide me where should i start from to debug this problem ?


    Regards
    Sajjad

  15. #15
    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: erratic behavior of graphics items

    Quote Originally Posted by sajis997 View Post
    Hi

    I am sorry. I did not get your last post. Did i cause something to distract from the main issue here. Let me summarize again:

    I am trying to make connections between arrow and elliptical items in my own project and i tried to use the concept of diagramscene example.

    I am having trouble to implement it - as the arrow is not properly attached to the elliptical items and they suddenly disappear once i start to move the elliptical items in the scene view.

    I recreated the problem in the diagram scene example and posted in the forum for your point of view. All the details are mentioned in the previous posts.

    Now please guide me where should i start from to debug this problem ?
    Correct the bounding rect issue as it may have influence on how your scene is rendered in the view. Once that is done and it's not something that causes the misbehaviour, we can look elsewhere. Otherwise you can prepare a minimal compilable example reproducing the problem and we can work on that.
    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.


  16. #16
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    Hi

    I would like to know what do i have to do to correct the bounding rect issue of the elliptical graphics item. Its bounding rectangle is based on the bounding rectangle of the text graphics item it contains. Text graphics item that is contained inside the elliptical item is in turn the subclass of QTextGraphicsItem. I would like to repeat that once that the bounding rect is defined inside the boundingRect() it is never changed since then and this is why i do not see any reason to call the prepareGeometryChange() function.

    Could you please mention what might be wrong in the bounding rect function

    Qt Code:
    1. QRectF RootGraphicsItem::boundingRect() const
    2. {
    3.  
    4. prepareGeometryChange();
    5.  
    6. //!get the bounding rectangle of the enclosing text
    7. QRectF rect = m_textGraphicsItem->boundingRect();
    8.  
    9. //the following condition decides if the boundary needs
    10. //to be changed
    11. if( rect.width() < m_drawRectMinimumWidth )
    12. rect.setWidth(m_drawRectMinimumWidth);
    13.  
    14. if(rect.height() < m_drawRectMinimumHeight)
    15. rect.setHeight(m_drawRectMinimumHeight);
    16.  
    17. //set the rectangle width with the text item spacing
    18. rect.setWidth(rect.width() + getTextItemSpacing() );
    19.  
    20. //and return the rectangle
    21. return rect;
    22. }
    To copy to clipboard, switch view to plain text mode 

    Otherwise i am attaching the files again which is compilable that recreates the problem in another project. All that you need to do is that create another copy of the diagramscene example, remove the diagramscene.h and diagramscene.cpp and add the following files:

    diagramsceneview.h
    diagramsceneview.cpp
    diagramitem.h
    diagramitem.cpp

    And you have add the following line inside the createToolBox() of mainwindow.cpp

    Qt Code:
    1. layout->addWidget(createCellWidget(tr("Ellipse"),DiagramItem::Ellipse),2,0);
    To copy to clipboard, switch view to plain text mode 

    If you mange some time and compile with these added files and the reamaining files as arrived with the example you will see the problem

    The arrow is not connected as it is supposed to .


    Let me know if you have any trouble to compile them .


    Regards
    Sajjad
    Attached Files Attached Files

  17. #17
    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: erratic behavior of graphics items

    And what should I be looking at once I start the program? What exactly did you change in those files?
    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.


  18. #18
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    Hello ,

    Create Two elliptical items in the scene and connect them with a line. Line drawing can be done in one of the two ways. Either you use the one that came along with the original diagram scene example or the one i have added - move the the mouse with the control modifier and the line will be drawn. When you release the control modifier
    it will do the usual checking if there is any item under the event position and take the steps to draw the line arrow or not.

    Once the items are connected, try to move the elliptical items and then you will see the problem - the arrow is not properly attached to the elliptical items and at times the arrow disappears.


    I have removed the diagramscene.h - which was a subclass of QGraphicsScene, instead i have created a class called diagramsceneview - a subclass of QGraphicsView and moved all the functionalities to this class here. You have to remove the diagramscene class from your copy of the diagramscene example as well and add the one i have attached.

    Then you have to make the following changes inside th diagramitem.h file

    Qt Code:
    1. enum DiagramType
    2. {
    3. Step,
    4. Conditional,
    5. StartEnd,
    6. Io ,
    7. Ellipse // add the ellipse type
    8. };
    To copy to clipboard, switch view to plain text mode 

    In the constructor of diagramitem.cpp do the following:

    Qt Code:
    1. case Ellipse:
    2. {
    3. //declare an ellipse with the bounding rectange
    4. // QGraphicsEllipseItem item(-100,-50,200,100);
    5. QGraphicsEllipseItem item(0,0,200,100);
    6. myPolygon = item.shape().toFillPolygon();
    7. }
    8. break;
    To copy to clipboard, switch view to plain text mode 


    And at last in the createToolBox() function of mainwindow.cpp add the following:

    Qt Code:
    1. layout->addWidget(createCellWidget(tr("Ellipse"),DiagramItem::Ellipse),2,0);
    To copy to clipboard, switch view to plain text mode 

    So you are good to compile and run and see the problem, the problem is because of the following

    Qt Code:
    1. // QGraphicsEllipseItem item(-100,-50,200,100);
    2. QGraphicsEllipseItem item(0,0,200,100);
    To copy to clipboard, switch view to plain text mode 

    As you can see that i have commented the first line to recreate the problem here which i am having in my own project where i am trying to implement this intersection test between line and polygonal shape. If you uncomment it and then comment the next one instead , everything works just fine. This is where i think is the problem. My question is how do i get rid of this in my projeject?


    Let me know how it went along at your side.


    Regards
    Sajjad

  19. #19
    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: erratic behavior of graphics items

    The problem is I don't know what you modified in those files and comparing them by hand is tedious enough that it prevents me from doing it and comparing them automatically is not possible since you changed formatting of those files.
    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.


  20. #20
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: erratic behavior of graphics items

    I assume the fact that it did not go well at your side. So please go to the following website and download the .zip file named diagramsceneupdated3.zip

    http://www.student.itn.liu.se/~sajis...neupdated3.zip

    I hope that file formating issue will not arise anymore and you will be able to edit.

    If you manage to run it, please try to add elliptical items and connect them with a arrow and try to move around the scene and you will see the problem.

    Let me know if any other issues show up and thank you again for your effort to solve the issue.


    Regards
    Sajjad

Similar Threads

  1. display graphics items on area
    By quantum.17 in forum Qt Programming
    Replies: 0
    Last Post: 5th May 2010, 11:19
  2. Graphics view with millions of items
    By JovianGhost in forum Qt Programming
    Replies: 13
    Last Post: 26th March 2010, 23:58
  3. Erratic performance of IO operations in Qt4 program
    By jcox23 in forum General Programming
    Replies: 2
    Last Post: 26th January 2010, 17:33
  4. Strange behavior of checkable menu items..
    By jiapei100 in forum Qt Tools
    Replies: 1
    Last Post: 28th October 2009, 19:58
  5. Want custom menu items, like graphics, but how?
    By rm in forum Qt Programming
    Replies: 1
    Last Post: 30th January 2008, 20:52

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.