I added line edit, pushbutton,label to QGraphics View..
But the position of scene is mid of the QGraphicsView..
How do i change the the position of scene in QGraphics View..
I am trying with
ui->graphicsView->setScene(scene);
Ui_Form *m_ui = new Ui_Form;
m_ui->setupUi(wid);
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget;
label->setText("Hello World !!!");
button->setText("dfgdfgdsg");
line->setFocus();
proxy =scene->addWidget(line);
label->setScaledContents(true);
proxy = scene->addWidget(button);
proxy = scene->addWidget(label);
scene
->addRect
(QRectF(0,
0,
5,
30))->setBrush
(Qt
::green);
ui->graphicsView->setScene(scene);
QGraphicsScene *scene= new QGraphicsScene(this);
ui->graphicsView->setScene(scene);
ui->graphicsView->setCacheMode(QGraphicsView::CacheBackground);
Ui_Form *m_ui = new Ui_Form;
QWidget *wid = new QWidget;
m_ui->setupUi(wid);
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget;
QLabel *label = new QLabel;
label->setText("Hello World !!!");
QPushButton *button = new QPushButton;
button->setText("dfgdfgdsg");
QLineEdit *line = new QLineEdit;
line->setFocus();
proxy =scene->addWidget(line);
label->setScaledContents(true);
proxy = scene->addWidget(button);
proxy = scene->addWidget(label);
scene->addRect(QRectF(0, 0, 5, 30))->setBrush(Qt::green);
ui->graphicsView->setScene(scene);
To copy to clipboard, switch view to plain text mode
Adavance Thanks
Yuvaraj R
Bookmarks