Fix tray visibility and message reception issues
Some checks failed
build / build-win64 (push) Waiting to run
build / build-macos (push) Waiting to run
build / build-pip (push) Failing after 16s

- Disable sound initialization to prevent hanging
- Add missing import re in utils.py
- Fix settings loading for QSettings
- Update file paths to use PROJECT_ROOT
- Revert to working API paths and listener from commit efdc63e
This commit is contained in:
kdusek
2025-12-07 22:39:07 +01:00
parent 7b695d7b7f
commit 5138303016
4060 changed files with 579123 additions and 23 deletions

View File

@@ -0,0 +1,6 @@
# Automatically generated configuration for PyQt6.QtPdf.
sip-version = "6.14.0"
sip-abi-version = "13.8"
module-tags = ["Qt_6_10_0", "Linux"]
module-disabled-features = ["PyQt_OpenGL_ES2"]

View File

@@ -0,0 +1,57 @@
// QtPdfmod.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%Module(name=PyQt6.QtPdf, keyword_arguments="Optional", use_limited_api=True)
%Import QtCore/QtCoremod.sip
%Import QtGui/QtGuimod.sip
%Copying
Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
This file is part of PyQt6.
This file may be used under the terms of the GNU General Public License
version 3.0 as published by the Free Software Foundation and appearing in
the file LICENSE included in the packaging of this file. Please review the
following information to ensure the GNU General Public License version 3.0
requirements will be met: http://www.gnu.org/copyleft/gpl.html.
If you do not wish to use this file under the terms of the GPL version 3.0
then you may purchase a commercial license. For more information contact
info@riverbankcomputing.com.
This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%End
%DefaultSupertype PyQt6.sip.simplewrapper
%Include qpdfbookmarkmodel.sip
%Include qpdfdocument.sip
%Include qpdfdocumentrenderoptions.sip
%Include qpdflink.sip
%Include qpdflinkmodel.sip
%Include qpdfpagenavigator.sip
%Include qpdfpagerenderer.sip
%Include qpdfsearchmodel.sip
%Include qpdfselection.sip

View File

@@ -0,0 +1,52 @@
// qpdfbookmarkmodel.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QPdfBookmarkModel : public QAbstractItemModel
{
%TypeHeaderCode
#include <qpdfbookmarkmodel.h>
%End
public:
enum class Role /BaseType=IntEnum/
{
Title,
Level,
Page,
Location,
Zoom,
};
explicit QPdfBookmarkModel(QObject *parent /TransferThis/);
virtual ~QPdfBookmarkModel();
QPdfDocument *document() const;
void setDocument(QPdfDocument *document);
virtual QVariant data(const QModelIndex &index, int role) const;
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
virtual QModelIndex parent(const QModelIndex &index) const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual QHash<int, QByteArray> roleNames() const;
signals:
void documentChanged(QPdfDocument *document);
};

View File

