#include <QtCore>
#include <QtGui>
#include <QtOpenGL>
int main(int argc, char *argv[])
{
wdg->setGeometry(0,0,150,150);
wdg->setWindowTitle("Title1");
QGraphicsProxyWidget* proxy = scene->addWidget(wdg);
proxy->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
proxy->setPos(-150,0);
pix->setScale(0.1);
pix->setPos(50,0);
{
view->setScene(scene);
hl->addWidget(view);
}
{
view->setScene(scene);
QTransform t;
t.scale(0.5,0.5);
view->setTransform(t);
hl->addWidget(view);
}
w->setLayout(hl);
w
->setGeometry
(QRect(50,
50,
600,
400));
w->show();
return a.exec();
}
#include <QtCore>
#include <QtGui>
#include <QtOpenGL>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QHBoxLayout* hl = new QHBoxLayout();
QGraphicsScene* scene = new QGraphicsScene();
QWidget* wdg = new QWidget();
wdg->setGeometry(0,0,150,150);
wdg->setWindowTitle("Title1");
QGraphicsProxyWidget* proxy = scene->addWidget(wdg);
proxy->setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
proxy->setPos(-150,0);
QGraphicsPixmapItem* pix = scene->addPixmap(QPixmap("e:/test.jpg"));
pix->setScale(0.1);
pix->setPos(50,0);
{
QGraphicsView* view = new QGraphicsView();
view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
view->setScene(scene);
hl->addWidget(view);
}
{
QGraphicsView* view = new QGraphicsView();
view->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
view->setScene(scene);
QTransform t;
t.scale(0.5,0.5);
view->setTransform(t);
hl->addWidget(view);
}
QWidget* w = new QWidget();
w->setLayout(hl);
w->setGeometry(QRect(50, 50, 600, 400));
w->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Joh
Bookmarks