MacOS 10.15.16
QT version 5.15
Creator 4.12.4
Hey everyone,
I am having a really annoying issue with buttons in my project. I made a very simple project that can replicate the bug.
What happens is when I click the remove button to remove an item, the next time I click the add button will always require me to click it twice. It does not register the first time.
I narrowed down the issue but have no idea how to fix it.
The problem is from layouts I think. The first screenshot shows it working works fine, does not require two clicks. But when I add the new button in the same layout as the remove button, that is when it happens.
Screen Shot 2020-08-13 at 6.11.22 PM.jpg
Screen Shot 2020-08-13 at 6.11.02 PM.jpg
Here are the only lines of code in my project
void MainWindow::on_removeItemButton_clicked()
{
ui->listWidget->takeItem(ui->listWidget->currentRow());
}
void MainWindow::on_addItemButton_clicked()
{
ui->listWidget->addItem("test");
}
I noticed that this happens with many things I try to do. Here is an instance where if I put everything inside a Tab Widget, the first time running the app will require two clicks on any of those buttons.
Clicking on an itemList item however works fine.
Screen Shot 2020-08-13 at 6.25.35 PM.jpg
The issue only applies to buttons. Nothing else is being affected by this.
Any ideas?
Bookmarks