void MainWindow:: drawpoint()
{
{calculations of mouse click point, The mouse click point is store in a [B]Qpoint point[/B]}
update();
}
{
MainWindow *main=new MainWindow;
p.
setRenderHint(QPainter::Antialiasing,
true);
p.
setRenderHint(QPainter::SmoothPixmapTransform,
true);
linepen.setWidth(25);
linepen.setCapStyle(Qt::RoundCap);
p.setPen(linepen);
p.setOpacity(0.7);
p.drawPoint(main->point);
}
void MainWindow:: drawpoint()
{
{calculations of mouse click point, The mouse click point is store in a [B]Qpoint point[/B]}
update();
}
void drawing:: paintEvent(QPaintEvent *painter)
{
MainWindow *main=new MainWindow;
QFrame::paintEvent(painter);
QPainter p(this);
QPen linepen(Qt::cyan);
p.setRenderHint(QPainter::Antialiasing,true);
p.setRenderHint(QPainter::SmoothPixmapTransform,true);
linepen.setWidth(25);
linepen.setCapStyle(Qt::RoundCap);
p.setPen(linepen);
p.setOpacity(0.7);
p.drawPoint(main->point);
}
To copy to clipboard, switch view to plain text mode
I have used the above code.
I have arranged buttons in 11 X 11 format in a grid. I connected all the buttons to the drawpoint function. My drawing function paintevent is of drawing class.
when i call the update function it does not invoke the paintevent of drawing class.
I tryed to create an object like
drawing *draw=new drawing
drawing *draw=new drawing
To copy to clipboard, switch view to plain text mode
then i sent the point by calling
draw->update
draw->update
To copy to clipboard, switch view to plain text mode
but the qt shows an error "no appropriate default constructor available"
Bookmarks