简体   繁体   English

在 Qt 中按下按钮时,GUI 设计不会更新

[英]GUI design doesn't update when button pressed in Qt

I'm trying to change colors on a graphic view to simulate traffic lights but I'm not sure why the colors doesn't change when the start button is clicked我正在尝试在图形视图上更改 colors 以模拟交通信号灯,但我不确定为什么单击开始按钮时 colors 没有更改

    void MainWindow::empezar_ciclo(){

    sleep_asm(3);  // waits a certain time to change color
    semdirE->setBrush(QBrush(Qt::red)); // changes the color of a drawed dot
}

    void MainWindow::on_start_clicked(){

  
    MainWindow:ui->start->hide();
   
   empezar_ciclo();}

it should work after all its following the program common order它应该在遵循程序通用顺序之后工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM