ich möchte gerne die Textfarbe des QLabels ändern in einer Methode welche ich zyklisch(jede 200ms) aufrufe und habe folgendes ausprobiert:
Code: Alles auswählen
void myApp::update()
{
m_Label_InitConnection->setText("test");
m_Label_InitConnection->setStyleSheet("color: red");
}
Daher habe ich folgendes ausprobiert
Code: Alles auswählen
void myApp::update()
{
QPalette o_palette = m_Label_InitConnection->palette();
o_palette.setColor(QPalette::WindowText, Qt::red);
m_Label_InitConnection->setPalette(o_palette);
m_Label_InitConnection->setText(text);
}
Könnte mir jemand erklären warum das obere nicht geht, respektive warum ein Memmoryleak auftaucht?
vielen Dank im voraus