Sie sind auf Seite 1von 10

8/9/2015

Setting Up An Application - QtCreator

SettingUpAnApplicationWithQtCreator

Introduction
ThissetofinstructionswillwalkyouthroughsettingupaQtCreatorC++projectfromscratch.
WhenyouhavefinishedthistutorialyouwillbeabletocompileaworkingOgreApplicationandyouwillbereadytostarttheBasicTutorials.

Tableofcontents
Introduction
Prerequisites
NewProject
TutorialFramework
ProjectConfiguration
1.Definitions
2.FairUseRights
3.LicenseGrant
4.Restrictions
5.Representations,WarrantiesandDisclaimer
6.LimitationonLiability.
7.Termination
8.Miscellaneous

Prerequisites
GetQtCreatorfromqtproject.org.
Getthestableversion

thatfitsyoursetup.

NewProject
ClickNewProjectinthestartscreen,andchooseOtherProjectEmptyproject.

Giveitanameandaplace:

http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

1/10

8/9/2015

Setting Up An Application - QtCreator

Addfiles:(Tip:MoveyourcppandhfilestoinsidetheQtprojectfolderbeforeyoudothis!)

Filesadded:

Options:

http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

2/10

8/9/2015

Setting Up An Application - QtCreator

Qt4Settings:(Tip:InQt5thisiscalled"Build&Run".IfyouhaveinstalledVisualStudiobeforeyouinstalledtheVisualStudioQt5version,all
thisshouldalreadybecorrectsetup.,soyoudonothavetodoanythinghere.)

Editprojectfile:

TEMPLATE=app
TARGET=OgreQtProject

DEFINES=UNICODE
http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

3/10

8/9/2015

Setting Up An Application - QtCreator

CONFIG=qt

unix{
#Youmayneedtochangethisincludedirectory
INCLUDEPATH+=/usr/include/OGRE
CONFIG+=link_pkgconfig
PKGCONFIG+=OGRE
}
win32{
LIBS*=user32.lib
LIBS+=L$(OGRE_HOME)\\boost\\lib
release:LIBS+=L$(OGRE_HOME)\\lib\\release
debug:LIBS+=L$(OGRE_HOME)\\lib\\debug
INCLUDEPATH+=$(OGRE_HOME)\\include
INCLUDEPATH+=$(OGRE_HOME)\\include\\OIS
INCLUDEPATH+=$(OGRE_HOME)\\include\\OGRE
INCLUDEPATH+=$(OGRE_HOME)\\boost
#IfyouareusingOgre1.9alsoincludethefollowingline:
#INCLUDEPATH+=$(OGRE_HOME)\\include\\OGRE\\Overlay
}
debug{
TARGET=$$join(TARGET,,,d)
LIBS*=lOgreMain_dlOIS_d
#IfyouareusingOgre1.9alsoincludelOgreOverlay_d,likethis:
#LIBS*=lOgreMain_dlOIS_dlOgreOverlay_d
}
release{
LIBS*=lOgreMainlOIS
#IfyouareusingOgre1.9alsoincludelOgreOverlay,likethis:
#LIBS*=lOgreMainlOISlOgreOverlay
}
HEADERS+=\
TutorialApplication.h\
BaseApplication.h

SOURCES+=\
TutorialApplication.cpp\
BaseApplication.cpp

BuildAll:

BuildSettings:

http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

4/10

8/9/2015

Setting Up An Application - QtCreator

Note:IntheReleaseconfiguration,goto
"BuildSteps>qmake",press"Details"andadd

"CONFIG=debug""CONFIG+=release"
tothe"Additionalarguments:"
Thentothis:

CustomProcessStepsettings:dothisforboththeDebugandReleaseconfiguration:
Note:Youcanalsouseenvironmentvariableshere,in%signs.Likethis:

C:\Windows\System32\cmd.exe
/ccopydebug\OgreQtProjectd.exe%OGRE_HOME%\bin\debug
andyouprobablywanttoleavetheWorkingdirectorytothedefaulvalueof%{buildDir}.

http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

5/10

8/9/2015

Setting Up An Application - QtCreator

RunSettingsmustmakeonefordebug,oneforrelease:

NewRunConfiguration:
Note:Youcanalsouseenvironmentvariableshere,in%signs.Likethis:

Executable:OgreQtProjectd.exe
Workingdirectory:%OGRE_HOME%\bin\debug

TutorialFramework
TutorialFramework:

http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

6/10

8/9/2015

Setting Up An Application - QtCreator

DownloadtheOgreWikiTutorialFrameworkhere:
Nosuchattachmentonthispage

ProjectConfiguration

SEEALSO

QtCreatorTipsandTricks