@@ -0,0 +1,132 @@
// qpdfdocument.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QPdfDocument : public QObject
{
%TypeHeaderCode
#include <qpdfdocument.h>
%End
%ConvertToSubClassCode
static struct class_graph {
const char *name;
sipTypeDef **type;
int yes, no;
} graph[] = {
{sipName_QPdfBookmarkModel, &sipType_QPdfBookmarkModel, -1, 1},
{sipName_QPdfDocument, &sipType_QPdfDocument, -1, 2},
#if QT_VERSION >= 0x060600
{sipName_QPdfLinkModel, &sipType_QPdfLinkModel, -1, 3},
#else
{0, 0, -1, 3},
#endif
{sipName_QPdfPageNavigator, &sipType_QPdfPageNavigator, -1, 4},
{sipName_QPdfPageRenderer, &sipType_QPdfPageRenderer, -1, 5},
{sipName_QPdfSearchModel, &sipType_QPdfSearchModel, -1, -1},
};
int i = 0;
sipType = NULL;
do
{
struct class_graph *cg = &graph[i];
if (cg->name != NULL && sipCpp->inherits(cg->name))
{
sipType = *cg->type;
i = cg->yes;
}
else
i = cg->no;
}
while (i >= 0);
%End
public:
enum class Status
{
Null,
Loading,
Ready,
Unloading,
Error,
};
enum class Error
{
None,
Unknown,
DataNotYetAvailable,
FileNotFound,
InvalidFileFormat,
IncorrectPassword,
UnsupportedSecurityScheme,
};
enum class MetaDataField
{
Title,
Subject,
Author,
Keywords,
Producer,
Creator,
CreationDate,
ModificationDate,
};
enum class PageModelRole /BaseType=IntEnum/
{
Label,
PointSize,
};
explicit QPdfDocument(QObject *parent /TransferThis/);
virtual ~QPdfDocument();
QPdfDocument::Error load(const QString &fileName) /ReleaseGIL/;
void load(QIODevice *device) /ReleaseGIL/;
QPdfDocument::Status status() const;
void setPassword(const QString &password);
QString password() const;
QVariant metaData(QPdfDocument::MetaDataField field) const;
QPdfDocument::Error error() const;
void close();
int pageCount() const;
QSizeF pagePointSize(int page) const;
QString pageLabel(int page);
QAbstractListModel *pageModel();
QImage render(int page, QSize imageSize, QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions());
QPdfSelection getSelection(int page, QPointF start, QPointF end);
QPdfSelection getSelectionAtIndex(int page, int startIndex, int maxLength);
QPdfSelection getAllText(int page);
%If (Qt_6_6_0 -)
int pageIndexForLabel(const QString &label);
%End
signals:
void passwordChanged();
void statusChanged(QPdfDocument::Status status);
void pageCountChanged(int pageCount);
void pageModelChanged();
};

View File

@@ -0,0 +1,63 @@
// qpdfdocumentrenderoptions.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QPdfDocumentRenderOptions
{
%TypeHeaderCode
#include <qpdfdocumentrenderoptions.h>
%End
public:
enum class Rotation
{
None,
Clockwise90,
Clockwise180,
Clockwise270,
};
enum class RenderFlag
{
None,
Annotations,
OptimizedForLcd,
Grayscale,
ForceHalftone,
TextAliased,
ImageAliased,
PathAliased,
};
typedef QFlags<QPdfDocumentRenderOptions::RenderFlag> RenderFlags;
QPdfDocumentRenderOptions();
QPdfDocumentRenderOptions::Rotation rotation() const;
void setRotation(QPdfDocumentRenderOptions::Rotation r);
QPdfDocumentRenderOptions::RenderFlags renderFlags() const;
void setRenderFlags(QPdfDocumentRenderOptions::RenderFlags r);
QRect scaledClipRect() const;
void setScaledClipRect(const QRect &r);
QSize scaledSize() const;
void setScaledSize(const QSize &s);
};
bool operator==(const QPdfDocumentRenderOptions &lhs, const QPdfDocumentRenderOptions &rhs);
bool operator!=(const QPdfDocumentRenderOptions &lhs, const QPdfDocumentRenderOptions &rhs);

View File

@@ -0,0 +1,44 @@
// qpdflink.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QPdfLink
{
%TypeHeaderCode
#include <qpdflink.h>
%End
public:
QPdfLink();
QPdfLink(const QPdfLink &other);
~QPdfLink();
void swap(QPdfLink &other);
bool isValid() const;
int page() const;
QPointF location() const;
qreal zoom() const;
QUrl url() const;
QString contextBefore() const;
QString contextAfter() const;
QList<QRectF> rectangles() const;
QString toString() const;
void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const;
};

View File

@@ -0,0 +1,60 @@
// qpdflinkmodel.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
%If (Qt_6_6_0 -)
class QPdfLinkModel : public QAbstractListModel
{
%TypeHeaderCode
#include <qpdflinkmodel.h>
%End
public:
enum class Role
{
Link,
Rectangle,
Url,
Page,
Location,
Zoom,
};
explicit QPdfLinkModel(QObject *parent /TransferThis/ = 0);
virtual ~QPdfLinkModel();
QPdfDocument *document() const;
virtual QHash<int, QByteArray> roleNames() const;
virtual int rowCount(const QModelIndex &parent) const;
virtual QVariant data(const QModelIndex &index, int role) const;
int page() const;
QPdfLink linkAt(QPointF point) const;
public slots:
void setDocument(QPdfDocument *document);
void setPage(int page);
signals:
void documentChanged();
void pageChanged(int page);
};
%End

