FaqCplusPlusQtCustomDefs

(Difference between revisions)
(I want to use Qt feature FOO but there is no corresponding checkbox in project properties. What can I do?)
 
(One intermediate revision not shown)
Line 1: Line 1:
-
__NOTOC__
 
__NOTOC__
__NOTOC__
====I want to use Qt feature FOO but there is no corresponding checkbox in project properties. What can I do?====
====I want to use Qt feature FOO but there is no corresponding checkbox in project properties. What can I do?====
Line 13: Line 12:
Q: How do I enable QtScript module? <br>
Q: How do I enable QtScript module? <br>
-
A: Add <pre>QT += script</pre> to Qt -> Expert -> Custom Definitions.
+
A: Add <tt>QT += script</tt> to Qt -> Expert -> Custom Definitions.
-
Q: How do I add compiler flag <pre>-std=gnu++0x</pre>? <br>
+
Q: How do I add compiler flag <tt>-std=gnu++0x</tt>? <br>
-
A: Add <pre>QMAKE_CXXFLAGS += -std=gnu++0x</pre> to Qt -> Expert -> Custom Definitions.
+
A: Add <tt>QMAKE_CXXFLAGS += -std=gnu++0x</tt> to Qt -> Expert -> Custom Definitions.

Current revision as of 10:29, 8 November 2009

I want to use Qt feature FOO but there is no corresponding checkbox in project properties. What can I do?

Qt build system (qmake) has so many features and configuration options, that it's impossible to put them in a nice and simple GUI. NetBeans project properties have GUI controls for most common properties only.

If you need something special, put your qmake code into Qt -> Expert -> Custom Definitions in project properties. Editing *.pro files under nbproject/ directly is not recommended, because those files are overwritten automatically without warning.

See Qmake Variable Reference for description of qmake variables.


Examples

Q: How do I enable QtScript module?
A: Add QT += script to Qt -> Expert -> Custom Definitions.

Q: How do I add compiler flag -std=gnu++0x?
A: Add QMAKE_CXXFLAGS += -std=gnu++0x to Qt -> Expert -> Custom Definitions.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo