-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPageSize.cpp
More file actions
34 lines (27 loc) · 841 Bytes
/
PageSize.cpp
File metadata and controls
34 lines (27 loc) · 841 Bytes
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
/**
* Copyright (c) 2014 Cyrille Berger <cberger@cberger.net>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "PageSize.h"
PageSize::PageSize(QQuickItem *parent) :
QQuickItem(parent), m_unit(Point), m_pageSize(QPageSize::A4)
{
}
void PageSize::setWidth(qreal _width)
{
m_pageSize = QPageSize(QSizeF(_width, height()), QPageSize::Unit(m_unit));
emit(pageSizeChanged());
}
void PageSize::setHeight(qreal _height)
{
m_pageSize = QPageSize(QSizeF(width(), _height), QPageSize::Unit(m_unit));
emit(pageSizeChanged());
}
void PageSize::setPageSizeId(PageSizeId _id)
{
m_pageSize = QPageSize(QPageSize::PageSizeId(_id));
emit(pageSizeChanged());
}