well i make a two class
{
...
}
{
...
private:
void paintEvent
(QEvent *event
);
...
}
class Win: public QScrollArea
{
...
}
class paintArea: public QWidget
{
...
private:
void paintEvent(QEvent *event);
QImage Paper;
...
}
To copy to clipboard, switch view to plain text mode
in the constructor of win class:
{
paintArea *paper = new paintArea;
setWidget(paper);
...
}
Win::Win(QWidget *parent): QScrollArea(parent)
{
paintArea *paper = new paintArea;
setBackgroundRole(QPalette::Dark);
setWidget(paper);
...
}
To copy to clipboard, switch view to plain text mode
in the constructor of paintarea class i define a QImage name's Paper. in the function apintEvent of paintarea draw the image Paper.
When i create a mdichild with win class show a window with Dark Background, but never show the paint area,What is my mistake?
Bookmarks