1 Star 10 Fork 3

QingwenYi/QtPreviewPDFByQPrintPreviewWidget

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
mainwindow.h 1.05 KB
Copy Edit Raw Blame History
QingwenYi authored 2021-12-03 14:27 . fix: 实现页面跳转功能
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QPdfWriter>
#include <QFile>
#include <QTextOption>
#include <QDateTime>
#include <memory>
#include <QPixmap>
#include <QFont>
#include <QPainter>
#include <QPen>
#include <QPrintPreviewWidget>
#include <QPrintPreviewDialog>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void on_pushButton_clicked();
void SlotPrintView(QPrinter *printer);
void SlotPreviewPdfOnWidget(QPrinter *printer);
void on_BtnWidgetPDF_clicked();
void on_BtnZoomOut_clicked();
void on_BtnZoomIn_clicked();
void on_BtnNextPage_clicked();
void on_BtnPrevPage_clicked();
void on_BtnFirstPage_clicked();
private:
Ui::MainWindow *ui;
QPrintPreviewWidget *printPreviewWidget = nullptr;//打印预览控件
QPrinter *pdfPrinter = nullptr;//pdf绘图printer
void CreatePdfPainter();
};
#endif // MAINWINDOW_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/Qwyi/qt-preview-pdf-qprint-preview-widget.git
git@gitee.com:Qwyi/qt-preview-pdf-qprint-preview-widget.git
Qwyi
qt-preview-pdf-qprint-preview-widget
QtPreviewPDFByQPrintPreviewWidget
master

Search