QPageSetupDialog Class
QPageSetupDialog 类为打印机的页面相关选项提供了一个配置对话框。更多内容...
| 头文件: | #include <QPageSetupDialog> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS PrintSupport) target_link_libraries(mytarget PRIVATE Qt6::PrintSupport) |
| qmake: | QT += printsupport |
| 继承自: | QDialog |
- 所有成员列表(包括继承的成员)
- QPageSetupDialog 属于“标准对话框”以及“打印机和打印 API”的一部分。
公共函数
| QPageSetupDialog(QWidget *parent = nullptr) | |
| QPageSetupDialog(QPrinter *printer, QWidget *parent = nullptr) | |
| virtual | ~QPageSetupDialog() |
| void | open(QObject *receiver, const char *member) |
| QPrinter * | printer() |
重新实现的公共函数
| virtual void | done(int result) override |
| virtual int | exec() override |
| virtual void | setVisible(bool visible) override |
详细说明
在 Windows 和 macOS 上,页面设置对话框是通过原生页面设置对话框实现的。
请注意,在 Windows 和 macOS 上,自定义纸张尺寸不会反映在原生页面设置对话框中。此外,在QPrinter 上设置的自定义页面边距也不会显示在原生 macOS 页面设置对话框中。
另请参阅 QPrinter 和QPrintDialog 。
成员函数文档
[explicit] QPageSetupDialog::QPageSetupDialog(QWidget *parent = nullptr)
创建一个页面设置对话框,用于配置一个默认生成的QPrinter ,并将parent 设为其父控件。
另请参阅 printer()。
[explicit] QPageSetupDialog::QPageSetupDialog(QPrinter *printer, QWidget *parent = nullptr)
创建一个页面设置对话框,用于配置printer ,并将parent 设为其父控件。
[virtual noexcept] QPageSetupDialog::~QPageSetupDialog()
关闭“页面设置”对话框。
[override virtual] void QPageSetupDialog::done(int result)
重新实现了:QDialog::done (int r)。
[override virtual] int QPageSetupDialog::exec()
重写自:QDialog::exec()。
调用此虚拟函数以弹出对话框。子类必须重写此函数。
void QPageSetupDialog::open(QObject *receiver, const char *member)
打开对话框,并将对话框的accepted()信号连接到由receiver 和member 指定的槽。
当对话框关闭时,该信号将与该槽断开连接。
QPrinter *QPageSetupDialog::printer()
返回传递给QPageSetupDialog 构造函数的打印机。
[override virtual] void QPageSetupDialog::setVisible(bool visible)
重写了:QDialog::setVisible (bool visible)。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.