You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
474 B
23 lines
474 B
2 years ago
|
#include <QApplication>
|
||
|
#include <QGraphicsView>
|
||
|
#include <QGraphicsScene>
|
||
|
#include "MyRect.h"
|
||
|
|
||
|
int main(int argc, char *argv[])
|
||
|
{
|
||
|
QApplication a(argc, argv);
|
||
|
|
||
|
MyRect* rect = new MyRect();
|
||
|
rect->setRect(0,0,100,100);
|
||
|
rect->setFlag(QGraphicsItem::ItemIsFocusable);
|
||
|
rect->setFocus();
|
||
|
QGraphicsScene* scene = new QGraphicsScene();
|
||
|
scene->addItem(rect);
|
||
|
|
||
|
QGraphicsView* view = new QGraphicsView(scene);
|
||
|
|
||
|
view->show();
|
||
|
|
||
|
return a.exec();
|
||
|
}
|