当前位置:网站首页>Text editor of QT project practice ---------- episode 8
Text editor of QT project practice ---------- episode 8
2022-06-25 00:59:00 【PureヾChan】
In the last episode, we implemented the operation of saving documents , This episode , We need to implement some operations on the text of the document , If revoked , rewrite , shear , Copy , Paste and so on .
towards mainWindow.h Add function :
public:
void docUndo();// revoke
void docRedo();// rewrite
void docCut();// shear
void docCopy();// Copy
void docPaste();// Paste The above function definition :
void MainWindow::docUndo()
{
if(activateChildWnd()){
activateChildWnd()->undo();
}
}
void MainWindow::docRedo()
{
if(activateChildWnd()){
activateChildWnd()->redo();
}
}
void MainWindow::docCut()
{
if(activateChildWnd()){
activateChildWnd()->cut();
}
}
void MainWindow::docCopy()
{
if(activateChildWnd()){
activateChildWnd()->copy();
}
}Whether it is to undo or rewrite some column operations , In fact, they are all documents, that is QTextEdit Class . And we actually create these functions for , With the main window Action Establish the link between signal and slot .
For cancellation, etc Action Create slot functions :
private slots:
void on_undoAction_triggered();
void on_redoAction_triggered();
void on_cutAction_triggered();
void on_copyAction_triggered();
void on_pasteAction_triggered();Function definition :
void MainWindow::on_undoAction_triggered()
{
docUndo();
}
void MainWindow::on_redoAction_triggered()
{
docRedo();
}
void MainWindow::on_cutAction_triggered()
{
docCut();
}
void MainWindow::on_copyAction_triggered()
{
docCopy();
}
void MainWindow::on_pasteAction_triggered()
{
docPaste();
}
The slot function automatically calls the function implemented in the main window when clicking . In this way, you can undo the text window , rewrite , shear , Copy , Paste a series of operations .
边栏推荐
- EVM简略
- Applet opening traffic master
- Mobile security tool apktool
- If the order has not been paid for 30 minutes, it will be automatically cancelled. How can I achieve this?
- 【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
- 【微服务|Sentinel】实时监控|RT|吞吐量|并发数|QPS
- Garbage collection of C closure
- Custom control - round dot progress bar (imitating one key acceleration in security guard)
- 2021-09-12
- Difficult and miscellaneous problems: A Study on the phenomenon of text fuzziness caused by transform
猜你喜欢

2022熔化焊接与热切割复训题库模拟考试平台操作

百公里加速仅5.92秒,威兰达高性能版以高能产品实力领跑
5-minute NLP: summary of 3 pre training libraries for rapid realization of NER

I brush the question I - copy the linked list with random pointer
![[micro service sentinel] real time monitoring | RT | throughput | concurrency | QPS](/img/fc/6b36759570b9b1007d2640009576d9.png)
[micro service sentinel] real time monitoring | RT | throughput | concurrency | QPS

2021-11-07
Paper review: U2 net, u-net composed of u-net

在企业级开发过程中我发现有位同事用select * from where 条件 for update

傳輸層 以字節為單比特的滑動窗口技術
@mysql
随机推荐
In the process of enterprise development, I found that a colleague used the select * from where condition for update
Leetcode 1248. 统计「优美子数组」(害,突然发现只会暴力枚举了)
Easy to wear - drop down radio
移动安全工具-jar
A small crawler program written by beginners
C#和C 的CAN通信实验
Mobile security tool -dex2jar
I brush the question I - copy the linked list with random pointer
Scrollview height cannot fill full screen
What is test development? Can you find a job at this stage?
Previous basic review
The basic principle and application of iterator and enhanced for
Usage of assert
Intensive reading of thinking about markdown
Binder mechanism and Aidl communication example
2019 summary and 2020 outlook
[redis realizes seckill service ④] one order for one person, and cannot be purchased repeatedly
2021-11-07
I'd like to ask how to open an account at industrial securities? Is it safe to open a stock account through the link
C# 闭包的垃圾回收