THEWORK(ASDEFINEDBELOW)ISPROVIDEDUNDERTHETERMSOFTHISCREATIVECOMMONSPUBLICLICENSE("CCPL"OR
"LICENSE").THEWORKISPROTECTEDBYCOPYRIGHTAND/OROTHERAPPLICABLELAW.ANYUSEOFTHEWORKOTHERTHANAS
AUTHORIZEDUNDERTHISLICENSEORCOPYRIGHTLAWISPROHIBITED.
BYEXERCISINGANYRIGHTSTOTHEWORKPROVIDEDHERE,YOUACCEPTANDAGREETOBEBOUNDBYTHETERMSOFTHIS
LICENSE.THELICENSORGRANTSYOUTHERIGHTSCONTAINEDHEREINCONSIDERATIONOFYOURACCEPTANCEOFSUCHTERMS
ANDCONDITIONS.

1.Definitions
"CollectiveWork"meansawork,suchasaperiodicalissue,anthologyorencyclopedia,inwhichtheWorkinitsentiretyinunmodified
form,alongwithanumberofothercontributions,constitutingseparateandindependentworksinthemselves,areassembledintoa
collectivewhole.AworkthatconstitutesaCollectiveWorkwillnotbeconsideredaDerivativeWork(asdefinedbelow)forthepurposesof
thisLicense.
"DerivativeWork"meansaworkbasedupontheWorkorupontheWorkandotherpreexistingworks,suchasatranslation,musical
arrangement,dramatization,fictionalization,motionpictureversion,soundrecording,artreproduction,abridgment,condensation,orany
otherforminwhichtheWorkmayberecast,transformed,oradapted,exceptthataworkthatconstitutesaCollectiveWorkwillnotbe
consideredaDerivativeWorkforthepurposeofthisLicense.Fortheavoidanceofdoubt,wheretheWorkisamusicalcompositionor
soundrecording,thesynchronizationoftheWorkintimedrelationwithamovingimage("synching")willbeconsideredaDerivativeWork
forthepurposeofthisLicense.
"Licensor"meanstheindividualorentitythatofferstheWorkunderthetermsofthisLicense.
"OriginalAuthor"meanstheindividualorentitywhocreatedtheWork.
"Work"meansthecopyrightableworkofauthorshipofferedunderthetermsofthisLicense.
"You"meansanindividualorentityexercisingrightsunderthisLicensewhohasnotpreviouslyviolatedthetermsofthisLicensewith
respecttotheWork,orwhohasreceivedexpresspermissionfromtheLicensortoexerciserightsunderthisLicensedespiteaprevious
violation.
"LicenseElements"meansthefollowinghighlevellicenseattributesasselectedbyLicensorandindicatedinthetitleofthisLicense:
Attribution,ShareAlike.

http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

7/10

8/9/2015

Setting Up An Application - QtCreator

2.FairUseRights
Nothinginthislicenseisintendedtoreduce,limit,orrestrictanyrightsarisingfromfairuse,firstsaleorotherlimitationsontheexclusiverights
ofthecopyrightownerundercopyrightlaworotherapplicablelaws.

3.LicenseGrant
SubjecttothetermsandconditionsofthisLicense,LicensorherebygrantsYouaworldwide,royaltyfree,nonexclusive,perpetual(forthe
durationoftheapplicablecopyright)licensetoexercisetherightsintheWorkasstatedbelow:
toreproducetheWork,toincorporatetheWorkintooneormoreCollectiveWorks,andtoreproducetheWorkasincorporatedinthe
CollectiveWorks
tocreateandreproduceDerivativeWorks
todistributecopiesorphonorecordsof,displaypublicly,performpublicly,andperformpubliclybymeansofadigitalaudiotransmissionthe
WorkincludingasincorporatedinCollectiveWorks
todistributecopiesorphonorecordsof,displaypublicly,performpublicly,andperformpubliclybymeansofadigitalaudiotransmission
DerivativeWorks.
Fortheavoidanceofdoubt,wheretheworkisamusicalcomposition:
PerformanceRoyaltiesUnderBlanketLicenses.Licensorwaivestheexclusiverighttocollect,whetherindividuallyorviaa
performancerightssociety(e.g.ASCAP,BMI,SESAC),royaltiesforthepublicperformanceorpublicdigitalperformance(e.g.
webcast)oftheWork.
MechanicalRightsandStatutoryRoyalties.Licensorwaivestheexclusiverighttocollect,whetherindividuallyorviaamusicrights
societyordesignatedagent(e.g.HarryFoxAgency),royaltiesforanyphonorecordYoucreatefromtheWork("coverversion")and
distribute,subjecttothecompulsorylicensecreatedby17USCSection115oftheUSCopyrightAct(ortheequivalentinother
jurisdictions).
WebcastingRightsandStatutoryRoyalties.Fortheavoidanceofdoubt,wheretheWorkisasoundrecording,Licensorwaivesthe
exclusiverighttocollect,whetherindividuallyorviaaperformancerightssociety(e.g.SoundExchange),royaltiesforthepublic
digitalperformance(e.g.webcast)oftheWork,subjecttothecompulsorylicensecreatedby17USCSection114oftheUS
CopyrightAct(ortheequivalentinotherjurisdictions).

