134 Generate Visual Studio project for a QBS project in Qt Creator

As most Qt users we love Qt Creator for the daily use. But sometimes we need to fall back to Visual Studio for various reasons. Most often to get the best debugger available on Windows today.

QBS supports the generation of project files. It supports XCode and various Visual Studio versions. Unfortunately Qt Creator has no built in solution to generate our project files.

But we have various options:

  • Add “Custom Process Steps” to our “Build Steps” to our project
    • Only exists in the .user file of your project and easily gets lost
    • Runs with every build, unless disabled
  • Add an “External Tool” to Qt Creator
    • Run on demand for the current project

I will show you both options, so you can decide what fits your needs.

Now I have to show you another thing. QBS generates a lot of filter folders to the visual studio project. Look at this project, that has only a main.cpp file.

QBS generates a lot of filter folders.

Quelle: HicknHack Software GmbH

There are no options to change the solution generation of QBS. So I tried to delete all the *.filters files. Now all files are placed next to each other in each project.

Project without the filters

Quelle: HicknHack Software GmbH

Please also note that the subfolder structure of your files is never represented inside Visual Studio. For debugging purposes this is good enough.

Now back to the solution generation.

Custom Build Steps

To get custom build steps into your project proceed with the following steps.

Open your QBS project in Qt Creator and go to the Projects mode. Your Kit has to be Visual Studio based. Add two “Custom Process Steps”.

The first step should be configured like this:

  • Command: Browse for the qbs.exe inside your Qt Creator bin directory.
  • Arguments: generate -g visualstudio2017 -f "%{CurrentProject:NativeFilePath}" -d "%{buildDir}\msvc" --settings-dir "%{Session:NativePath}\qbs\1.12.0" config:%{CurrentBuild:Name}
    • These work with the latest Qt Creator 4.7.0.
    • You need to adapt this for your Visual Studio version and QBS version.

The second step, removes the undesired *.filters files:

  • Command: %ComSpec%
  • Arguments: /c del %{buildDir}\msvc\*.filters

It should look like this:

QBS custom build steps

Quelle: HicknHack Software GmbH

With this the Visual Studio project is now generated with every build. But this takes time and is unnecessary, as QBS takes care of updating the Visual Studio project anyways.

External Tool

I wrote a .bat file for this external tool (qbsvs2017gen.bat). Download the file and store it somewhere convenient.

To use it, drill down the menu of Qt Creator – Tools > External > Configure…

In the dialog you add a new tool. I named mine QBS Generate VS2017. And configured the tool like this:

  • Description: Generates a Visual Studio 2017 project for current QBS project
  • Executable: Browse for the saved batch file.
  • Arguments: "%{CurrentProject:NativeFilePath}" "%{CurrentProject:BuildPath}\vs" "C:\Qt\Tools\QtCreator\bin\qbs.exe" "%{Session:NativePath}\qbs" "%{CurrentBuild:Name}" "%{CurrentKit:Id}"

The batch file expects the following arguments:

  1. Full path to your project file
  2. Target directory where the visual studio project is created
  3. Full path to the qbs.exe (It’s inside you Qt Creator bin directory)
  4. The QBS settings base path
  5. “Debug” / “Release” build name (No switching in Visual Studio allowed)
  6. UUID of the Kit QtCreator uses (The QBS profile will be derived from that)

Mine looked like this when I was done:

QBS Qt Creator external tools configuration

Quelle: HicknHack Software GmbH

Now you can simply invoke this external tool and generate the Visual Studio project files for your current project. You may also assign a keyboard hot key to the tool if you like.

Here is the code of the batch file:

@echo off
set OLD_CD=%CD%

:: Extract Arguments
set PROJECT=%~1
set TARGET_DIR=%~2
set QBS=%~3
set QBS_SETTINGS_DIR=%~4
set CONFIG=%~5
set KIT=%~6

:: Load VC-Vars
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64 >nul

:: Extract QBS Version
FOR /F "tokens=* USEBACKQ" %%F IN (`%QBS% --version`) DO (SET QBS_VERSION=%%F)

