Results 1 to 4 of 4

Thread: Qt Beginner QPainter

  1. #1
    Join Date
    Dec 2013
    Posts
    20
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Qt Beginner QPainter

    Hello,

    My file :

    drawgraph.h,drawgraph.cpp
    graphicscreen.h,graphicscreen.cpp,graphicscreen.ui

    I have map in my drawgraph class.

    Qt Code:
    1. QMap<QString,Coordinate*> corMap;
    To copy to clipboard, switch view to plain text mode 
    and my Coordinate struct
    Qt Code:
    1. struct Coordinate{
    2. double cor_X;
    3. double cor_Y;
    4. };
    To copy to clipboard, switch view to plain text mode 
    I want paint line this coordinate and i'm working QPainter class but i have a problem.

    Qt Code:
    1. void GraphicScreen::paintEvent(QPaintEvent *);
    To copy to clipboard, switch view to plain text mode 
    in my graphicscreen header file but i dont understand how can i do this,drawing my QMap information.I've tried
    Qt Code:
    1. void GraphicScreen::draw(QMap ....);
    To copy to clipboard, switch view to plain text mode 
    but it not working.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Qt Beginner QPainter

    How does your draw() method look like and how do you call it from paintEvent()?

    Cheers,
    _

  3. #3
    Join Date
    Dec 2013
    Posts
    20
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    4

    Default Re: Qt Beginner QPainter

    Quote Originally Posted by anda_skoa View Post
    How does your draw() method look like and how do you call it from paintEvent()?

    Cheers,
    _
    exactly problem is here.How do you suggest a solution way.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Qt Beginner QPainter

    That doesn't answer my question at all, you already said that it is not working.

    Post the code of your paintEvent() and draw() methods.

    Cheers,
    _

Similar Threads

  1. Please help! I'm a beginner
    By ayanda83 in forum Newbie
    Replies: 2
    Last Post: 5th July 2012, 14:41
  2. Help! about Qt for beginner!!
    By Cantora in forum Newbie
    Replies: 9
    Last Post: 2nd April 2009, 01:11
  3. QDialog for beginner
    By mk33 in forum Qt Programming
    Replies: 2
    Last Post: 11th March 2009, 18:35
  4. hello, a beginner would like your help
    By tommy in forum Qt Programming
    Replies: 5
    Last Post: 2nd November 2007, 23:48
  5. Beginner C++ question
    By masoroso in forum General Programming
    Replies: 2
    Last Post: 19th April 2006, 15:15

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.