Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt widget update



  • Hi everone. Im trying to learn update issue of a widget. I want to ask something. What is the main difference between

    QWidget::update();
    

    and

     ui->groupBoxA->update();
    

    I have some progress bar on my group box, ı want to update them. What if im updating the widget or updating the group box



  • @suslucoder

    ui->groupBoxA->update(); calls update() on ui->groupBoxA. QWidget::update(); calls update() on whatever this is.

    As we have said before, you should not find you are needing to use update() at all. You would be best served by producing a minimal example where you claim it is necessary, for people to look at....


  • Lifetime Qt Champion

    @suslucoder The first one calls update() on the widget where it is called (same as this->update() except the widget overrides update() - in that case the base implementation is called).
    Second one calls update() on groupBox.
    This are C++ basics, nothing Qt related.


Log in to reply