I want to format my Qt code via a shortcut in Qt Creator, just like ctrl + shift + F
in Eclipse.
But didn't found one in Qt creator options, nor after searching via google.
So, do there has such a shortcut in Qt Creator? If no, then how to format code?
VSCode – Code Formatting ShortcutsOn Windows Shift + Alt + F. On macOS Shift + Option + F. On Linux Ctrl + Shift + I.
The simplest way to create a shortcut for a particular widget is to construct the shortcut with a key sequence. For example: shortcut = new QShortcut(QKeySequence(tr("Ctrl+O", "File|Open")), parent); When the user types the key sequence for a given shortcut, the shortcut's activated() signal is emitted.
QtCreator is stable enough and a comfortable IDE, although compile/debug cycles are slower on Windows than with Visual Studio. It doesn't have all the fancy features Visual Studio offers, but after using it for a while I just realized I wasn't missing them.
You can at least indent your code in the following way. First, select the portion of code you want to indent (or Ctrl + A, if you want to indent all source code in the current file) and then Ctrl + i.
If you're on a Mac OS X, use Command instead of Ctrl.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With