当前位置:网站首页>QT opens the print dialog box in a text editor
QT opens the print dialog box in a text editor
2022-06-25 14:50:00 【Happy Jiajia】
qt And Open the print dialog box in a text editor
QAction* actPrint;
actPrint = menu->addAction(tr("print"));
connect(actPrint, SIGNAL(triggered()), this, SLOT(doPrint()));
void MainWindow::doPrint()
{
QTextDocument * document = ui->textEdit->document();
QPrinter printer;
QPrintDialog dlg(&printer, this);
dlg.setWindowTitle(tr(" Print the document "));
if (dlg.exec() != QDialog::Accepted) {
return;
}
document->print(&printer);
}
边栏推荐
- [untitled]
- 如何裁剪动图大小?试试这个在线照片裁剪工具
- Use Matplotlib to draw a line chart
- 第一次读 “Clean” 系列,并没有觉得这是一本多好的书
- Ideal L9 in the eyes of the post-90s: the simplest product philosophy, creating the most popular products
- Go语言Zap库Logger的定制化和封装使用详解
- Application of TSDB in civil aircraft industry
- 网上股票开户安不安全?有谁知道呢
- What is the safest app for stock account opening? Tell me what you know
- Study notes of cmake
猜你喜欢

分享自己平时使用的socket多客户端通信的代码技术点和软件使用

让PyTorch训练速度更快,你需要掌握这17种方法

Position (5 ways)

Gif动画怎么在线制作?快试试这款gif在线制作工具

Kubernetes understands kubectl/ debugging

It's not easy to understand the data consistency of the microservice architecture for the first time after six years as a programmer

开餐馆

New good friend Pinia, leading the new era of state management

Variables, scopes, and variable promotion

【中国海洋大学】考研初试复试资料分享
随机推荐
Deconstruction assignment of variables
Using Sphinx to automatically generate API documents from py source files
JS to add elements to the header, or tail of an array
Arithmetic operations and expressions
Add the resources directory under test in idea
JGG | 河北大学杜会龙组综述植物泛基因组学研究
Clinical Chemistry | 张建中/徐健开发幽门螺杆菌单细胞精准诊疗技术
开餐馆
TSDB在民机行业中的应用
【HBZ分享】LockSupport的使用
中国电池技术取得重大突破,日韩美都落后了,中国巩固了领先优势
[try to hack] vulhub shooting range construction
Ideal L9 in the eyes of the post-90s: the simplest product philosophy, creating the most popular products
JS get the height and width corresponding to the box model (window.getcomputedstyle, dom.getboundingclientrect)
网上股票开户安不安全?有谁知道呢
Real variable instance
Differences between member variables and local variables
Study notes of cmake
Variables, scopes, and variable promotion
电源自动测试系统NSAT-8000,精准高速可靠的电源测试设备