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
|
void FenetreAccueil :: chargement(int nbre, QProgressBar * barre)
{
if(slider>= barre->maximum())
{
emit complet();
}
}
void FenetreAccueil :: barreProgression()
{
QVBoxLayout *group_layout = new QVBoxLayout;
QGroupBox *groupbox = new QGroupBox();
QProgressBar * barre = new QProgressBar();
QSlider *slider= new QSlider;
int valeur;
groupbox->setWindowTitle("Fenetre de chargement");
groupbox->setFixedSize(300,90);
groupbox->setGeometry(300,200,300,90);
groupbox->setTitle("Chargement");
groupbox->setFlat(1);
barre->setMaximum(100);
barre->setMinimum(0);
barre->setOrientation(Qt::Horizontal);
barre->setFixedSize(280, 20);
valeur = barre->value();
slider->setOrientation(Qt::Horizontal);
slider->setMaximum(101);
chargement(valeur, barre);
connect(nbre, SIGNAL(valueChanged(int)), barre, SLOT(setValue(int)));
connect(barre, SIGNAL(complet()), group_layout, SLOT(quit()));
group_layout->addWidget(barre);
group_layout->addWidget(slider);
groupbox->setLayout(group_layout);
groupbox->activateWindow();
groupbox->show();
} |
Partager