Results 1 to 6 of 6

Thread: Can't draw an arc with Qt on a beaglebone

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2014
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Can't draw an arc with Qt on a beaglebone

    I'm using Qt Creator to design a GUI for an industrial machinery. The beaglebone displays various things based on CAN messages it receives. All was going well until I tried to draw an arc to symbolize the position of some moving equipment.

    Using Qt Creator's UI editor, I've placed a square shaped graphics view in my UI. I gave it a width of 256 and a height of 256 and I named it graphicsPipeView.

    In mainwindow.cpp:

    Qt Code:
    1. PipeScene = new QGraphicsScene;
    2. ui->graphicsPipeView->setScene(PipeScene);
    3. QRectF pipe_rect(0, 0, 250, 250);
    4. QRectF inner_rect(10, 10, 230, 230);
    5. PipeScene->addEllipse(pipe_rect, QPen(QColor(0, 0, 0)), QBrush(QColor(230, 230, 230))); // this draws the circle in the picture
    6. QPainterPath *path = new QPainterPath();
    7.  
    8. path->moveTo(0, 0);
    9. path->lineTo(250, 250); // this draws the NW to SE line - I drew this as a sanity check because I couldn't get the arc to draw
    10. path->moveTo(250, 0);
    11. path->lineTo(0, 250); // this draws the NE to SW line - I also drew this as a sanity check because I couldn't get the arc to draw
    12. path->arcMoveTo(inner_rect, 90);
    13. path->lineTo(125, 125); // this draws the horizontal line, but according to the arcMoveTo command, it should be vertical (at least I think that's what it's supposed to be)
    14. path->closeSubpath();
    15. PipeScene->addPath(*path);
    16. ui->graphicsPipeView->show();
    To copy to clipboard, switch view to plain text mode 

    Here's my problem. I couldn't draw ANY arc at all so I decided to see where or how the code was failing. I came up with the above test. The resulting picture is attached.

    According to the documentation, arcMoveTo(inner_rect, 90) should move the starting point to 12 noon if the drawing was a clock. The lineTo(125, 125) should draw a vertical line. Only problem is the line is horizontal. I can put any number (degrees) in the arcMoveTo() function and the resulting line is always as shown.

    What am I doing wrong? I've tried many iterations of an arcMoveTo() followed by an arcTo() but the result is either a point or a random-angled line.

    Both my Linux laptop and the beaglebone are running Qt version 4.8.1.
    Attached Images Attached Images

Similar Threads

  1. Issue Deploying Qt app to my Beaglebone Black
    By MarkB in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 10th October 2014, 15:33
  2. Problem configuring Qt for BeagleBone Black
    By sask1236 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 7th November 2013, 07:30
  3. Qt creator for Beaglebone black
    By Nagarajan in forum Newbie
    Replies: 0
    Last Post: 24th October 2013, 06:28
  4. Replies: 2
    Last Post: 30th September 2013, 13:18
  5. Configure for Buiding Qt with Beaglebone
    By shindo216 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th August 2013, 16:37

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.