Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Which output (display) widget are available.
ACalcaterra last edited by
sorry to ask a really simple question: but what if I want to display in a widget a float number produced in my code?
The only thing I find for this is a LCD_display that i don't like much.
Is not there something like a QtLineEdit (same fonts) that does not accept
mouse focus, or keystrokes? (maybe with a grayed out background, but not essential)
I use QtCreator 2.5.2, Qt version is 4.8.6, last one that works in Scientific Linux 6. Going forward from this is quite painful because of upgrading gcc.
micland last edited by micland
@ACalcaterra If your just want to show the value, take a
QLabeland format the float value as string.
QLabel *myLabel = new QLabel(this); myLayout->addWidget(myLabel); myLabel->setText(QString::number(myFloat, 'f', 2));
You probably want
QLabel. It's simplistic, but it's the simplest display widget out there. You can also use a
QLineEditthat has its