Bonjour,
je voudrais ajouter un objet (cam) quand je clic sur un buttons
c'est pour cela j'ai fait une petite interface j'ai définie
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
page_13 = new QWidget();
    page_13->setObjectName(QString::fromUtf8("page_13"));
    page_13->setGeometry(QRect(0, 0, 211, 250));
 
 
    toolBox_5 = new QToolBox(dockWidgetContents_5);
    toolBox_5->setObjectName(QString::fromUtf8("toolBox_5"));
    toolBox_5->setGeometry(QRect(0, 0, 211, 331));
    toolBox_5->setAutoFillBackground(false);
    toolBox_5->setFrameShape(QFrame::NoFrame);
    toolBox_5->setFrameShadow(QFrame::Plain);
    toolBox_5->addItem(page_14, QString::fromUtf8("Object"));
    toolBox_5->setItemText(toolBox_5->indexOf(page_14), QApplication::translate("MainWindow", "Camera", 0, QApplication::UnicodeUTF8));
 
    toolButton_17 = new QToolButton(page_13);
    toolButton_17->setObjectName(QString::fromUtf8("toolButton_13"));
    toolButton_17->setGeometry(QRect(10, 10, 31, 31));
    toolButton_17->setText(QApplication::translate("MainWindow", "Add", 0, QApplication::UnicodeUTF8));
 
    doubleSpinBox = new QDoubleSpinBox(groupBox_6);
    doubleSpinBox->setObjectName(QString::fromUtf8("doubleSpinBox"));
    doubleSpinBox->setGeometry(QRect(10, 40, 51, 22));
 
    doubleSpinBox_2 = new QDoubleSpinBox(groupBox_6);
    doubleSpinBox_2->setObjectName(QString::fromUtf8("doubleSpinBox_2"));
    doubleSpinBox_2->setGeometry(QRect(70, 40, 51, 22));
 
    doubleSpinBox_3 = new QDoubleSpinBox(groupBox_6);
    doubleSpinBox_3->setObjectName(QString::fromUtf8("doubleSpinBox_3"));
    doubleSpinBox_3->setGeometry(QRect(130, 40, 51, 22));
 
    label = new QLabel(groupBox_6);
    label->setObjectName(QString::fromUtf8("label"));
    label->setGeometry(QRect(10, 20, 46, 13));
    label->setText(QApplication::translate("MainWindow", "X :", 0, QApplication::UnicodeUTF8));
 
    label_2 = new QLabel(groupBox_6);
    label_2->setObjectName(QString::fromUtf8("label_2"));
    label_2->setGeometry(QRect(70, 20, 46, 13));
    label_2->setText(QApplication::translate("MainWindow", "Y :", 0, QApplication::UnicodeUTF8));
 
    label_3 = new QLabel(groupBox_6);
    label_3->setObjectName(QString::fromUtf8("label_3"));
    label_3->setGeometry(QRect(130, 20, 46, 13));
    label_3->setText(QApplication::translate("MainWindow", "Z :", 0, QApplication::UnicodeUTF8));
ma procédure de l'ajout est
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
    void OgreWidget::add_camera(const Ogre::Vector3 &pos)
    {
    char name_cam[16];
 
    sprintf(name_cam, "cam%d", mCount_cam++);
 
    ogreCamera1 = ogreSceneManager->createCamera(std::string(name_cam) +"PlayerCam");
 
    ogreCamera1->setPosition(pos);
    ogreCamera1->lookAt(0,0,-200);
 
    }
j'ai pas maintenant compris comment je vais faire signal/slot du button pour qu'il exécute la procédure(je connus faire des signal slot simple mais pas comme ça)
est ce que vous avez une idée ?