summaryrefslogtreecommitdiffstats
path: root/src/pdfquick/qquickpdfselection_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdfquick/qquickpdfselection_p.h')
-rw-r--r--src/pdfquick/qquickpdfselection_p.h71
1 files changed, 21 insertions, 50 deletions
diff --git a/src/pdfquick/qquickpdfselection_p.h b/src/pdfquick/qquickpdfselection_p.h
index b364a6c03..4f633a467 100644
--- a/src/pdfquick/qquickpdfselection_p.h
+++ b/src/pdfquick/qquickpdfselection_p.h
@@ -1,38 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtPDF module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QQUICKPDFSELECTION_P_H
#define QQUICKPDFSELECTION_P_H
@@ -50,11 +17,12 @@
#include <QtPdfQuick/private/qtpdfquickglobal_p.h>
#include <QtPdfQuick/private/qquickpdfdocument_p.h>
-#include <QPointF>
-#include <QPolygonF>
-#include <QVariant>
-#include <QtQml/qqml.h>
-#include <QtQuick/qquickitem.h>
+
+#include <QtCore/QPointF>
+#include <QtCore/QVariant>
+#include <QtGui/QPolygonF>
+#include <QtQml/QQmlEngine>
+#include <QtQuick/QQuickItem>
QT_BEGIN_NAMESPACE
class QPdfSelection;
@@ -65,15 +33,18 @@ class Q_PDFQUICK_EXPORT QQuickPdfSelection : public QQuickItem
Q_PROPERTY(QQuickPdfDocument *document READ document WRITE setDocument NOTIFY documentChanged)
Q_PROPERTY(int page READ page WRITE setPage NOTIFY pageChanged)
Q_PROPERTY(qreal renderScale READ renderScale WRITE setRenderScale NOTIFY renderScaleChanged)
- Q_PROPERTY(QPointF fromPoint READ fromPoint WRITE setFromPoint NOTIFY fromPointChanged)
- Q_PROPERTY(QPointF toPoint READ toPoint WRITE setToPoint NOTIFY toPointChanged)
+ Q_PROPERTY(QPointF from READ from WRITE setFrom NOTIFY fromChanged)
+ Q_PROPERTY(QPointF to READ to WRITE setTo NOTIFY toChanged)
Q_PROPERTY(bool hold READ hold WRITE setHold NOTIFY holdChanged)
Q_PROPERTY(QString text READ text NOTIFY textChanged)
Q_PROPERTY(QList<QPolygonF> geometry READ geometry NOTIFY selectedAreaChanged)
+ QML_NAMED_ELEMENT(PdfSelection)
+ QML_ADDED_IN_VERSION(5, 15)
public:
explicit QQuickPdfSelection(QQuickItem *parent = nullptr);
+ ~QQuickPdfSelection() override;
QQuickPdfDocument *document() const;
void setDocument(QQuickPdfDocument * document);
@@ -81,10 +52,10 @@ public:
void setPage(int page);
qreal renderScale() const;
void setRenderScale(qreal scale);
- QPointF fromPoint() const;
- void setFromPoint(QPointF fromPoint);
- QPointF toPoint() const;
- void setToPoint(QPointF toPoint);
+ QPointF from() const;
+ void setFrom(QPointF from);
+ QPointF to() const;
+ void setTo(QPointF to);
bool hold() const;
void setHold(bool hold);
@@ -101,8 +72,8 @@ signals:
void documentChanged();
void pageChanged();
void renderScaleChanged();
- void fromPointChanged();
- void toPointChanged();
+ void fromChanged();
+ void toChanged();
void holdChanged();
void textChanged();
void selectedAreaChanged();
@@ -124,8 +95,8 @@ private:
private:
QQuickPdfDocument *m_document = nullptr;
mutable QPointF m_hitPoint;
- QPointF m_fromPoint;
- mutable QPointF m_toPoint;
+ QPointF m_from;
+ mutable QPointF m_to;
qreal m_renderScale = 1;
mutable qreal m_heightAtAnchor = 0;
mutable qreal m_heightAtCursor = 0;