Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
5 July 2022
One of the key things to be efficient in as a software developer is avoiding repetitive tasks. Sometimes, this means that you have to leave your IDE and, instead, use tools like Perl, Python, Bash, or the like, on your source code.
Qt Creator does have some facilities for recording macros, which, together with block command, can often get you far.
In this episode, Jesper will demonstrate how he rewrote a larger piece of code in a previous episode.
0:00 Introduction to Keyboard Macros
1:13 Step 1: Get all of the records on the same line
2:30 Step 2: Align the column for cd's
3:48 Step 3: Make entries with "true" as wide as "false" - using search and replace
4:58 Step 4: Search and replace within a rectangle doesn't work
5:30 Step 4.2: removing comma's using rectangular edits
6:05 Step 5: Search and replace in rectangular to add "| download" "| MD", ...
8:44 Step 6: remove all the "false"
9:30 Step 7: Final touch up of the file
11:15 Introduction: Adding TRAC() to all function
12:50 Search and replace using regular expression
13:51 The actual macro recording
14:35 Saving macros for future sessions
15:52 Making a keybinding for macros
16:52 Ensure to bind Alt+r to run macros
All QML tips and tricks videos : https://www.youtube.com/playlist?list=PL6CJYn40gN6jWHP5krsQrVGyYtKh3A3be
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI