hello, sorry, I'm French so I'm talking with the translator, I want to change the image of a label based on a bool which is elsewhere in my program.
how can I do it???
THANKS
mainwindow.cpp
m_mainwindowThread.
m_label = new QLabel(m_window
);
m_mainwindowThread.afficheLabelArret();
m_mainwindowThread.m_label = new QLabel(m_window);
m_mainwindowThread.afficheLabelArret();
To copy to clipboard, switch view to plain text mode
thread.h
void afficheLabelArret();
QLabel *m_label;
void afficheLabelArret();
To copy to clipboard, switch view to plain text mode
thread.cpp
void Thread::afficheLabelArret()
{
if (m_threadGainable.labelModeFroid == true) {
m_label
->setPixmap
(QPixmap("/home/ludo/Qt/test2/build/images/froid.jpg"));
else if (m_threadGainable.labelModeChauffage == true) {
m_label
->setPixmap
(QPixmap("/home/ludo/Qt/test2/build/images/chauffage.jpg"));
} else {
m_label
->setPixmap
(QPixmap("/home/ludo/Qt/test2/build/images/abigael.jpg"));
}
}
void Thread::run()
{
while (1) {
afficheLabelArret();
}
}
void Thread::afficheLabelArret()
{
if (m_threadGainable.labelModeFroid == true) {
m_label ->setPixmap(QPixmap("/home/ludo/Qt/test2/build/images/froid.jpg"));
else if (m_threadGainable.labelModeChauffage == true) {
m_label ->setPixmap(QPixmap("/home/ludo/Qt/test2/build/images/chauffage.jpg"));
} else {
m_label ->setPixmap(QPixmap("/home/ludo/Qt/test2/build/images/abigael.jpg"));
}
}
void Thread::run()
{
while (1) {
afficheLabelArret();
}
}
To copy to clipboard, switch view to plain text mode
I have segfault randomly
Bookmarks