Details
-
Bug
-
Resolution: Invalid
-
P4: Low
-
None
-
5.8.0
-
None
Description
In Kubuntu 17.04 and Manjaro KDE 17.0.1 updated
-------------------------------------------------------------------
Button class inherited from QToolButton class.
In calculator.cpp class file in line 148
Calculator::digitClicked() { Button *clickedButton = qobject_cast<Button *>(sender()); int digitValue = clickedButton->text().toInt(); // This line was added by me to debug and see the values qDebug() << "clicked : " << clickedButton->text() << " Digit Value: " << clickedButton->text().toInt() << "\n"; if (display->text() == "0" && digitValue == 0.0) return; if (waitingForOperand) { display->clear(); waitingForOperand = false; } display->setText(display->text() + QString::number(digitValue)); qDebug() << "display : " << display->text() << "\n"; }
When I run the code from konsole, the calculator display is not updated and when I press digits, for example 4, then 5, then 6
clicked : "&4" Digit Value: 0 clicked : "&5" Digit Value: 0 clicked : "&6" Digit Value: 0
For other buttons in the calculator for "=", "-", "*", "/", the button.text() returns correct QString i.e "=", "-", "*", "/" respectively.
In Windows 7
----------------------
There is no such problem in 32 bit mingw qt version 5.8 in windows 7.
For that the result is updated in calculator display.
Also
clicked : "4" Digit Value: 4 clicked : "5" Digit Value: 5 clicked : "6" Digit Value: 6