Using Visual Studio Code for Writing Qt Applications

Software developers like tools, and in particular tools that make them more productive. So in this blog post, I am going to share with you some of the experiences some of us here at KDAB have had using Visual Studio Code for Qt development.

Motivation

The first question you want to ask is probably, “Why use another editor or IDE at all if we have Qt Creator, which is a perfectly good and, in particular, Qt-specific IDE, ready at our disposal?” And, of course, that’s a very valid question to ask.

For me, the main reason is that Visual Studio Code simply does some things better than Qt Creator – and other things worse, which I’ll discuss later. Also, I am doing a lot of my development on macOS, and Qt Creator does not always have the same level of stability there as it does on Linux and Windows. I am not advocating to ditch Qt Creator altogether. My current work setup uses both in parallel.

I have configured both to auto-save and auto-reload so that I can switch seamlessly between the two. Some things I do in Qt Creator, while others I do in Visual Studio Code. When I move focus, my changes are already there (or I just need to hit the “Yes to All” button in the reload confirmation dialog) and I am getting the best of both worlds.

Visual Studio… Code?

Before I go into greater detail, I’d like to explain a bit about Visual Studio Code. Many of you are most likely familiar with Microsoft Visual Studio. If not, here’s a quick summary.

Microsoft Visual Studio is Microsoft’s big and comprehensive IDE/compiler/debugger package for C# and C++ development that has been around for many years and is available for Windows and macOS (but not for Linux). And, here’s the confusing bit: Visual Studio Code has very little to do with Microsoft Visual Studio. (Though, I would guess that they use a lot of common code under the hood.)

Visual Studio Code is an offering of its own, open source, not commercialized (for the time being at least), and based on Electron. It doesn’t use the Atom editor component though, like many other development tools built with Electron. Instead, it uses a separate editor component that is also used in Microsoft’s Azure DevOps product. This is not something you need to worry about, or even know, when working with Code, of course.

Comments
  • Eu et tellus vestibulum taciti et sit, nunc enim ipsum donec aliquam vitae, per mauris, amet ultrices. Pellentesque amet proin ut vestibulum eleifend nam, wisi vel tellus pulvinar mi risus consectetuer, sed faucibus facilisi, accumsan nam.

    • Neque turpis vitae eros praesent varius. Egestas pellentesque urna blandit, sed ac leo ut mi, nam wisi, laborum donec erat amet.

  • Nec ut tellus ornare, orci tortor suspendisse aliquet sollicitudin rhoncus, maecenas suscipit cras porttitor vestibulum vivamus.

Leave a Reply

Your email address will not be published. Required fields are marked *