Qt-interest Archive, April 2008
how to add MOC step
Message 1 in thread
Hi,
In MS visual studio, how can I add mocing? what is the syntax?
---------------
Mahmood Naderan
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Message 2 in thread
You can generate your .vcproj from .pro file with qmake,
see qmake documentation. No need to write moc command lines.
C:\Qt\4.3.4\demos\gradients>dir
Volume in drive C has no label.
Volume Serial Number is BC09-E7B4
Directory of C:\Qt\4.3.4\demos\gradients
19.03.2008 15:29 <DIR> .
19.03.2008 15:29 <DIR> ..
19.02.2008 20:42 18 293 gradients.cpp
19.02.2008 20:42 3 899 gradients.h
19.02.2008 20:42 1 026 gradients.html
19.02.2008 20:42 433 gradients.pro
19.02.2008 20:42 147 gradients.qrc
19.02.2008 20:42 1 433 main.cpp
19.03.2008 15:29 <DIR> release
19.03.2008 15:28 <DIR> tmp
6 File(s) 25 231 bytes
4 Dir(s) 4 485 009 408 bytes free
C:\Qt\4.3.4\demos\gradients>qmake -tp vc gradients.pro
C:\Qt\4.3.4\demos\gradients>dir
Volume in drive C has no label.
Volume Serial Number is BC09-E7B4
Directory of C:\Qt\4.3.4\demos\gradients
22.04.2008 14:58 <DIR> .
22.04.2008 14:58 <DIR> ..
22.04.2008 14:58 <DIR> debug
19.02.2008 20:42 18 293 gradients.cpp
19.02.2008 20:42 3 899 gradients.h
19.02.2008 20:42 1 026 gradients.html
19.02.2008 20:42 433 gradients.pro
19.02.2008 20:42 147 gradients.qrc
22.04.2008 14:58 9 789 gradients.vcproj
19.02.2008 20:42 1 433 main.cpp
19.03.2008 15:29 <DIR> release
19.03.2008 15:28 <DIR> tmp
7 File(s) 35 020 bytes
5 Dir(s) 4 484 993 024 bytes free
C:\Qt\4.3.4\demos\gradients>type gradients.pro
SOURCES += main.cpp gradients.cpp
HEADERS += gradients.h
SHARED_FOLDER = ../shared
include($$SHARED_FOLDER/shared.pri)
RESOURCES += gradients.qrc
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl
}
# install
target.path = $$[QT_INSTALL_DEMOS]/gradients
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html
sources.path = $$[QT_INSTALL_DEMOS]/gradients
INSTALLS += target sources
C:\Qt\4.3.4\demos\gradients>
--
[ signature omitted ]
Message 3 in thread
If by "moc syntax" you mean "moc switches", just excute 'moc -help'.
If you intended to use MS visual studio without qmake for small scale
development, there is a way to run moc (and other qt tools) from inside
visual studio. Assuming you are using MSVS EE 2005, you can register
user tools through...
Tools > External Tools menu
Just put "qt moc" as name, put "P:\ath\to\qt\bin\moc.exe" in Command
and for the argument put "$(ItemFileName)$(ItemExt) -o moc_$(ItemFileName).cpp"
.
On Tue, Apr 22, 2008 at 7:53 PM, Mahmood Naderan <nt_mahmood@xxxxxxxxx> wrote:
>
>
> Hi,
> In MS visual studio, how can I add mocing? what is the syntax?
>
> ---------------
> Mahmood Naderan
> ________________________________
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
> now.
--
[ signature omitted ]
Message 4 in thread
Hi,
If by "moc syntax" you mean moc switches, just excute 'moc -help'.
to see all available switches. The basic one is :
moc <filename>.cpp -o moc_<filename>.cpp
If you intended to use MS visual studio without qmake for small scale
development, there is a way to run moc (and other qt tools) from inside
visual studio. Assuming you are using MSVS EE 2005, you can register
user tools through...
Tools > External Tools menu
Just put "qt moc" as name, put "P:\ath\to\qt\bin\moc.exe" in Command
and for the argument put "$(ItemFileName)$(ItemExt) -o moc_$(ItemFileName).cpp"
On Tue, Apr 22, 2008 at 7:53 PM, Mahmood Naderan <nt_mahmood@xxxxxxxxx> wrote:
>
>
> Hi,
> In MS visual studio, how can I add mocing? what is the syntax?
>
> ---------------
> Mahmood Naderan
> ________________________________
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it
> now.
--
[ signature omitted ]