Iif you double click your mainwindow.ui file you will see a visual representation of your gui.
If you right click the GraphicsView object you can select 'Goto slot' to begin programming the objects signals & slots.
Click on the GraphicsView and you can see its properties on the right hand side.
The object's name is probably graphicsView in this case
Back in mainwindow.cpp you can access / programme this objects methods and members:
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow
::MainWindow(QWidget *parent
){
ui->setupUi(this);
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->graphicsView->setDragMode(QGraphicsView::ScrollHandDrag);
}
To copy to clipboard, switch view to plain text mode
Bookmarks