Theaboverightsmaybeexercisedinallmediaandformatswhethernowknownorhereafterdevised.Theaboverightsincludetherighttomake
suchmodificationsasaretechnicallynecessarytoexercisetherightsinothermediaandformats.AllrightsnotexpresslygrantedbyLicensor
areherebyreserved.

4.Restrictions
ThelicensegrantedinSection3aboveisexpresslymadesubjecttoandlimitedbythefollowingrestrictions:
Youmaydistribute,publiclydisplay,publiclyperform,orpubliclydigitallyperformtheWorkonlyunderthetermsofthisLicense,andYou
mustincludeacopyof,ortheUniformResourceIdentifierfor,thisLicensewitheverycopyorphonorecordoftheWorkYoudistribute,
publiclydisplay,publiclyperform,orpubliclydigitallyperform.YoumaynotofferorimposeanytermsontheWorkthatalterorrestrictthe
termsofthisLicenseortherecipients'exerciseoftherightsgrantedhereunder.YoumaynotsublicensetheWork.Youmustkeepintact
allnoticesthatrefertothisLicenseandtothedisclaimerofwarranties.Youmaynotdistribute,publiclydisplay,publiclyperform,or
publiclydigitallyperformtheWorkwithanytechnologicalmeasuresthatcontrolaccessoruseoftheWorkinamannerinconsistentwith
thetermsofthisLicenseAgreement.TheaboveappliestotheWorkasincorporatedinaCollectiveWork,butthisdoesnotrequirethe
CollectiveWorkapartfromtheWorkitselftobemadesubjecttothetermsofthisLicense.IfYoucreateaCollectiveWork,uponnotice
fromanyLicensorYoumust,totheextentpracticable,removefromtheCollectiveWorkanycreditasrequiredbyclause4(c),as
requested.IfYoucreateaDerivativeWork,uponnoticefromanyLicensorYoumust,totheextentpracticable,removefromtheDerivative
Workanycreditasrequiredbyclause4(c),asrequested.
Youmaydistribute,publiclydisplay,publiclyperform,orpubliclydigitallyperformaDerivativeWorkonlyunderthetermsofthisLicense,a
laterversionofthisLicensewiththesameLicenseElementsasthisLicense,oraCreativeCommonsiCommonslicensethatcontainsthe
sameLicenseElementsasthisLicense(e.g.AttributionShareAlike2.5Japan).Youmustincludeacopyof,ortheUniformResource
Identifierfor,thisLicenseorotherlicensespecifiedintheprevioussentencewitheverycopyorphonorecordofeachDerivativeWorkYou
distribute,publiclydisplay,publiclyperform,orpubliclydigitallyperform.YoumaynotofferorimposeanytermsontheDerivativeWorks
thatalterorrestrictthetermsofthisLicenseortherecipients'exerciseoftherightsgrantedhereunder,andYoumustkeepintactall
noticesthatrefertothisLicenseandtothedisclaimerofwarranties.Youmaynotdistribute,publiclydisplay,publiclyperform,orpublicly
digitallyperformtheDerivativeWorkwithanytechnologicalmeasuresthatcontrolaccessoruseoftheWorkinamannerinconsistentwith
thetermsofthisLicenseAgreement.TheaboveappliestotheDerivativeWorkasincorporatedinaCollectiveWork,butthisdoesnot
requiretheCollectiveWorkapartfromtheDerivativeWorkitselftobemadesubjecttothetermsofthisLicense.
Ifyoudistribute,publiclydisplay,publiclyperform,orpubliclydigitallyperformtheWorkoranyDerivativeWorksorCollectiveWorks,You
http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

8/10

8/9/2015

Setting Up An Application - QtCreator

