Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. graphicsview
Forum Updated to NodeBB v4.3 + New Features

graphicsview

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 207 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    QtUsr001
    wrote on last edited by
    #1

    In qtcreator I created a MainWindow, within that on the left, is Widget X and on the right is a graphicsview widget called graphicsview.

    I have not called a setCentralWidget I think qtcreator has already done that for me.
    since I have a lot of the functionality already working.

    I have what must be a simple problem with getting the graphicsview to work.

    in my MainWindow init I do

    // ...other MainWindow init code that works

    ui->setupUi(this);

    scene = new QGraphicsScene();
    ui->graphicsView->setScene(scene);
    ellipseItem = scene->addEllipse( 10,10,100,100, QPen(Qt::blue), QBrush(Qt::blue) );

    This all compiles and runs but nothing appears in the graphicsview.

    I then tried adding a setCentralWidget( ui->graphicsView ). This creates an exception in the debugger
    stopped at functionality for the other widget to the left of the graphicsview.

    Any ideas?

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      QtUsr001
      wrote on last edited by
      #2

      fixed -- by creating new project.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved