PDA

View Full Version : Qt Beginner QPainter



seniorc
22nd March 2014, 10:35
Hello,

My file :

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

I have map in my drawgraph class.


QMap<QString,Coordinate*> corMap; and my Coordinate struct

struct Coordinate{
double cor_X;
double cor_Y;
};
I want paint line this coordinate and i'm working QPainter class but i have a problem.


void GraphicScreen::paintEvent(QPaintEvent *); in my graphicscreen header file but i dont understand how can i do this,drawing my QMap information.I've tried

void GraphicScreen::draw(QMap ....); but it not working.

anda_skoa
22nd March 2014, 10:43
How does your draw() method look like and how do you call it from paintEvent()?

Cheers,
_

seniorc
22nd March 2014, 11:02
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.

anda_skoa
22nd March 2014, 13:11
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,
_