View File

@@ -0,0 +1,53 @@
// qpdfpagenavigator.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QPdfPageNavigator : public QObject
{
%TypeHeaderCode
#include <qpdfpagenavigator.h>
%End
public:
explicit QPdfPageNavigator(QObject *parent /TransferThis/);
virtual ~QPdfPageNavigator();
int currentPage() const;
QPointF currentLocation() const;
qreal currentZoom() const;
bool backAvailable() const;
bool forwardAvailable() const;
public slots:
void clear();
void jump(QPdfLink destination);
void jump(int page, const QPointF &location, qreal zoom = 0);
void update(int page, const QPointF &location, qreal zoom);
void forward();
void back();
signals:
void currentPageChanged(int page);
void currentLocationChanged(QPointF location);
void currentZoomChanged(qreal zoom);
void backAvailableChanged(bool available);
void forwardAvailableChanged(bool available);
void jumped(QPdfLink current);
};

View File

@@ -0,0 +1,47 @@
// qpdfpagerenderer.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QPdfPageRenderer : public QObject
{
%TypeHeaderCode
#include <qpdfpagerenderer.h>
%End
public:
enum class RenderMode
{
MultiThreaded,
SingleThreaded,
};
explicit QPdfPageRenderer(QObject *parent /TransferThis/);
virtual ~QPdfPageRenderer();
QPdfPageRenderer::RenderMode renderMode() const;
void setRenderMode(QPdfPageRenderer::RenderMode mode);
QPdfDocument *document() const;
void setDocument(QPdfDocument *document);
quint64 requestPage(int pageNumber, QSize imageSize, QPdfDocumentRenderOptions options = QPdfDocumentRenderOptions());
signals:
void documentChanged(QPdfDocument *document);
void renderModeChanged(QPdfPageRenderer::RenderMode renderMode);
};

View File

@@ -0,0 +1,69 @@
// qpdfsearchmodel.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QPdfSearchModel : public QAbstractListModel
{
%TypeHeaderCode
#include <qpdfsearchmodel.h>
%End
public:
enum class Role /BaseType=IntEnum/
{
Page,
IndexOnPage,
Location,
ContextBefore,
ContextAfter,
};
explicit QPdfSearchModel(QObject *parent /TransferThis/);
virtual ~QPdfSearchModel();
QList<QPdfLink> resultsOnPage(int page) const;
QPdfLink resultAtIndex(int index) const;
QPdfDocument *document() const;
QString searchString() const;
virtual QHash<int, QByteArray> roleNames() const;
virtual int rowCount(const QModelIndex &parent) const;
virtual QVariant data(const QModelIndex &index, int role) const;
public slots:
void setSearchString(const QString &searchString);
void setDocument(QPdfDocument *document);
signals:
void documentChanged();
void searchStringChanged();
protected:
virtual void timerEvent(QTimerEvent *event);
public:
%If (Qt_6_8_0 -)
int count() const /__len__/;
%End
signals:
%If (Qt_6_8_0 -)
void countChanged();
%End
};

View File

@@ -0,0 +1,43 @@
// qpdfselection.sip generated by MetaSIP
//
// This file is part of the QtPdf Python extension module.
//
// Copyright (c) 2025 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of PyQt6.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
class QPdfSelection
{
%TypeHeaderCode
#include <qpdfselection.h>
%End
public:
QPdfSelection(const QPdfSelection &other);
~QPdfSelection();
void swap(QPdfSelection &other);
bool isValid() const;
QList<QPolygonF> bounds() const;
QString text() const;
QRectF boundingRectangle() const;
int startIndex() const;
int endIndex() const;
void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const;
private:
QPdfSelection();
};