Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpdfpageselector.h
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPDFPAGESELECTOR_H
5#define QPDFPAGESELECTOR_H
6
7#include <QtPdfWidgets/qtpdfwidgetsglobal.h>
8
9#include <QtWidgets/qwidget.h>
10
11#include <memory>
12
13QT_BEGIN_NAMESPACE
14
15class QPdfDocument;
17
18class Q_PDF_WIDGETS_EXPORT QPdfPageSelector : public QWidget
19{
20 Q_OBJECT
21
22 Q_PROPERTY(QPdfDocument* document READ document WRITE setDocument NOTIFY documentChanged)
23 Q_PROPERTY(int currentPage READ currentPage WRITE setCurrentPage NOTIFY currentPageChanged USER true)
24 Q_PROPERTY(QString currentPageLabel READ currentPageLabel NOTIFY currentPageLabelChanged)
25public:
26 QPdfPageSelector() : QPdfPageSelector(nullptr) {}
27 explicit QPdfPageSelector(QWidget *parent);
28 ~QPdfPageSelector() override;
29
30 void setDocument(QPdfDocument *document);
31 QPdfDocument *document() const;
32
33 int currentPage() const;
34 QString currentPageLabel() const;
35
36public Q_SLOTS:
37 void setCurrentPage(int index);
38
39Q_SIGNALS:
40 void documentChanged(QPdfDocument *document);
41 void currentPageChanged(int index);
42 void currentPageLabelChanged(const QString &label);
43
44private:
45 Q_DECLARE_PRIVATE(QPdfPageSelector)
46 const std::unique_ptr<QPdfPageSelectorPrivate> d_ptr;
47};
48
49QT_END_NAMESPACE
50
51#endif // QPDFPAGESELECTOR_H
QValidator::State validate(QString &text, int &pos) const override
This virtual function is called by the QAbstractSpinBox to determine whether input is valid.
int valueFromText(const QString &text) const override
This virtual function is used by the spin box whenever it needs to interpret text entered by the user...
void setDocument(QPdfDocument *document)
QString textFromValue(int value) const override
This virtual function is used by the spin box whenever it needs to display the given value.
\inmodule QtPdf