Si j'ai bien tout capté, en changeant
le connect(numlights,SIGNAL(valueChanged(int)),this,SLOT(valueChanged(int)));
par
connect(numlights,SIGNAL(valueChanged(int)),this,SLOT(addlite(int)));
puis en ajoutant un simple tempo->show() dans le slot addlite(int), cela devrait suffire :
par exemple, on pourrait avoir
void Paramligts::addlite( int newValue )
{
QLabel* tempo = new QLabel( "", GBLights );
tempo->setText( QString( "N°%1").arg( newValue) );
tempo->show();
}
cela, pour afficher des label N°1, N°2 ... N°10
Si show() est omis, le QLabel est créé, mais pas affiché puisque à priori, la fenêtre est arrangée (layout, positions ...) au premier affichage, les modifications doivent être absolument explicites.
# A priori
Posté par idiotduvillage . En réponse au message Qt me joue des tours. Évalué à 1.
le connect(numlights,SIGNAL(valueChanged(int)),this,SLOT(valueChanged(int)));
par
connect(numlights,SIGNAL(valueChanged(int)),this,SLOT(addlite(int)));
puis en ajoutant un simple tempo->show() dans le slot addlite(int), cela devrait suffire :
par exemple, on pourrait avoir
void Paramligts::addlite( int newValue )
{
QLabel* tempo = new QLabel( "", GBLights );
tempo->setText( QString( "N°%1").arg( newValue) );
tempo->show();
}
cela, pour afficher des label N°1, N°2 ... N°10
Si show() est omis, le QLabel est créé, mais pas affiché puisque à priori, la fenêtre est arrangée (layout, positions ...) au premier affichage, les modifications doivent être absolument explicites.
En espérant que c'était le problème ...