Commit 4c5ad681 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Port kpMainWindow::pasteText from QDesktopWidget

It's gone in Qt 6.
parent 14d249c7
Pipeline #242731 canceled with stage
in 20 seconds
......@@ -35,8 +35,8 @@
#include <QImage>
#include <QList>
#include <QMenu>
#include <QDesktopWidget>
#include <QScrollBar>
#include <QScreen>
#include "kpLogCategories.h"
#include <KMessageBox>
......@@ -500,8 +500,9 @@ void kpMainWindow::pasteText (const QString &text,
width = std::max(width, fontMetrics.horizontalAdvance(str));
// limit the size to avoid memory overflow
width = qMin(qMax(QApplication::desktop()->width(), d->document ? d->document->width() : 0), width);
height = qMin(qMax(QApplication::desktop()->height(), d->document ? d->document->height() : 0), height);
const QSize desktopSize = QApplication::primaryScreen()->virtualSize();
width = qMin(qMax(desktopSize.width(), d->document ? d->document->width() : 0), width);
height = qMin(qMax(desktopSize.height(), d->document ? d->document->height() : 0), height);
const int selWidth = qMax (kpTextSelection::MinimumWidthForTextStyle (ts),
width + kpTextSelection::TextBorderSize () * 2);
......
Supports Markdown
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