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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
| #include "FenetrePrincipale.h"
#include <iostream>
using namespace std;
FenetrePrincipale::FenetrePrincipale()
{
setMinimumSize(800,600);
// Barre de menu
QMenu *menuFichier = menuBar()->addMenu("&Fichier");
QAction *actionNewProject = new QAction("&Nouveau Projet", this);
menuFichier->addAction(actionNewProject);
QAction *actionOpenProject = new QAction("&Ouvrir Projet", this);
menuFichier->addAction(actionOpenProject);
QAction *actionRecentFile = new QAction("&Fichiers recent", this);
menuFichier->addAction(actionRecentFile);
QAction *actionSave = new QAction("&Enregistrer", this);
menuFichier->addAction(actionSave);
QAction *actionSaveAs = new QAction("&Enregistrer sous", this);
menuFichier->addAction(actionSaveAs);
QAction *actionQuitter = new QAction("&Quitter", this);
menuFichier->addAction(actionQuitter);
QMenu *menuEdition = menuBar()->addMenu("&Edition");
QAction *actionAddVideo = new QAction("&Ajouter une Video", this);
menuEdition->addAction(actionAddVideo);
QAction *actionAddVideos = new QAction("&Ajouter des Videos", this);
menuEdition->addAction(actionAddVideos);
QAction *actionSupVideos = new QAction("&Supprimez Videos", this);
menuEdition->addAction(actionSupVideos);
QMenu *menuTool = menuBar()->addMenu("&Outils");
QAction *actionPref = new QAction("&Preferences", this);
menuTool->addAction(actionPref);
// QMenu *menuAffichage = menuBar()->addMenu("&Affichage");
// Création de la barre d'outils
QToolBar *toolBarFichier = addToolBar("Fichier");
toolBarFichier->addAction(actionOpenProject);
toolBarFichier->addAction(actionSave);
toolBarFichier->addAction(actionAddVideo);
//QPushButton *addVideobutton = new QPushButton("Add");
//addVideobutton->setStyleSheet("background-color:black;");
//toolBarFichier->addWidget(addVideobutton);
// Zone centrale
QWidget *zoneCentrale = new QWidget;
// Layouts
layout = new QGridLayout;
//zoneCentrale->setFixedSize(900, 800);
//layout->setColumnMinimumWidth(1,3);
//layout->setRowMinimumHeight(1,1);
zoneCentrale->setLayout(layout);
setCentralWidget(zoneCentrale);
// Connect
connect(actionQuitter, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(actionAddVideo, SIGNAL(triggered()), this, SLOT(createVideo()));
connect(actionAddVideos, SIGNAL(triggered()), this, SLOT(InputDialog()));
}
void FenetrePrincipale::createVideo()
{
for(int j = a; j == 8; j++){
cout <<"j ="<< j << endl;
}
a += 1;
if (a==9){
a = 1;
b+=1;
}
Video *m_video = new Video(count+1);
layout->addWidget(m_video,a,b);
count += 1;
}
void FenetrePrincipale::InputDialog()
{
m_videoinputint = QInputDialog::getInt(this, "Ajouter des videos", "Ajouter x videos");
FenetrePrincipale::createVideos();
}
void FenetrePrincipale::createVideos()
{
for(int i = 0; i < m_videoinputint; i++){
FenetrePrincipale::createVideo();
}
} |
Partager