1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
diff --git src/printing/calprintdefaultplugins.cpp src/printing/calprintdefaultplugins.cpp
index 862b74d..e3d802d 100644
--- src/printing/calprintdefaultplugins.cpp
+++ src/printing/calprintdefaultplugins.cpp
@@ -805,7 +805,7 @@ void CalPrintDay::print(QPainter &p, int width, int height)
QString line1 = local.toString(mFromDate, QLocale::ShortFormat);
QString line2 = local.toString(mToDate, QLocale::ShortFormat);
QString title;
- if (orientation() == QPrinter::Landscape) {
+ if (orientation() == QPageLayout::Landscape) {
title = i18nc("date from-to", "%1 - %2", line1, line2);
} else {
title = i18nc("date from-\nto", "%1 -\n%2", line1, line2);
@@ -1050,14 +1050,14 @@ void CalPrintWeek::saveConfig()
}
}
-QPrinter::Orientation CalPrintWeek::defaultOrientation() const
+QPageLayout::Orientation CalPrintWeek::defaultOrientation() const
{
if (mWeekPrintType == Filofax) {
- return QPrinter::Portrait;
+ return QPageLayout::Portrait;
} else if (mWeekPrintType == SplitWeek) {
- return QPrinter::Portrait;
+ return QPageLayout::Portrait;
} else {
- return QPrinter::Landscape;
+ return QPageLayout::Landscape;
}
}
@@ -1099,7 +1099,7 @@ void CalPrintWeek::print(QPainter &p, int width, int height)
do {
line1 = local.toString(curWeek.addDays(-6), QLocale::ShortFormat);
line2 = local.toString(curWeek, QLocale::ShortFormat);
- if (orientation() == QPrinter::Landscape) {
+ if (orientation() == QPageLayout::Landscape) {
title = i18nc("date from-to", "%1 - %2", line1, line2);
} else {
title = i18nc("date from-\nto", "%1 -\n%2", line1, line2);
@@ -1126,7 +1126,7 @@ void CalPrintWeek::print(QPainter &p, int width, int height)
do {
line1 = local.toString(curWeek.addDays(-6), QLocale::ShortFormat);
line2 = local.toString(curWeek, QLocale::ShortFormat);
- if (orientation() == QPrinter::Landscape) {
+ if (orientation() == QPageLayout::Landscape) {
title = i18nc("date from - to (week number)", "%1 - %2 (Week %3)",
line1, line2, curWeek.weekNumber());
} else {
diff --git src/printing/calprintdefaultplugins.h src/printing/calprintdefaultplugins.h
index 4df72f6..3f62d0b 100644
--- src/printing/calprintdefaultplugins.h
+++ src/printing/calprintdefaultplugins.h
@@ -53,9 +53,9 @@ public:
}
QWidget *createConfigWidget(QWidget *) override;
- Q_REQUIRED_RESULT QPrinter::Orientation defaultOrientation() const override
+ Q_REQUIRED_RESULT QPageLayout::Orientation defaultOrientation() const override
{
- return QPrinter::Portrait;
+ return QPageLayout::Portrait;
}
public:
@@ -166,7 +166,7 @@ public:
/**
Returns the default orientation for the eWeekPrintType.
*/
- QPrinter::Orientation defaultOrientation() const override;
+ QPageLayout::Orientation defaultOrientation() const override;
public:
void print(QPainter &p, int width, int height) override;
@@ -222,9 +222,9 @@ public:
}
QWidget *createConfigWidget(QWidget *) override;
- QPrinter::Orientation defaultOrientation() const override
+ QPageLayout::Orientation defaultOrientation() const override
{
- return QPrinter::Landscape;
+ return QPageLayout::Landscape;
}
public:
diff --git src/printing/calprinter.cpp src/printing/calprinter.cpp
index 182e0e3..10e9db6 100644
--- src/printing/calprinter.cpp
+++ src/printing/calprinter.cpp
@@ -126,13 +126,13 @@ void CalPrinter::doPrint(PrintPlugin *selectedStyle, CalPrinter::ePrintOrientati
QPrinter printer;
switch (dlgorientation) {
case eOrientPlugin:
- printer.setOrientation(selectedStyle->defaultOrientation());
+ printer.setPageOrientation(selectedStyle->defaultOrientation());
break;
case eOrientPortrait:
- printer.setOrientation(QPrinter::Portrait);
+ printer.setPageOrientation(QPageLayout::Portrait);
break;
case eOrientLandscape:
- printer.setOrientation(QPrinter::Landscape);
+ printer.setPageOrientation(QPageLayout::Landscape);
break;
case eOrientPrinter:
break;
diff --git src/printing/calprintpluginbase.cpp src/printing/calprintpluginbase.cpp
index e96f3b2..9db198e 100644
--- src/printing/calprintpluginbase.cpp
+++ src/printing/calprintpluginbase.cpp
@@ -232,9 +232,9 @@ void CalPrintPluginBase::setPrintFooter(bool printFooter)
mPrintFooter = printFooter;
}
-QPrinter::Orientation CalPrintPluginBase::orientation() const
+QPageLayout::Orientation CalPrintPluginBase::orientation() const
{
- return mPrinter ? mPrinter->orientation() : QPrinter::Portrait;
+ return mPrinter ? mPrinter->pageLayout().orientation() : QPageLayout::Portrait;
}
QColor CalPrintPluginBase::getTextColor(const QColor &c) const
@@ -326,7 +326,7 @@ int CalPrintPluginBase::headerHeight() const
{
if (mHeaderHeight >= 0) {
return mHeaderHeight;
- } else if (orientation() == QPrinter::Portrait) {
+ } else if (orientation() == QPageLayout::Portrait) {
return PORTRAIT_HEADER_HEIGHT;
} else {
return LANDSCAPE_HEADER_HEIGHT;
@@ -356,7 +356,7 @@ int CalPrintPluginBase::footerHeight() const
if (mFooterHeight >= 0) {
return mFooterHeight;
- } else if (orientation() == QPrinter::Portrait) {
+ } else if (orientation() == QPageLayout::Portrait) {
return PORTRAIT_FOOTER_HEIGHT;
} else {
return LANDSCAPE_FOOTER_HEIGHT;
diff --git src/printing/calprintpluginbase.h src/printing/calprintpluginbase.h
index ff1113c..b3d41ac 100644
--- src/printing/calprintpluginbase.h
+++ src/printing/calprintpluginbase.h
@@ -108,7 +108,7 @@ public:
*/
static int weekdayColumn(int weekday);
- QPrinter::Orientation orientation() const;
+ QPageLayout::Orientation orientation() const;
/** Returns the height of the page header. If the height was explicitly
set using setHeaderHeight, that value is returned, otherwise a
diff --git src/printing/printplugin.h src/printing/printplugin.h
index 57afdfe..73bf467 100644
--- src/printing/printplugin.h
+++ src/printing/printplugin.h
@@ -140,9 +140,9 @@ public:
config settings), implement this function in your subclass and
return the desired orientation.
*/
- virtual QPrinter::Orientation defaultOrientation() const
+ virtual QPageLayout::Orientation defaultOrientation() const
{
- return QPrinter::Portrait;
+ return QPageLayout::Portrait;
}
/**
diff --git src/printing/yearprint.cpp src/printing/yearprint.cpp
index 3287ca6..e57a1c4 100644
--- src/printing/yearprint.cpp
+++ src/printing/yearprint.cpp
@@ -82,9 +82,9 @@ void CalPrintYear::saveConfig()
}
}
-QPrinter::Orientation CalPrintYear::defaultOrientation() const
+QPageLayout::Orientation CalPrintYear::defaultOrientation() const
{
- return (mPages == 1) ? QPrinter::Landscape : QPrinter::Portrait;
+ return (mPages == 1) ? QPageLayout::Landscape : QPageLayout::Portrait;
}
void CalPrintYear::setDateRange(const QDate &from, const QDate &to)
@@ -131,7 +131,7 @@ void CalPrintYear::print(QPainter &p, int width, int height)
QString stdate = locale.toString(start, QLocale::ShortFormat);
QString endate = locale.toString(end, QLocale::ShortFormat);
QString title;
- if (orientation() == QPrinter::Landscape) {
+ if (orientation() == QPageLayout::Landscape) {
title = i18nc("date from - to", "%1 - %2", stdate, endate);
} else {
title = i18nc("date from -\nto", "%1 -\n%2", stdate, endate);
diff --git src/printing/yearprint.h src/printing/yearprint.h
index e59bf87..cd46a50 100644
--- src/printing/yearprint.h
+++ src/printing/yearprint.h
@@ -48,7 +48,7 @@ public:
}
QWidget *createConfigWidget(QWidget *) override;
- Q_REQUIRED_RESULT QPrinter::Orientation defaultOrientation() const override;
+ Q_REQUIRED_RESULT QPageLayout::Orientation defaultOrientation() const override;
public:
void print(QPainter &p, int width, int height) override;
|