Commit a1fa73da authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile without deprecated method

parent 737959d5
......@@ -120,7 +120,7 @@ void BarGraph::paintEvent( QPaintEvent* )
* label does not fit no label is shown. */
bool showLabels = true;
for ( b = 0; b < bars; b++ )
if ( fm.width( footers[ b ] ) > barWidth )
if ( fm.boundingRect( footers[ b ] ).width() > barWidth )
showLabels = false;
int barHeight;
......
......@@ -122,7 +122,7 @@ class FancyPlotterLabel : public QLabel {
shortHeadingText = QLatin1String("<qt><font color=\"") + color.name() + QLatin1String("\">") + indicatorSymbol + QLatin1String("</font>");
noHeadingText = QLatin1String("<qt><font color=\"") + color.name() + QLatin1String("\">");
textMargin = fontMetrics().width(QLatin1Char('x')) + margin()*2 + frameWidth()*2;
textMargin = fontMetrics().boundingRect(QLatin1Char('x')).width() + margin()*2 + frameWidth()*2;
longHeadingWidth = fontMetrics().boundingRect(labelName + QLatin1String(" :") + indicatorSymbol + QLatin1String(" x")).width() + textMargin;
shortHeadingWidth = fontMetrics().boundingRect(indicatorSymbol).width() + textMargin;
setMinimumWidth(shortHeadingWidth);
......@@ -174,7 +174,7 @@ FancyPlotter::FancyPlotter( QWidget* parent,
QBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(0);
mPlotter = new KSignalPlotter( this );
int axisTextWidth = fontMetrics().width(i18nc("Largest axis title", "99999 XXXX"));
int axisTextWidth = fontMetrics().boundingRect(i18nc("Largest axis title", "99999 XXXX")).width();
mPlotter->setMaxAxisTextWidth( axisTextWidth );
mPlotter->setUseAutoRange( true );
mHeading = new QLabel(translatedTitle(), this);
......
......@@ -379,7 +379,7 @@ void LogSensor::answerReceived( int id, const QList<QByteArray>& answer ) //virt
const QDate date = QDateTime::currentDateTime().date();
const QTime time = QDateTime::currentDateTime().time();
stream << QStringLiteral( "%1 %2 %3 %4 %5: %6\n" ).arg( date.shortMonthName( date.month() ) )
stream << QStringLiteral( "%1 %2 %3 %4 %5: %6\n" ).arg( QLocale().monthName( date.month() ) )
.arg( date.day() ).arg( time.toString() )
.arg( mHostName).arg( mSensorName ).arg( value );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment