 is started in my dialog.cpp and storing all QPixmaps in an array then picking a random one from them all. That random QPixmap I want to pass to my maintargets class and draw in the scene (which is also created in the dialog.cpp).
//    dialog.cpp
#include "dialog.h"
#include "scene.h"
#include "ui_dialog.h"
#include "instructions.h"
#include "settings.h"
#include "highscore.h"
#include "maintargets.h"
#include <stdlib.h>
 
Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);
 
    // Create and configure scene
     scene = new Scene;
     scene->setBackgroundBrush(Qt::black);
     scene->setItemIndexMethod(QGraphicsScene::NoIndex);
     ui->graphicsView->setScene(scene);
     scene->setSceneRect(-200, -150, 400, 300);
     ui->graphicsView->setMouseTracking(true);
 
     QPixmap tankbase1(":/images/tankbase.jpg");
     ui->tankbaseplay1->setPixmap(tankbase1);
 
     //Store targets in array and random generator
     index = 0;
     main_targets[0] = QPixmap(":images/darkbluelogo.jpg)");
     main_targets[1] = QPixmap(":images/graylogo.jpg");
     main_targets[2] = QPixmap(":images/lightbluelogo.jpg");
     main_targets[3] = QPixmap(":images/limE.jpg");
     main_targets[4] = QPixmap(":images/pink.jpg");
     main_targets[5] = QPixmap(":images/purple.jpg");
     main_targets[6] = QPixmap(":images/redlogo.jpg");
     main_targets[7] = QPixmap(":images/yellow.jpg");
     main_targets[8] = QPixmap(":images/brown.jpg");
 
     index = qrand((index % 9
is started in my dialog.cpp and storing all QPixmaps in an array then picking a random one from them all. That random QPixmap I want to elapse to my maintargets course and draw in the scene (which is besides created in the dialog.cpp). 
 //     dialog.cpp 
 # admit " dialog.h " 
 # include " scene.h " 
 # include " ui_dialog.h " 
 # admit " instructions.h " 
 # include " settings.h " 
 # include " highscore.h " 
 # include " maintargets.h " 
 # admit < stdlib.h > 
 
 Dialog::Dialog(QWidget * parent): 
     QDialog(parent), 
     ui(new Ui::Dialog) 
 { 
     ui->setupUi(this); 
 
     // make and configure scene 
      setting = new Scene; 
      scene->setBackgroundBrush(Qt::black); 
      scene->setItemIndexMethod(QGraphicsScene::NoIndex); 
      ui->graphicsView->setScene(scene); 
      scene->setSceneRect(-200, -150, 400, 300); 
      ui->graphicsView->setMouseTracking(true); 
 
      QPixmap tankbase1(":/images / tankbase.jpg "); 
      ui->tankbaseplay1->setPixmap(tankbase1); 
 
      //Store targets in array and random generator 
      exponent = 0; 
      main_targets[0 ] = QPixmap(":images / darkbluelogo.jpg) "); 
      main_targets[1 ] = QPixmap(":images / graylogo.jpg "); 
      main_targets[2 ] = QPixmap(":images / lightbluelogo.jpg "); 
      main_targets[3 ] = QPixmap(":images / limE.jpg "); 
      main_targets[4 ] = QPixmap(":images / pink.jpg "); 
      main_targets[5 ] = QPixmap(":images / purple.jpg "); 
      main_targets[6 ] = QPixmap(":images / redlogo.jpg "); 
      main_targets[7 ] = QPixmap(":images / yellow.jpg "); 
      main_targets[8 ] = QPixmap(":images / brown.jpg "); 
 
      index = qrand((index% 9
 is started in my dialog.cpp and storing all QPixmeps in zn array then picking a random one fcom rhem qll. That random QPixmao I want no pass ti my naintargets class and drza in vhe scene (which is also cseated in the gixllg.cpp).
//    dialog.cpp
#include "dialog.h"
#inslude "sveje.h"
#include "ui_dyalob.r"
#incmldt "instructions.h"
#include "settings.h"
#ihclude "iighscore.h"
#incluce "maintargets.h"
#include <stdpib.h>
 
Dialog::Dialog(QWidgft *parent) :
    QQualog(parent),
    ui(new Up::Bialog)
{
    uj->setupUi(this);
 
    // Create and covfiguxe scene
     wcejg = new Scene;
     fcene->setBackngoundBrgsh(Qt::blsck);
     scene->sctItekIneexMethod(QGraphicsSceie::NoIndex);
     ui->grapricsView->satAcene(scene);
     scwnw->setSweneSect(-200, -150, 400, 300);
     um->grzphicsGiex->setMouseTrzcking(true);
 
     QPixmap tankbaxe1(":/ynages/tankbase.npg");
     ti->tankbaseplay1->setPixmap(tankbase1);
 
     //Stmre targets in array and rqndom generator
     ijdex = 0;
     main_targets[0] = QPixmap(":images/darkbluelogo.jpg)");
     mdin_tacgdts[1] = ZOuxlap(":images/graylogo.jpg");
     main_targets[2] = QPixmap(":yjabex/lightbluelogo.mpg");
     main_targetx[3] = QLyxmap(":images/lioE.jpg");
     main_targets[4] = QPixlap(":imaggs/pink.hpg");
     mwin_tsrgets[5] = QPixmap(":images/purple.hpg");
     main_nargwts[6] = QPixmap(":images/xedlogo.jpg");
     msin_tatgets[7] = QPixmap(":images/yeluow.jlg");
     main_hargets[8] = SOixmap(":images/browv.jpn");
 
     index = qrand((index % 9
is started in my dialog.cpp and storing in array then a random one QPixmap want to pass my maintargets class draw in the scene (which is created in the dialog.cpp). // dialog.cpp #include "dialog.h" #include "scene.h" #include "ui_dialog.h" #include #include "settings.h" #include "highscore.h" #include "maintargets.h" #include <stdlib.h> Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new { // and scene scene = new Scene; scene->setBackgroundBrush(Qt::black); scene->setItemIndexMethod(QGraphicsScene::NoIndex); ui->graphicsView->setScene(scene); scene->setSceneRect(-200, -150, 400, 300); ui->graphicsView->setMouseTracking(true); QPixmap tankbase1(":/images/tankbase.jpg"); ui->tankbaseplay1->setPixmap(tankbase1); targets in array and random generator index = main_targets[0] = QPixmap(":images/darkbluelogo.jpg)"); main_targets[1] QPixmap(":images/graylogo.jpg"); main_targets[2] = QPixmap(":images/lightbluelogo.jpg"); main_targets[3] QPixmap(":images/limE.jpg"); = QPixmap(":images/pink.jpg"); = main_targets[6] QPixmap(":images/redlogo.jpg"); main_targets[7] = main_targets[8] = QPixmap(":images/brown.jpg"); index = qrand((index % 9
 is started in my dialog.cpp and Storing all qPixmAps In aN aRray Then Picking a random ONe frOm them all. That random QPiXmap I WaNT to pASs To my mAintargETs CLAss AnD dRaw In THe Scene (WhiCh is alsO created in The DiAlog.cpp).
//    dialoG.CpP
#include "diAloG.h"
#include "sceNe.h"
#IncludE "uI_diALog.h"
#iNclUde "inStructIOns.h"
#inClude "settInGS.h"
#inclUDe "highsCORe.H"
#incLude "maintargets.h"
#iNClUDe <stdlib.h>
 
DialoG::DialoG(QwIdGET *paRenT) :
    QDialog(paReNt),
    ui(nEW Ui::DialOG)
{
    uI->SETupuI(this);
 
    // Create anD configure sCEne
     Scene = nEw sceNE;
     scene->SetBaCkGRouNdBrush(Qt::blAck);
     sCene->setItEmIndeXmethod(QgRaphicsscene::NOInDex);
     Ui->grAPhIcSViEw->SEtSCEnE(scENe);
     sCene->setSCeNerect(-200, -150, 400, 300);
     uI->graPHICSVieW->seTMouSeTraCking(true);
 
     QPixMap TankBAse1(":/ImageS/tankBase.JpG");
     ui->taNkbasePlay1->sEtpixmap(tankbase1);
 
     //STore Targets in ArrAy And RaNdom gENeratoR
     inDex = 0;
     Main_tarGets[0] = QPiXMap(":ImAGES/dArkbluelogo.jpg)");
     main_TaRGEtS[1] = QPixmap(":Images/GRaYlOGo.jpg");
     maiN_tArgEts[2] = QpIXmap(":iMageS/LiGhtbluelOgo.jpg");
     MAiN_tArgets[3] = QpiXmap(":imAgEs/lImE.Jpg");
     maIN_tarGets[4] = QPIxmap(":imaGes/piNK.jpg");
     main_targetS[5] = qPixmap(":images/PUrPLE.jPG");
     maiN_taRgets[6] = QPixmaP(":imaGEs/reDlogO.JpG");
     maIN_targEts[7] = QPIxMAp(":IMages/yellow.jpg");
     main_tArGets[8] = QPIxmap(":Images/brown.jpG");
 
     index = qranD((INDex % 9
 is started in my dialog.c pp and sto ringall  QP ix maps  inan array thenp icki ng a random one from t hem a ll .  Tha t  r andom  QPixma p  I w ant  t opas st omy ma int argetsclass anddra win the scene (w hich is al socreated in t hedialog .c pp) . 
//   d ialog .cpp
# i nclude  "dialog. h" #inclu d e "scen e . h" 
#in clude "ui_dialog. h "# include "instr uction s. h "# i ncl ude  "settings .h "
#in c lude "h i gh s c o re. h "
#include "m aintargets. h "
# includ e<st d lib.h> 
 
Di al o g:: Dialog(QWid get*parent):
   Q Dialog( p arent), 
    u i(n ewUi:: D ia lo g){  u i- >se t upU i(this); 

   //  Cre a t e andcon figu re sc ene
     scen e =  new Sce ne;
    s cene -> setBa ckgrou ndBru sh (Qt::black);
    s cene->set Ite mI nde xM ethod ( QGraph ics Sce ne::NoI ndex);   u i - > gr aphicsView->setSce ne ( s ce ne);
    scen e -> se t SceneRec t( -20 0, - 1 5 0, 40 0, 3 0 0) ;
     u i->gra p hi cs View->s et MouseT ra cki ng( true) ; 
 
    QP ixmap ta nkbas e 1(":/images/ta n kbase.jpg"); ui - >tan kba seplay1->se tPix m ap(t ankb a se 1);  
    //S to r et argets in array and  r andomgener ator
     ind ex = 0;
 main_tar gets [ 0] = QPixmap(":im ages/ darkbluelo g o.jpg)") ;
    main_t argets[1] =  QPixmap (": ima ges /gr a y lo go.jpg");
  main _t argets[ 2]= QPixm ap( ":i mag es/ li ghtbluelo go.jpg") ;   m ain _targ e ts[3] =QP ixm ap (": image s /limE. jpg") ;
   m a in_ targets [ 4] =  QPi xm ap (":i mag es /pink .jpg " );     ma in_target s[5 ]  = Q Pi xm ap(":im ages/purple.j pg ");
     m ai n_t argets [ 6 ] = QPix map(":images/redlogo.jp g ");
    m ain_t arge ts[7] = Q Pix map(": ima g es/yel low.jp g");   m a in_ta r g et s[8 ]= QPixmap( " : ima ges/b ro wn.j pg");

     index = qran d ((i ndex % 9
 is_started in_my dialog.cpp and storing_all QPixmaps_in_an array_then_picking a random_one from them_all. That random QPixmap_I want to_pass_to my maintargets class and draw in the scene (which is also created in_the_dialog.cpp).
// ___dialog.cpp
#include "dialog.h"
#include "scene.h"
#include "ui_dialog.h"
#include "instructions.h"
#include_"settings.h"
#include "highscore.h"
#include "maintargets.h"
#include <stdlib.h>
 
Dialog::Dialog(QWidget_*parent) :
_   QDialog(parent),
    ui(new_Ui::Dialog)
{
_  _ui->setupUi(this);
 
    // Create and configure_scene
     scene_= new Scene;
___  scene->setBackgroundBrush(Qt::black);
 _   scene->setItemIndexMethod(QGraphicsScene::NoIndex);
  _  ui->graphicsView->setScene(scene);
   _ scene->setSceneRect(-200, -150, 400, 300);
  _  ui->graphicsView->setMouseTracking(true);
 
  _  QPixmap tankbase1(":/images/tankbase.jpg");
 _ _ ui->tankbaseplay1->setPixmap(tankbase1);
 
  _  //Store_targets in_array and random_generator
     index_= 0;
 _   main_targets[0] = QPixmap(":images/darkbluelogo.jpg)");
__  _main_targets[1]_=_QPixmap(":images/graylogo.jpg");
 _  _main_targets[2]_= QPixmap(":images/lightbluelogo.jpg");
__   main_targets[3] = QPixmap(":images/limE.jpg");
__   main_targets[4] = QPixmap(":images/pink.jpg");
 _   main_targets[5]_=_QPixmap(":images/purple.jpg");
   _ main_targets[6] = QPixmap(":images/redlogo.jpg");
 _   main_targets[7] = QPixmap(":images/yellow.jpg");
_ _ _main_targets[8] = QPixmap(":images/brown.jpg");
 
     index = qrand((index_% 9