How to display text and number on QLCDNumber class widget?
-
Hi,
I have mainwindow.cpp
In that I used QLCDNumber widget to display Number+Character.
I want dispaly current value+'v'.
But It does't display the characater 'v' what to do
code:valx=new QLCDNumber(this); valx->setSegmentStyle(QLCDNumber::Flat); valx->setAutoFillBackground(true); valx->setFixedWidth(50); valx->setFixedHeight(25); valx->setFocusPolicy( Qt::WheelFocus ); valx->setPalette(pal); //signals used to connect to display connect(d_plot,SIGNAL( diffX(QString)),valx,SLOT(display(QString))); connect(d_plot,SIGNAL( diffY(QString)),valy,SLOT(display(QString)));
plot.cpp code:
//this methods are signalled to the mainwindow.cpp void Plot::calXY() { QPointF x1p=d_origin4->value(); QPointF x2p=d_origin3->value(); QPointF y1p=d_origin->value(); QPointF y2p=d_origin2->value(); diffX(QString::number((((x1p.x()))-((x2p.x()))))); diffY((QString::number((((y1p.y()))-((y2p.y())))+'v')));//here 'v' concatinated to value of the LCD label, SO why its not working? }
-
Hi,
QLCDNumber is designed to show numbers and only some letters as explained in the details of the class documentation. Therefore it might not be the best tool for your UI.
What does your
v
letter stand for ? -
Hi,
QLCDNumber is designed to show numbers and only some letters as explained in the details of the class documentation. Therefore it might not be the best tool for your UI.
What does your
v
letter stand for ? -
Or use an
U
that's a common smybol for the voltage as well, QLCDNumber should be able to display an U -
Or use an
U
that's a common smybol for the voltage as well, QLCDNumber should be able to display an U@J.Hilk
It could look like that :)
https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qlcdnumber.cpp.html
static const char *getSegments(char ch) -
@J.Hilk
It could look like that :)
https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qlcdnumber.cpp.html
static const char *getSegments(char ch)