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

Make it compiles without deprecated method

parent 7dd8b1d1
......@@ -27,6 +27,9 @@ find_package(KF5 REQUIRED COMPONENTS
IconThemes
KIO
)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
add_subdirectory(src)
add_subdirectory(doc)
......
......@@ -270,7 +270,7 @@ void CrontabPrinter::printPageNumber() {
d->painter->translate(0, - d->currentRowPosition);
d->printView->moveTo(QPoint(0, d->printView->height()) );
d->painter->translate( 0, - d->printView->height() );
d->painter->drawText(d->printView->right() - d->painter->fontMetrics().width(QString::number(d->page) ), d->printView->bottom()+ d->painter->fontMetrics().ascent() + 5, QString::number(d->page) );
d->painter->drawText(d->printView->right() - d->painter->fontMetrics().boundingRect(QString::number(d->page) ).width(), d->printView->bottom()+ d->painter->fontMetrics().ascent() + 5, QString::number(d->page) );
}
......@@ -289,7 +289,7 @@ int CrontabPrinter::computeMargin() const {
int CrontabPrinter::computeStringHeight(const QString& text) const {
int fontHeight = d->painter->fontMetrics().height();
int lines = d->painter->fontMetrics().width(text) / d->printView->width() + 1;
int lines = d->painter->fontMetrics().boundingRect(text).width() / d->printView->width() + 1;
int moveBy = (fontHeight + 2) * lines;
return moveBy;
......@@ -363,7 +363,7 @@ QList<int> CrontabPrinter::findMaxWidths(const QList<QStringList>& contents, int
int columnIndex = 0;
while (columnIndex < columnWidths.count()) {
int valueWidth = d->painter->fontMetrics().width(content.at(columnIndex));
const int valueWidth = d->painter->fontMetrics().boundingRect(content.at(columnIndex)).width();
if (columnWidths[columnIndex] < valueWidth) {
columnWidths[columnIndex] = valueWidth;
}
......
......@@ -1065,7 +1065,7 @@ NumberPushButton::NumberPushButton(QWidget * parent) :
NumberPushButton::NumberPushButton(bool digitMode, QWidget * parent) :
QPushButton(parent), isDirty(false) {
if (digitMode) {
setFixedWidth(12 + fontMetrics().width(QStringLiteral( "44" )));
setFixedWidth(12 + fontMetrics().boundingRect(QStringLiteral( "44" )).width());
KAcceleratorManager::setNoAccel(this);
}
updatePalette();
......
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