mustkeepintactallcopyrightnoticesfortheWorkandprovide,reasonabletothemediumormeansYouareutilizing:(i)thenameofthe
OriginalAuthor(orpseudonym,ifapplicable)ifsupplied,and/or(ii)iftheOriginalAuthorand/orLicensordesignateanotherpartyorparties
(e.g.asponsorinstitute,publishingentity,journal)forattributioninLicensor'scopyrightnotice,termsofserviceorbyotherreasonable
means,thenameofsuchpartyorpartiesthetitleoftheWorkifsuppliedtotheextentreasonablypracticable,theUniformResource
Identifier,ifany,thatLicensorspecifiestobeassociatedwiththeWork,unlesssuchURIdoesnotrefertothecopyrightnoticeorlicensing
informationfortheWorkandinthecaseofaDerivativeWork,acreditidentifyingtheuseoftheWorkintheDerivativeWork(e.g.,"French
translationoftheWorkbyOriginalAuthor,"or"ScreenplaybasedonoriginalWorkbyOriginalAuthor").Suchcreditmaybeimplemented
inanyreasonablemannerprovided,however,thatinthecaseofaDerivativeWorkorCollectiveWork,ataminimumsuchcreditwill
appearwhereanyothercomparableauthorshipcreditappearsandinamanneratleastasprominentassuchothercomparableauthorship
credit.

5.Representations,WarrantiesandDisclaimer
UNLESSOTHERWISEAGREEDTOBYTHEPARTIESINWRITING,LICENSOROFFERSTHEWORKASISANDMAKESNO
REPRESENTATIONSORWARRANTIESOFANYKINDCONCERNINGTHEMATERIALS,EXPRESS,IMPLIED,STATUTORYOR
OTHERWISE,INCLUDING,WITHOUTLIMITATION,WARRANTIESOFTITLE,MERCHANTIBILITY,FITNESSFORAPARTICULARPURPOSE,
NONINFRINGEMENT,ORTHEABSENCEOFLATENTOROTHERDEFECTS,ACCURACY,ORTHEPRESENCEOFABSENCEOF
ERRORS,WHETHERORNOTDISCOVERABLE.SOMEJURISDICTIONSDONOTALLOWTHEEXCLUSIONOFIMPLIEDWARRANTIES,SO
SUCHEXCLUSIONMAYNOTAPPLYTOYOU.

6.LimitationonLiability.
EXCEPTTOTHEEXTENTREQUIREDBYAPPLICABLELAW,INNOEVENTWILLLICENSORBELIABLETOYOUONANYLEGALTHEORY
FORANYSPECIAL,INCIDENTAL,CONSEQUENTIAL,PUNITIVEOREXEMPLARYDAMAGESARISINGOUTOFTHISLICENSEORTHEUSE
OFTHEWORK,EVENIFLICENSORHASBEENADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGES.

7.Termination
ThisLicenseandtherightsgrantedhereunderwillterminateautomaticallyuponanybreachbyYouofthetermsofthisLicense.Individuals
orentitieswhohavereceivedDerivativeWorksorCollectiveWorksfromYouunderthisLicense,however,willnothavetheirlicenses
terminatedprovidedsuchindividualsorentitiesremaininfullcompliancewiththoselicenses.Sections1,2,5,6,7,and8willsurviveany
terminationofthisLicense.
Subjecttotheabovetermsandconditions,thelicensegrantedhereisperpetual(forthedurationoftheapplicablecopyrightintheWork).
Notwithstandingtheabove,LicensorreservestherighttoreleasetheWorkunderdifferentlicensetermsortostopdistributingtheWorkat
anytimeprovided,howeverthatanysuchelectionwillnotservetowithdrawthisLicense(oranyotherlicensethathasbeen,orisrequired
tobe,grantedunderthetermsofthisLicense),andthisLicensewillcontinueinfullforceandeffectunlessterminatedasstatedabove.

8.Miscellaneous
EachtimeYoudistributeorpubliclydigitallyperformtheWorkoraCollectiveWork,theLicensorofferstotherecipientalicensetothe
WorkonthesametermsandconditionsasthelicensegrantedtoYouunderthisLicense.
EachtimeYoudistributeorpubliclydigitallyperformaDerivativeWork,LicensorofferstotherecipientalicensetotheoriginalWorkonthe
sametermsandconditionsasthelicensegrantedtoYouunderthisLicense.
IfanyprovisionofthisLicenseisinvalidorunenforceableunderapplicablelaw,itshallnotaffectthevalidityorenforceabilityofthe
remainderofthetermsofthisLicense,andwithoutfurtheractionbythepartiestothisagreement,suchprovisionshallbereformedtothe
minimumextentnecessarytomakesuchprovisionvalidandenforceable.
NotermorprovisionofthisLicenseshallbedeemedwaivedandnobreachconsentedtounlesssuchwaiverorconsentshallbeinwriting
andsignedbythepartytobechargedwithsuchwaiverorconsent.
ThisLicenseconstitutestheentireagreementbetweenthepartieswithrespecttotheWorklicensedhere.Therearenounderstandings,
agreementsorrepresentationswithrespecttotheWorknotspecifiedhere.Licensorshallnotbeboundbyanyadditionalprovisionsthat
mayappearinanycommunicationfromYou.ThisLicensemaynotbemodifiedwithoutthemutualwrittenagreementoftheLicensorand
You.

The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.
The original document is available at http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Setting+Up+An+Application++QtCreator

http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

9/10

8/9/2015

Setting Up An Application - QtCreator

http://www.ogre3d.org/tikiwiki/tiki-print.php?page_ref_id=1885&page=Setting%20Up%20An%20Application%20-%20QtCreator

10/10