Commit 18a11991 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port deprecated method

parent 5ec48e40
......@@ -148,7 +148,7 @@ add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER)
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_subdirectory(src)
add_subdirectory(agents)
......
......@@ -743,7 +743,7 @@ void QWinMetaFile::extTextOut(long num, short *parm)
QByteArray text(ptStr, parm[ 2 ] + 1);
QFontMetrics fm(mPainter.font());
width = fm.width(QLatin1String(text)) + fm.descent(); // because fm.width(text) isn't rigth with Italic text
width = fm.boundingRect(QLatin1String(text)).width() + fm.descent(); // because fm.width(text) isn't rigth with Italic text
height = fm.height();
mPainter.save();
......
......@@ -229,7 +229,7 @@ QStyleOptionButton ConfigAgentDelegate::buttonOption(const QStyleOptionViewItem
QStyleOptionButton buttonOpt;
QRect buttonRect = option.rect;
int height = option.rect.height() / 2;
int width = 22 + option.fontMetrics.width(label) + 40; // icon size + label size + arrow and padding
int width = 22 + option.fontMetrics.boundingRect(label).width() + 40; // icon size + label size + arrow and padding
buttonRect.setTop(0);
buttonRect.setHeight(height);
buttonRect.setLeft(option.rect.right() - width);
......
......@@ -1396,11 +1396,11 @@ static Akonadi::Collection::List collect_collections(const QAbstractItemModel *m
QStack<QModelIndex> stack;
stack.push(parent);
while (!stack.isEmpty()) {
const auto idx = stack.pop();
const QModelIndex idx = stack.pop();
if (idx.isValid()) {
collections << model->data(idx, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
for (int i = model->rowCount(idx) - 1; i >= 0; --i) {
stack.push(idx.child(i, 0));
stack.push(model->index(i, 0, idx));
}
}
}
......
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