:: Extract QBS Profile
FOR /F "tokens=2 delims=: USEBACKQ" %%F IN (`call %QBS% config --settings-dir "%QBS_SETTINGS_DIR%\%QBS_VERSION%" "preferences.qtcreator.kit.%KIT%"`) DO (
    SET RAW_PROFILE=%%~F
)
set PROFILE2=%RAW_PROFILE:"=%
set PROFILE=%PROFILE2: =%

echo QBS version %QBS_VERSION%
echo Project %PROJECT%
echo Target %TARGET_DIR%
echo Profile %PROFILE%

:: Invoke QBS generator
echo "%QBS%" generate -g visualstudio2017 -f "%PROJECT%" -d "%TARGET_DIR%" --settings-dir "%QBS_SETTINGS_DIR%\%QBS_VERSION%" profile:%PROFILE% config:%CONFIG%
call "%QBS%" generate -g visualstudio2017 -f "%PROJECT%" -d "%TARGET_DIR%" --settings-dir "%QBS_SETTINGS_DIR%\%QBS_VERSION%" profile:%PROFILE% config:%CONFIG% >nul

:: Remove .filters files
del "%TARGET_DIR%\*.filters"

cd /d "%OLD_CD%"

Changelog:

  • 2018-07-24 Added Support for QBS profiles to allow Qt based applications to use Visual Studio as well.
←zurück
02.03.2021

rx online cialis <a href="https://buycialisxz.com/%20">cialis online from canada </a> kamagranow cialis

26.03.2021

