In version 5.15.1, if the mouse cursor is over a widget (as in the example below - QTextEdit), there is scrolling for the entire QGraphicsView. In version 6.6.1, scrolling only occurs when the mouse cursor is not over QTextEdit. Is it possible to achieve the behavior that was present in version 5.15.1 ?
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QVBoxLayout>
#include <QTextEdit>
#include <QWidget>
#include <QGraphicsProxyWidget>
MainWindow
::MainWindow(QWidget *parent
) , ui(new Ui::MainWindow)
{
ui->setupUi(this);
setCentralWidget(graphicsView);
graphicsView
->setFrameShape
(QFrame::NoFrame);
QGraphicsProxyWidget* proxyWidget = new QGraphicsProxyWidget();
proxyWidget->setWidget(textEdit);
scene->addItem(proxyWidget);
textEdit->move(-100,500);
}
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QVBoxLayout>
#include <QTextEdit>
#include <QWidget>
#include <QGraphicsProxyWidget>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
QGraphicsScene*scene=new QGraphicsScene(1,1,109,1199);
QGraphicsView* graphicsView = new QGraphicsView(scene);
setCentralWidget(graphicsView);
graphicsView->setFrameShape(QFrame::NoFrame);
QTextEdit* textEdit = new QTextEdit();
QGraphicsProxyWidget* proxyWidget = new QGraphicsProxyWidget();
proxyWidget->setWidget(textEdit);
scene->addItem(proxyWidget);
textEdit->move(-100,500);
}
To copy to clipboard, switch view to plain text mode
Bookmarks