Results 1 to 1 of 1

Thread: Vertical scrolling with the mouse wheel in QGraphicsView in versions 5.15.1 and 6.6.1

  1. #1
    Join Date
    Oct 2020
    Posts
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Vertical scrolling with the mouse wheel in QGraphicsView in versions 5.15.1 and 6.6.1

    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 ?

    Qt Code:
    1. #include <QGraphicsScene>
    2. #include <QGraphicsView>
    3. #include <QVBoxLayout>
    4. #include <QTextEdit>
    5. #include <QWidget>
    6. #include <QGraphicsProxyWidget>
    7.  
    8. MainWindow::MainWindow(QWidget *parent)
    9. : QMainWindow(parent)
    10. , ui(new Ui::MainWindow)
    11. {
    12. ui->setupUi(this);
    13.  
    14. QGraphicsScene*scene=new QGraphicsScene(1,1,109,1199);
    15.  
    16. QGraphicsView* graphicsView = new QGraphicsView(scene);
    17.  
    18. setCentralWidget(graphicsView);
    19.  
    20. graphicsView->setFrameShape(QFrame::NoFrame);
    21.  
    22. QTextEdit* textEdit = new QTextEdit();
    23.  
    24. QGraphicsProxyWidget* proxyWidget = new QGraphicsProxyWidget();
    25. proxyWidget->setWidget(textEdit);
    26.  
    27. scene->addItem(proxyWidget);
    28.  
    29. textEdit->move(-100,500);
    30. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by VVS; 26th January 2024 at 12:11.

Similar Threads

  1. QGraphicsView and Scrolling
    By validator in forum Qt Programming
    Replies: 5
    Last Post: 8th September 2017, 01:27
  2. QGraphicsView Scrolling
    By tvj4218 in forum Newbie
    Replies: 1
    Last Post: 7th March 2017, 08:06
  3. Scrolling QGraphicsView and QGraphicsScene
    By freely in forum Qt Programming
    Replies: 5
    Last Post: 19th February 2013, 14:37
  4. Replies: 0
    Last Post: 26th November 2009, 16:49
  5. Custom scrolling of QGraphicsView
    By hb in forum Qt Programming
    Replies: 0
    Last Post: 12th August 2008, 11:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.