riopan
riopan

Reputation: 246

Compile one file in 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.

Upvotes: 13

Views: 8547

Answers (2)

danimo
danimo

Reputation: 574

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.

Upvotes: 10

BastiBen
BastiBen

Reputation: 19880

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.

Upvotes: 1

Related Questions