[url=https://dissertationahelp.com/]dissertation uk[/url] uk dissertation writing service <a href="http://dissertationahelp.com/%20">education dissertation topics</a> master dissertation

05.05.2021

cialis 20 mg [url=http://rcialisgl.com/ ]cialis free offer[/url] 20 mg 30 pills cialis

28.07.2021

personal ads free
[url="http://datingonlinecome.com/?"]lara spencer dating 2021[/url]

11.08.2021

viagra active ingredient <a href="https://viaedpik.com/">how to get viagra without a prescription</a> viagra tablets [url=https://viaedpik.com/]viagra canadian pharmacy[/url] ’

13.08.2021

testosterone cypionate canada pharmacy <a href="https://storpharmon.com/">prescription drug assistance</a> advanced care rx pharmacy [url=https://storpharmon.com/]legitimate online canadian pharmacies[/url] ’

13.08.2021

what does viagra do to women <a href="https://onviamen.com/">viagra interactions</a> viagra single packs commercial [url=https://onviamen.com/]how to make natural viagra[/url] ’

13.08.2021

gay dating in graduate school
no sex gay dating site
[url="http://freegaychatnew.com?"]arkansas sexy gay dating site[/url]

15.08.2021

zoloft generic names <a href="https://zoloftsertralinest.com/">zoloft with alcohol</a> sertraline generic name [url=https://zoloftsertralinest.com/]sertraline 50 mg side effects[/url] ’

17.08.2021

atorvastatin (lipitor) <a href="https://lipitoratorvastatinfg.com/">atorvastatin dose range</a> lipitor side effects muscle pain [url=https://lipitoratorvastatinfg.com/]lipitor generic brand[/url] ’

17.08.2021

how long does cymbalta take to work <a href="https://cymbaltaduloxetinetg.com/">cymbalta side effects weight gain</a> side effects of cymbalta 20 mg [url=https://cymbaltaduloxetinetg.com/]generic of cymbalta[/url] ’

28.08.2021
preaskest

<a href="http://buysildenshop.com/">Viagra</a>

07.09.2021

[url=https://wherecialis.online/]can i buy cialis online[/url] [url=https://cialisgenuine.online/]buy discount cialis[/url] [url=https://albendazolealbenza.online/]buy albendazole online uk[/url] [url=https://onlinepharmacyone.online/]online pharmacy in germany[/url] [url=https://poipharmacy.online/]canadian pharmacy viagra 50 mg[/url] [url=https://pharmx5.online/]cost of ivermectin pill[/url]

13.09.2021

[url=http://supersildenafil.online/]sildenafil price comparison in india[/url] [url=http://sildenafilftab.online/]sildenafil 100mg canadian pharmacy[/url] [url=http://sildenafilmstore.online/]75 mg sildenafil[/url] [url=http://hydroxychloroquinepharm.online/]hydroxychloroquine 10 price[/url] [url=http://sildenafilttab.online/]sildenafil in usa[/url]

13.09.2021

levitra coupon printable products cialis price at walmart pharmacy <a href="https://gncedstore.com/">viagra online generic</a> kroger ph walmart coupon policy printable top 20 generic pharmaceutical companies

16.09.2021

[url=http://viagradx.online/]200 mg viagra online[/url] [url=http://siviagra.online/]buy viagra over the counter usa[/url] [url=http://ondansetronzofran.online/]zofran in mexico[/url] [url=http://sildenafilsx.online/]sildenafil generic otc[/url] [url=http://viagrarb.online/]buy viagra tablet online in india[/url] [url=http://ivermectinsp.online/]buy stromectol[/url] [url=http://norxtadalafil.online/]6mg tadalafil[/url] [url=http://pharmacylong.online/]foreign pharmacy online[/url]

17.09.2021
albubre

<a href="https://buyzithromaxinf.com/">where can i buy zithromax over the counter</a>

17.09.2021

best over the counter diet supplement men's supplements reviews manufacturers coupons for prescription drugs <a href="https://cialismars.com/">cialis tadalafil 10mg tablets</a> merck patient assistance program application best generic viagra reviews mixing alcohol and medication

20.09.2021

[url=http://viagrahim.com/]viagra 200 mg online[/url] [url=http://viagraonlinex.com/]buy real viagra online in india[/url] [url=http://sildenafilbr.com/]sildenafil 85[/url] [url=http://buytadalafiloverthecounter.com/]100 mg tadalafil[/url] [url=http://ivermectinplus.com/]ivermectin 4000[/url] [url=http://hydroxychloquinenova.com/]hydroxychloroquine plaquenil[/url] [url=http://dcviagra.com/]viagra online from canada[/url] [url=http://howtobuyivermectin.com/]stromectol medicine[/url] [url=http://buyviagrawithoutrx.com/]eu pharmacy viagra[/url] [url=http://cialisoraltabs.com/]brand cialis[/url]

23.09.2021

[url=https://ivermectinx.com/]stromectol[/url]

23.09.2021

[url=http://buycialistb.com/]purchase cialis with paypal[/url]

24.09.2021

[url=http://tadalafilgenericpill.com/]buy tadalafil 10mg[/url]

24.09.2021

[url=http://viagragenerictabs.com/]buy real viagra from canada[/url]

25.09.2021

[url=http://buycialistb.com/]best generic cialis[/url]

26.09.2021

[url=http://tadalafilxrem.com/]levitra cialis viagra[/url]

26.09.2021

[url=http://buytretinoinretina.online/]over the counter tretinoin canada[/url] [url=http://finasteridepill.online/]finasteride 5 mg tablet[/url] [url=http://egthealth.online/]ivermectin buy uk[/url] [url=http://cialisgenericnow.online/]buy online cialis 20mg[/url] [url=http://sildenafilcitviagra.online/]sildenafil online purchase[/url] [url=http://onlytabrx.online/]erectafil 20[/url] [url=http://cialisopill.online/]cialis generic drug[/url] [url=http://cialischeapbuy.online/]can you buy cialis over the counter usa[/url]

26.09.2021

[url=http://buyviagrawithoutdoctor.com/]viagra in india[/url]

26.09.2021

[url=http://ihealthblue.com/]valtrex 1000[/url] [url=http://cialisbv.com/]where to buy cialis without prescription[/url] [url=http://iotapharm.com/]good online mexican pharmacy[/url] [url=http://tadalafilgenericpill.com/]tadalafil 30[/url] [url=http://genericviagrabuying.com/]female viagra drug[/url]

27.09.2021

womens viagra pill herbal viagra side effects <a href="https://viagradia.com/">can you buy generic viagra in canada</a> viagra for sell viagra costs at walmart red male enhancement pills

28.09.2021

[url=http://abctadalafil.com/]generic cialis 5mg[/url]

28.09.2021

[url=http://xviagrageneric.com/]viagra 200mg tablet[/url]

29.09.2021

[url=https://flagylpills.com/]cheap flagyl[/url]

30.09.2021

viagra for young men huggies free newborn starter kit <a href="https://viagraherse.com/">generic viagra 100mg</a> levitra sample pack does walmart pharmacy accept medicaid

30.09.2021

[url=http://buyivermectinoverthecounter.com/]price of ivermectin[/url]

12.11.2021

[url=http://tadalafil.shop/]cheap tadalafil tablets[/url]

12.11.2021

[url=https://lisinopril.quest/]lisinopril 2019[/url]

13.11.2021

[url=https://hydroxychloroquine.today/]hydroxychloroquine 200 mg oral tablet[/url]

13.11.2021

[url=https://buydoxycycline.quest/]order doxycycline[/url]

14.11.2021

[url=https://sildenafil.men/]sildenafil 5 mg price[/url]

15.11.2021

[url=http://tadalafil.site/]tadalafil 20 mg no rx for sale[/url]

15.11.2021

[url=https://albendazole.online/]albendazole price in mexico[/url]

15.11.2021

[url=http://baclofen.quest/]baclofen 30 mg[/url]

16.11.2021

[url=https://ivermectin.monster/]stromectol coronavirus[/url]

16.11.2021

[url=https://azithromycin.monster/]where can i buy azithromycin over the counter[/url]

16.11.2021

[url=https://hydroxychloroquine.today/]quineprox 75mg[/url]

16.11.2021

[url=http://cialis.eus/]cialis 20mg price in mexico[/url]

16.11.2021

[url=https://ivermectin.onl/]ivermectin 5 mg[/url]

17.11.2021

[url=http://buycheapcialis.quest/]soft cialis online[/url]

17.11.2021

[url=http://ivermectin.digital/]where to buy ivermectin cream[/url]

17.11.2021

[url=https://genericcialis.quest/]cialis price europe[/url]

17.11.2021

[url=https://buycialis.best/]buy cialis online cheap uk[/url]

18.11.2021

modalert online <a href="https://modafinilprovigill.com/%20">provigil medication </a>

19.11.2021

[url=http://onlinepharmacy.quest/]best canadian pharmacy to order from[/url]

19.11.2021

[url=http://tadalafil.live/]tadalafil 5mg tablets in india[/url]

19.11.2021

provigil 100 mg <a href="https://modafinilmate.com/%20">modafinil side effects </a>

19.11.2021

[url=https://tadalafil.boutique/]tadalafil 5mg price in india[/url]

19.11.2021

[url=https://buylexapro.online/]generic lexapro 20 mg cost[/url]

19.11.2021

[url=https://lipitor.monster/]lipitor 2018[/url]

20.11.2021

[url=http://onlinedrugstore.quest/]save on pharmacy[/url]

20.11.2021

[url=http://cleocinbuy.online/]clindamycin gel price in india[/url]

20.11.2021

casino online slots <a href="https://casinogameswm.com/%20">casino game </a> [url=https://casinogameswm.com/ ]play casino slots [/url]

21.11.2021

[url=https://viagrabluetabs.com/]buy real viagra online usa[/url]

21.11.2021

slots online <a href="https://casinogameswm.com/%20">free casino slot games </a> [url=https://casinogameswm.com/ ]real casino slots [/url]

21.11.2021

[url=https://ivermectin.faith/]ivermectin cost in usa[/url]

21.11.2021

<a href="https://provigilvsmodafinil.com/%20">order modafinil </a>

22.11.2021

world class casino slots <a href="https://casinorealmoneyeo.com/%20">slots games free </a> https://casinorealmoneyeo.com/

22.11.2021

play slots <a href="https://nodepositcasinodem.com/%20">free online slots </a> [url=https://nodepositcasinodem.com/ ]slots online [/url]

22.11.2021

[url=https://buylexapro.online/]cheapest lexapro generic[/url]

22.11.2021

[url=http://sildalis.online/]sildalis[/url]

22.11.2021

buy modalert online <a href="https://provigilzmodafinil.com/%20">provigil over the counter </a>

22.11.2021

provigil online <a href="https://provigilmodafinilfast.com/%20">provigil cost </a>

22.11.2021

slots for real money <a href="https://casinorealmoneycm.com/%20">casino blackjack </a> https://casinorealmoneycm.com/

22.11.2021

provigil price <a href="https://provigilzmodafinil.com/%20">provigil pill </a>

22.11.2021

modafinil weight loss <a href="https://provigilmate.com/%20">modalert online </a>

23.11.2021

[url=https://phenergan.quest/]phenergan gel cost[/url]

23.11.2021

<a href="https://provigilvsmodafinil.com/%20">provigil price </a>

23.11.2021

<a href="https://usamodafinilprovigil.com/%20">modalert online </a>

23.11.2021

modalert 200 <a href="https://provigilmodafinilfast.com/%20">modafinil generic </a>

24.11.2021

provigil online <a href="https://modafinilzprovigil.com/%20">provigil 100 mg </a>

24.11.2021

play online casino <a href="https://nodepositcasinodem.com/%20">online slot games </a> [url=https://nodepositcasinodem.com/ ]free casino slot games [/url]

24.11.2021

[url=http://viagracr.com/]genuine viagra australia[/url]

24.11.2021

[url=http://lexapro.monster/]20mg lexapro[/url] [url=http://lipitor.monster/]generic lipitor online[/url] [url=http://sildenafil.click/]sildenafil best price uk[/url] [url=http://bactrim.monster/]septra online[/url] [url=http://ivermectin.review/]ivermectin buy nz[/url] [url=http://tadalafil.live/]generic tadalafil canada[/url] [url=http://tadalafilgmed.com/]tadalafil 20mg price uk[/url] [url=http://ivermectin.email/]ivermectin 6mg[/url] [url=http://benicar.monster/]benicar 20 mg best price[/url] [url=http://phenergan.quest/]phenergan tablets nz[/url]

24.11.2021

provigil <a href="https://provigilzmodafinil.com/%20">provigil over the counter </a>

24.11.2021

cashman casino slots <a href="https://casinorealmoneyeo.com/%20">online casino </a> https://casinorealmoneyeo.com/

24.11.2021

provigil price <a href="https://provigilmodafinilfast.com/%20">modafinil online </a>

24.11.2021

best online casinos <a href="https://casinorealmoneyeo.com/%20">casino play </a> https://casinorealmoneyeo.com/

25.11.2021

provigil side effects <a href="https://provigilmate.com/%20">modafinil online </a>

25.11.2021

slots free <a href="https://casinoplaycl.com/%20">casino online slots </a> https://casinoplaycl.com/

25.11.2021

[url=http://retinoa.quest/]retino 0.05[/url]

25.11.2021

play slots online <a href="https://casinoplaycl.com/%20">play casino </a> https://casinoplaycl.com/

25.11.2021

casino play <a href="https://casinorealmoneyekj.com/%20">big fish casino </a> https://casinorealmoneyekj.com/

26.11.2021

[url=https://ivermectincv.quest/]stromectol for sale[/url]

26.11.2021

[url=https://viagra100.quest/]how to purchase viagra[/url]

26.11.2021

[url=https://ivermectinxsale.online/]ivermectin 2%[/url]

26.11.2021

provigil generic <a href="https://modafinilmate.com/%20">modafinil </a>

26.11.2021

[url=http://canadacialis.quest/]5mg cialis daily[/url]

26.11.2021

vegas casino slots <a href="https://nodepositcasinoem.com/%20">online casino slots </a>

27.11.2021

[url=http://tadalafilpills.quest/]cheap tadalafil canada[/url]

27.11.2021

[url=https://overthecounterviagra.quest/]viagra 100mg in canada[/url]

27.11.2021

free slots <a href="https://casinorealmoneycm.com/%20">play online casino </a> https://casinorealmoneycm.com/

27.11.2021

[url=https://ivermectinforhumans.monster/]ivermectin 4000 mcg[/url]

28.11.2021

[url=https://wellbutrin.online/]buy wellbutrin online[/url]

28.11.2021

[url=http://ivermedication.online/]ivermectin[/url]

28.11.2021

[url=https://sildenafil50mg.quest/]sildenafil otc usa[/url]

28.11.2021

online casino <a href="https://nodepositcasinodem.com/%20">vegas casino slots </a>

29.11.2021

hydroxychloroquine tablets <a href="https://plaquenilch.com/%20">hydroxychloroquine covid 19 </a> <a href="https://aralenhclonline.com/%20">hydroxychloroquine buy </a>

29.11.2021

[url=http://genericsildenafil.online/]generic sildenafil buy[/url]

29.11.2021

casino bonus codes <a href="https://nodepositcasinoem.com/%20">casino game </a>

29.11.2021

hydroxychloroquine buy online <a href="https://hydroxychloroquineww.com/%20">hydroxychloroquine generic </a> <a href="https://aralenonline.com/%20">hydroxychloroquine zinc </a>

29.11.2021

hydroxychloroquine malaria <a href="https://hydroxychloroquineok.com/%20">hydroxychloroquine generic </a> <a href="https://aralenhclonline.com/%20">ncov chloroquine </a>

29.11.2021

hydroxychloroquine <a href="https://myplaquenil.com/%20">hydroxychloroquine generic </a> <a href="https://plaquenilka.com/%20">hydroxychloroquine </a>

29.11.2021

modafinil provigil <a href="https://modafinilhoho.com/%20">modafinil weight loss </a> [url=https://modafinilhoho.com/ ]provigil prescription [/url]

29.11.2021

hydroxychloroquine zinc <a href="https://aralenhclonline.com/%20">buy chloroquine </a> <a href="https://getfastchloroquine.com/%20">hydroxychloroquine and zinc </a>

30.11.2021

<a href="https://nodepositcasinoem.com/%20">best online casino </a>

30.11.2021

<a href="https://casinorealmoneyeo.com/%20">best online casino </a>

30.11.2021

<a href="https://casinogameswm.com/%20">casino real money </a>

30.11.2021

<a href="https://casinorealmoneyeo.com/%20">free slots games </a>

30.11.2021

<a href="https://casinoplayeri.com/%20">slot games </a>

01.12.2021

provigil for sale <a href="https://modafinilbasket.com/%20">modalert </a> [url=https://modafinilbasket.com/ ]modalert [/url]

01.12.2021

<a href="https://casinoplayeri.com/%20">real casino slots </a>

02.12.2021

<a href="https://onlinecasinogamesks.com/%20">best online casino </a>

02.12.2021

modalert 200 <a href="https://provigilonlinerr.com/%20">provigil online </a> <a href="https://provigilonlinerr.com/%20">provigil online </a>

02.12.2021

provigil price <a href="https://modafinilprovigiliq.com/%20">provigil 200 mg </a> <a href="https://modafinilprovigiliq.com/%20">provigil 100mg </a>

02.12.2021

[url=https://orderiveromectin.online/]cost of stromectol medication[/url]

02.12.2021

[url=http://wellbutrin.monster/]wellbutrin brand name india[/url]

02.12.2021

<a href="https://casinorealmoneyeo.com/%20">online casino real money </a>

02.12.2021

provigil cost <a href="https://modafinilprovigiliq.com/%20">modafinil </a> <a href="https://modafinilprovigiliq.com/%20">modalert 200 </a>

02.12.2021

provigil price <a href="https://modafinilprovigilus.com/%20">modalert online </a> <a href="https://modafinilplusprovigil.com/%20">provigil cost </a>

03.12.2021

<a href="https://casinoplayeri.com/%20">casino bonus codes </a>

03.12.2021

<a href="https://casinogameswm.com/%20">free online slots </a>

03.12.2021

modalert 200 <a href="https://modafinilbasket.com/%20">modafinil provigil </a> [url=https://modafinilbasket.com/ ]provigil 100mg [/url]

03.12.2021

buy modalert <a href="https://provigilbasket.com/%20">modafinil </a> [url=https://provigilbasket.com/ ]provigil pill [/url]

03.12.2021

<a href="https://casinorealmoneyekj.com/%20">online slot games </a>

03.12.2021

<a href="https://casinorealmoneyeo.com/%20">online casino </a>

kommentieren




Hat ein Quadrat vier gleiche Winkel? (Bitte klein schreiben)

© 2012 – 2021 HicknHack Software GmbH | Impressum | Datenschutzerklärung