Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
KolourPaint
Commits
4c5ad681
Commit
4c5ad681
authored
Oct 06, 2022
by
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
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
mainWindow/kpMainWindow_Edit.cpp
View file @
4c5ad681
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment