Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile one file in QT Creator

Tags:

qt-creator

How to compile only one file from project in QT creator. Is there a hotkey? For example in VS you can press Ctrl F7 and compile your current cpp file.

like image 547
riopan Avatar asked Oct 16 '09 19:10

riopan


2 Answers

It is now possible to do it, since at least Qt Creator 2.8.1.

Use Build->Build file <filename> or the shortcut Ctrl+Alt+B:

enter image description here

Or right click on a file in the project view, and there is a Build item in the context menu that builds just that file:

enter image description here

You can track the feature request or vote for it at https://bugreports.qt.io/browse/QTCREATORBUG-106.

like image 193
danimo Avatar answered Oct 24 '22 11:10

danimo


Normally if you hit CTRL + B, Qt Creator will call make, which will in turn compile any files that have been modified since you compiled the last time. AFAIK there is no designated key for re-building the current file.

However, all Keystrokes can be configured in the application preferences General -> Keyboard. There are also a number of interesting other commands you might find useful.

like image 32
BastiBen Avatar answered Oct 24 '22 11:10

BastiBen