Ok, edited the question. Bolded the edited part.
@wysota : Mmmm, I'm not sure I understand what you are asking, but here is the complete code. I hope this helps.
mainwindow.cpp
mainwindow::mainwindow()
{
#include <QtGui>
#include <iostream>
#include "mainwindow.h"
#include "game.h"
#include "menu1.h"
men = new menu1(this);
qur = new game(this);
qs->resize(880,558);
qs->addWidget(men);
qs->addWidget(qur);
qs->setCurrentIndex(0);
show();
}
mainwindow::mainwindow()
{
#include <QtGui>
#include <iostream>
#include "mainwindow.h"
#include "game.h"
#include "menu1.h"
men = new menu1(this);
qur = new game(this);
qs = new QStackedWidget(this);
qs->resize(880,558);
qs->addWidget(men);
qs->addWidget(qur);
qs->setCurrentIndex(0);
show();
}
To copy to clipboard, switch view to plain text mode
menu1.cpp
#include "menu1.h"
#include <QtGui>
{
resize(880,558);
}
{
painter.
setRenderHint(QPainter::Antialiasing,
true);
path.moveTo(qrand() % 80, qrand() % 320);
path.cubicTo(200, 200, 320, 80, 480, 320);
painter.
setPen(QPen(Qt
::green,
8));
painter.drawPath(path);
}
#include "menu1.h"
#include <QtGui>
menu1::menu1(QWidget *parent) :
QWidget(parent)
{
resize(880,558);
}
void menu1::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
QPainterPath path;
path.moveTo(qrand() % 80, qrand() % 320);
path.cubicTo(200, 200, 320, 80, 480, 320);
painter.setPen(QPen(Qt::green, 8));
painter.drawPath(path);
}
To copy to clipboard, switch view to plain text mode
Bookmarks