I am using a developer defined QGraphicsScene pointer from the "dialog/mainwindow" class called wavesScene to return a QList of QGraphicsItem*'s using QGraphicsScene::items. Something seems to be wrong with my syntax, it says that the list "graphicsItemList" is never used/declared.
Here is my code, any ideas as to how I would properly implement this methodology


relevant code inside mainwindow/segyView.h

Qt Code:
  1. QGraphicsScene *wavesScene;
  2. Constructor code *I think, may be called something different
  3. SEGYView::SEGYView(QWidget *parent)
  4. :QMainWindow(parent),
  5. ui(new Ui::SEGYView)
  6. {
  7. ui->setupUi(this);
  8. wavesScene = new QGraphicsScene(this);
  9. ui->PixmapView->setScene(wavesScene);
  10. }
To copy to clipboard, switch view to plain text mode 

Code inside slider_value_changed() slot

Qt Code:
  1. QList<QGraphicsItem*> graphicsItemList(wavesScene->items());
  2. QGraphicsPixmapItem pixmapItem(graphicsItemList.at(0));
  3. QPixmap wavesPixmap = pixmapItem.pixmap();
  4. QPixmap wavesPixmapScaled = wavesPixmap.scaled((newSliderValue*INITIAL_WAVES_PIXMAP_X_SIZE), 1250);
  5. pixmapItem.setPixmap((wavesPixmapScaled));
  6. wavesScene->addItem(&pixmapItem);
  7. relevant code inside actionOpen on triggered() slot
  8. wavesScene->addItem(pixmapGraphicsItem);
  9. ui->PixmapView->setScene(wavesScene);
To copy to clipboard, switch view to plain text mode 

Error is "graphicsItemList" was not declared in this scope QGraphicsPixmapItem* pixmapItem = graphicsItemList.at(0);
^