Unsolved Only QPushButton don't call repaint ?
-
Hi guys I have experienced very strange behavior on my mini Qt App?
I put empty QComboBox to my dialog which is connected to a QPushButton and QRadioButton.
Both of QPushButton and QRadioButton has connected a func which simply call AddItem func on QComboBox.After the QRadioButton has been clicked the Combobox gets a new item and it appears right away.
If I clicked on QPushButton though, there is a new item as well but only appears if I lost the focus and get back to the dialog. So it looks like there is a repaint issue associated only with a QPushButton.PS: In the older version, I not experienced this behavior and my current setup is :
MacOs: 10.15.4
Xcode: 11.5.1
Qt: 5.13.2
Qt Creator 4.12.1Code below:
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButton_clicked() { ui->comboBox->addItem("insert 1"); } void MainWindow::on_radioButton_toggled(bool checked) { ui->comboBox->addItem("insert 1"); }
-
Hi
I have seen some bug reports about MacOs and repainting.
Please try
void MainWindow::on_pushButton_clicked()
{
ui->comboBox->addItem("insert 1");
ui->comboBox->update();
}and see if it then works every time.
-
@mrjj said in Only QPushButton don't call repaint ?:
ui->comboBox->update();
It not helped at all. Still same behavior.
-
@Tony123
Ok
and the bug i was think of , seems to be fixed in that version.
https://bugreports.qt.io/browse/QTBUG-68740Did you update to Catalina recently ?
-
@mrjj Currently I using Catalina 10.15.4 but I tested mini-app on 10.15.5 as well and the same issue appears.
-
Could you test with a newer Qt`?
Qt 51.5 says
but Qt 5.13
and this issue is really odd so i wonder if its a compatibility issue.
-
@mrjj Thanks for this information. I try to go to the newer version (5.14.2, 5.15) of Qt but with no luck on Mac, I also created an issue related to this https://forum.qt.io/topic/114783/can-t-compile-my-project-after-updating-xcode-and-qt which is not resolved yet.
-
This post is deleted!