CppCast - Qt Creator

Episode Date: November 4, 2015

Rob and Jason are joined by Tobias Hunger to discuss the Qt Creator IDE for C++. Tobias graduated from the University of Kaiserslautern in Germany with a degree in computer engineering. Before... joining Nokia in 2009 to work on Qt Creator he has been a consultant, specializing in systems administration and later Qt software development. He went with Qt to Digia and now works for The Qt Company in Berlin, Germany.   Tobias has been an open source contributor ever since his student days and is now a maintainer in the Qt project, responsible for the version control plugins in Qt Creator. He also is heavily involved with the project management plugins.   In his spare time he does way to many computer related things, but also manages to read books, go to the movies and play with his son. News First beta release of KDevelop 5.0.0 Microsoft promises Clang for Windows in November Handmade Con 2015 Tobias Hunger @t_hunger Tobias Hunger's Github Links Qt Creator 3.6 Beta1 released Qt

Transcript
Discussion (0)
Starting point is 00:00:00 This episode of CppCast is sponsored by JetBrains, maker of excellent C++ developer tools including CLion, ReSharper for C++, and AppCode. Start your free evaluation today at jetbrains.com slash cppcast dash cpp. Episode 33 of CppCast with guest Tobias Hunger, recorded October 28th, 2015. In this episode, we discuss an update for KDevelop and Klein coming to Windows. Then we'll interview Tobias Hunger from Qt. Tobias will tell us all about the Qt IDE and GUI framework. Welcome to episode 33 of CppCast, the only podcast for C++ developers by C++ developers. I'm your host, Rob Irving, joined by my co-host, Jason Turner.
Starting point is 00:01:21 Jason, how are you doing today? Doing all right, Rob. How about you? Doing pretty good. No real news for me, though. At the start of every episode, I like to read a piece of feedback. This one comes in from Tom. And Tom was writing on Twitter that he really enjoyed the CppCast episode with Kate Gregory. Said it was a very interesting philosophy and much more nuanced than the title suggested. And we got a lot of really good feedback with Kate Gregory from two weeks ago. I definitely really enjoyed that talk and suggest everyone who hasn't listened to it already,
Starting point is 00:01:55 go and listen. Even if you're not a C++ teacher in any way, it'll really just change the way you think about how people should be learning C++ these days. You should totally watch her video from the conference also, since it's up now too. Yeah, absolutely. Yeah, I think, I guess we recorded just a day or two before that went on YouTube, right? Something like that. Maybe the day before, yeah. Yeah, I did watch her talk afterwards. It was really good.
Starting point is 00:02:21 So we'd love to hear your thoughts about the show you can always email us at feedback at cppcast.com follow us on twitter at twitter.com cppcast or like us on facebook at facebook.com cppcast and you can always review us on itunes as well joining us today is tobias hunger tobias graduated from the university of kaiserslautern in germany with a degree in computer engineering before Before joining Nokia in 2009 to work on Qt Creator, he has been a consultant specializing in systems administrations and later Qt software development. He went with Qt to Digia and now works for the Qt company in Berlin, Germany. Tobias has been an open source contributor ever since his student days and is
Starting point is 00:03:01 now a maintainer in the Qt project, responsible for the version control plugins, and he's also heavily involved with the project management plugins. In his spare time, he does way too many computer-related things, but also manages to read books, go to the movies, and play with his son. Tobias, welcome to the show. Hello. Thanks for having me. It's great having you. I'm kind of curious how many different version control plugins you have worked with. All of them. I maintain them.
Starting point is 00:03:28 I mean, like how many are there? Like I know there's some really esoteric version control systems out there. We have Bazaar, CVS, Clearcase, Git, Mercurial, Perforce, and Subversion. All right. That covers most of it. That's the official ones. Very cool. And I was going to ask this question later, but since I just said it a couple times, what is your proper pronunciation for QT?
Starting point is 00:03:51 Because I know some people say cute, some say QT. What is the pronunciation around the office? So most people around the office say cute. Say cute, okay. Good to know. So we had a couple news items before we go into the interview with Tobias. The first one is the first beta release of KDevelop 5.0, which is a Linux C++ IDE. Jason, have you used KDevelop?
Starting point is 00:04:20 I have, and it's probably at this point been, oh, I don't know, eight or nine years since I actually last seriously used it. It's been around for a while. Okay. And it looks like it's actually built using Qt technology. So, Tobias, I'm guessing this is something you're familiar with? Yeah, I used to use KDevelop before I joined Nokia and started working on Qt Creator. Okay. And I really enjoyed it all the time.
Starting point is 00:04:46 It used to have really great C++ support back then, but I've not used it in years now, so I'm not up to date with the current developments. Okay. Well, some of the changes they have listed here, they replaced their legacy C++ parser to get a more powerful one based on Clang. They removed the handwritten CMake interpreter and are now using CMake itself, it looks like.
Starting point is 00:05:08 So it looks like they have plenty of good changes. So if you are a user of KDevelop, you should definitely go check out the new version. There's also a little note here that they are moving closer to KDevelop on Windows and KDevelop on macOS. That's interesting. Probably interesting to our listeners. That's because they updated to Qt 5 and KDE Framework 5,
Starting point is 00:05:28 which are way more portable than the old ones used to be. Ah, okay. So the next article is Microsoft promising to introduce Clang to Windows in the November Visual C++ update. And this is getting a lot of attention on Reddit. It actually came from this article on The Register, which looked like they just watched James Radigan's video from CppCon and were posting some of the announcements that he made there,
Starting point is 00:06:00 where they've been talking for a while about how they're starting to use Clang for the front-end compiler in Visual Studio. And they also mentioned here that I think Visual C++ is going to come as a tools-only package sometime in November. So if you're not interested in using the Visual Studio IDE, but you want to compile using the Microsoft Visual C++ compiler, you'll now be able to do that, which i'm sure some people are very excited by uh that would be a huge help to me for
Starting point is 00:06:31 some of the automated build systems that i work with yeah i guess if you want to now you can just install like one of the free versions of uh like visual studio express or community yeah that's what i do currently yeah right but that's a pretty big install if you only want the compiler. I'm curious if it will come with the analyzer or not. I would assume it would, but... Yeah, that'd be nice to be able to do analysis from the command line as well.
Starting point is 00:06:58 I currently do do it by passing slash analyze through my CMake configuration, but yeah. Tobias, is there anything you wanted to add to this one? Not really. I'm kind of excited that C-Lang is taking off like that, but I'm actually more interested in having the real thing with the backend too. That's apparently still a couple of months off.
Starting point is 00:07:21 It is nice to know that they're still working on it, so that's good. Yeah, I agree. Jason, do you want to introduce this last article about handmade con yeah this is a uh news item that was passed to me directly um so i don't know if you guys are familiar with handmade hero but this guy's been live uh programming his uh game development for a while um i don't know actually i don't remember when he started. But it looks like they're going to have a quick one-day conference in Seattle here
Starting point is 00:07:50 coming up with a bunch of random people in the game industry that if you're familiar with game industry at all, you've probably heard of some of these people. And it just looks like it could be a fun little conference. Yeah, one of the speakers here is Mike Acton, who did one of the keynotes at CppCon last year, so I'm sure that should be a good talk.
Starting point is 00:08:12 And Jonathan Blow, who's the author of Braid, which was one of the early big hits of the current indie game renaissance. Right. Yeah, so this looks like it should be a good little conference if you're in the greater Seattle area. They also are hoping to stream it if possible. Okay, that'd be nice to watch. Okay, so Tobias, we have had a lot of requests to talk about Qt on the air, and we just haven't found any good interested guests up until now. So maybe we could start off with just an overview
Starting point is 00:08:46 of what exactly Qt is, in case you've been living under a rock for a long time in the C++ community. Oh, Qt has had its 20th year's anniversary recently, so it's been around for a while. It's a cross-platform UI library and basically enables you to write C++ software against the Qt classes and UI widgets and all that stuff and have it basically compile on
Starting point is 00:09:17 all kinds of platforms like Windows, Mac, OS X, Linux, of course, and also mobile platforms like Android, iOS, embedded Linux, and all that stuff. So if you're interested in cross-platform development, it's definitely something you should check out. Okay. And how easy is it to get rolling with cute if you're just being introduced to it now well when i got started it was pretty easy and since then we basically added cute creator which comes along with cute in one package and is already set up for you to go and you just hit a wizard or start your create a new project and
Starting point is 00:10:08 you hit run and it will compile and build and run for you all right since you mentioned cute creator then uh give us an overview on what that project is well it's a project that was started in 2007 by a couple of my now co-workers, but it was before I joined the company. And it was apparently from what they tell me, basically a Creative Friday project to see whether they could come up with an IDE for Qt developers. And since then it has grown quite a bit. So nowadays it's an open source cross-platform IDE for Qt development. And since Qt is a C++ library, it also works great for C++ projects that don't use Qt. And yeah, it's my favorite IDE nowadays, and I really enjoy working on it and working with it.
Starting point is 00:11:00 So it does not require that you... It'll work with projects that are not cute based you're saying yeah of course i know a couple of people that actually do linux kernel development in c with it so it's fully agnostic but of course since we are the cute company that also develops cute we make sure that cute will work great with it. That makes sense. So you mentioned a lot of different possible platforms that you can target with Qt. How easy is it to target all these different devices or platforms using Qt Creator?
Starting point is 00:11:35 Well, that depends on how great they are supported. So for embedded Linux, basically, it's really easy to cross-compile and deploy your project onto a remote machine and run it there. The same is, of course, true for Android and iOS, which we support fully. And, well, usually the biggest hurdle is actually setting up the cross-compiling environment. And once that's done, it should basically work really well with Qt Creator. So currently the Visual Studio is trying to do cross-platform iOS development, right? But you have to have a remote Macintosh to talk to, I believe.
Starting point is 00:12:23 How does that work? Do you need to be running Qt Creator on a Mac if you want to do iOS development? As far as I know, for iOS development, you actually need a Mac. Okay. Because all the tools are only available there. And there's little we can do about that, unfortunately.
Starting point is 00:12:39 Yeah, I just didn't know, since it's C++ instead of Objective-C or something, if maybe you guys had figured something out. The problem is getting the software on the device after building it and running it there and debugging there. And that's a challenge on iOS. Okay. Yeah, unfortunately, I think that's legal restrictions put in place by Apple.
Starting point is 00:12:58 So what Visual Studio is doing is just the only workaround you can do by running a remote service on a physical Mac machine. Right. So I have this note here about Qt Creator build kits. Does that factor into the targeting of different devices? Can you go over that a little bit? Well, kits are a concept we introduced a couple of versions ago. And those are basically a tool to help us target different devices and on different platforms. So what you can do with Kits
Starting point is 00:13:36 is basically you define a set of properties that go together, like which compiler do you need to use? Which sysroot do you have, where are the headers and the libraries for the target platform, what are the build system files you want to use, like is it CMake or which CMake binary and stuff like that. And also, which device do you want to run? Do you want to have this iPhone or that Android device or this remote Linux machine or whatever? And basically, a kit is just this set of settings. And that basically enables us to switch between different target devices by just switching kits and rebuilding with that new kit.
Starting point is 00:14:26 So it's a real nice and powerful concept that we have there. And, yeah. So with these kits, you can actually target different compilers too, right? Yeah, of course. So the tool chain you're going to use is also part of the kit. So we do support CLang, we do support GCC, we support MSsvc and we also support a couple of less widely used compilers like the one for q and x and others oh interesting
Starting point is 00:14:55 i had noticed the last time i played with q creator that i could target msvc and um and i that surprised me i thought our listeners might be surprised by it also. I was just going to ask, if you're part of a team and everyone wants to have a similar development environment on the team, is it easy to share the different Qt build kits between the team members? That's actually something I'm currently trying to improve because at the moment it's a bit hard. So it can be done, but it requires a very,
Starting point is 00:15:33 basically a centralized setup of all Qt Creator instances, which is not something you could do, for example, in an open source project. So I'm currently trying to come up with a way where you can basically have some kind of UI wizard in your project that will then help you set up Qt Creator in the right way. But that's a work in progress and not in the next release yet. I wanted to interrupt this discussion for just a moment to bring you a word from our sponsor, JetBrains. C-Line is a cross-platform IDE for C and C++ from JetBrains.
Starting point is 00:16:03 It relies on the well-known CMake build system and offers lots of goodies and smartness that can make your life a lot easier. CLion natively supports C and C++, including C++11 standard, LibC++, and Boost. You can instantly navigate to a symbol's declaration or usages too. And whenever you use CLion's code refactoring,
Starting point is 00:16:23 you can be sure your changes are applied safely throughout the whole codebase. Use Subversion, Git, GitHub, Mercurial, CVS, Perforce via plugin, and TFS with a unified interface for all of those. Run a terminal inside the IDE and install one of the dozen of plugins like Vim Emulation Mode, for example download the trial version and learn more at jb.gg slash cppcast dash clion and use the following coupon code to get a 20 discount for the c-line personal license cppcast jetbrains cpp tools um so what are some of your favorite features of q creator and ones that you've worked on or just ones that you really like using in the IDE? Oh, I like the kits. Those are something I worked on. But I also love the refactoring we have. So it makes renaming stuff so easy and hopping around the code and all that stuff.
Starting point is 00:17:21 So having a real powerful code model in your IDE is so great. And I really don't want to go back to the times where I was still using editors and all that bare metal stuff. So what do you guys, do you use Clang integration or something for your internal code model? We have had our own code model for a long time, but we are now moving to C-Lang like everybody else, too. Like everybody else, exactly. The next release is pretty close, but it does not have feature parity with the old code model yet,
Starting point is 00:17:58 so I'm not sure whether we will switch for the upcoming 3.6 release or only afterwards. We will see how that will work out. Okay, so refactoring and automatic code fixes and that kind of thing have come up many times on our show. What kind of refactoring tools do you guys have built in? What's your favorite ones? Oh, we have quite a few by now.
Starting point is 00:18:22 So you can basically mark up a section in your functions and extract that to a separate method. Or you can use snippets to create code. You can rename stuff, of course. Well, we can do quite a lot by now. Wow. It's something I've never really gotten used to because I'm personally a Vim guy,
Starting point is 00:18:56 and it's what I've been using for many years at this point. I have noticed that Qt Creator's Vim emulation support is better than I think any other IDE that I've tried to use. Oh, I will tell Andre he wrote that. Oh, he's a Vim user himself and And we don't call it Vim mode. We call it fake Vim because he only implements what he needs. And we are, of course, open to contributions. So it kind of grows on a steady but slow pace. Interesting. So kind of the main draw to Qt is that it is a cross-platform GUI framework. So what support is there for designing these GUI interfaces in Qt Creator?
Starting point is 00:19:36 So with Qt, you basically have two options for user interfaces at this time. So the first one is a traditional widget-based interfaces, and we have basically Qt Designer integrated for that. So that's a full UI drag and drop interface builder. And that's great for desktop applications like Qt Creator itself. That's a Qt widget application, for example. On the other hand, in Qt, we have QML now, which is basically a language to define more fluid interfaces. And the idea here is that you declare you have a couple into a data structure which is optimized for graphic cards to handle. So you can basically do really graphic accelerated UIs with that and also apply shader effects and all the nice stuff there. So that's really popular with embedded UIs and things like that that need to be fluid. And for that we also have a designer which helps
Starting point is 00:20:57 you with designing those interfaces. So we cover both spaces. If I design a UI in Qt Creator using your designer, can that one UI work on all the platforms that Qt supports? Yeah, of course. That's the idea. Okay. How well does that really work in practice
Starting point is 00:21:18 though? Because Android and iPhone will have probably very different interface requirements than something built for desktop. I never did Android or iOS development myself, so I'm a bit out of my league here. But for those devices, we basically recommend doing a... or most users actually do a custom layout or a custom style,
Starting point is 00:21:44 which basically are completely customized UI. And for that, it works great. So our seeming support to get native widgets in QML is not perfect at this point. So we need to look into that at some point. Can you go into that a little bit more about the native widget support? Well, there are basically two things we have widgets and we have QML and other Qt Quick Controls for that which are basically things like widgets for QML and as far as I know those are basically using our own custom widget set, which can then be further customized by our customers
Starting point is 00:22:31 and is not trying to emulate the native ones at this point in time. Okay. It looks like the next beta of Qt Creator was just released, 3.61, I think. Did you want to go over some of the new features that are in this new beta? Well, the first thing is, of course, ceiling code model support that made great progress in 3.5.
Starting point is 00:22:56 And then there's also a huge contribution we got in this release cycle, which basically allows you to edit or create UML diagrams and edit those in Q release cycle, which basically allows you to edit or create UML diagrams and edit those in Qt Creator, which is really cool for documentation purposes and stuff like that. Can you go both ways with UML, like design something in UML and then have it spit out the base code? Not really at this point. Okay.
Starting point is 00:23:20 I'm also not sure whether that's planned or not. All right. Sorry, go ahead. Yeah. It's a contribution, so we are not in the driver's seat for this plugin. So it's always a bit hard to tell how things will develop. So going into contributions a bit, is Qt still completely an open source project? Like the community can contribute to it as much as they want to, or is it mostly done kind of in-house by the cute company well ever since nokia open sourced it or nokia had a nokia had an initiative that was called or is called open governance and that was basically
Starting point is 00:23:59 changing the way we work internally to match up with how external contributions work. So ever since then, all the internal people have the same workflow as the external people and basically the same say. So in my opinion, it's a fully open source project. We do require our contributors to sign a CLA because we need to be able to actually change the licenses at some point. But that sounds very sinister, but actually it's not. The legal problem we have here is that we have an agreement with FreeCute Foundation, which basically says if we stop releasing Qt as open source, then the FreeQt Foundation is allowed to relicense or take all the code
Starting point is 00:24:50 and relicense it under a license of their choosing. So for that to work, we actually need to be able to grant them the right to change the licensing. And for that, we need to have the right to change the license. So that's where all the legal tricky bits in the CLA actually come from. Okay. Jason, do you have any other questions? I was just curious if there were any other features of Qt Creator that we haven't talked about yet that you would like to brag about?
Starting point is 00:25:21 Oh, what is there to brag about? We have great support for all kinds of build systems, so we of course work well with QMake, but we also support CMake projects, we support OuterTool projects with an experimental plugin, we of course support
Starting point is 00:25:38 Cubes projects, and basically you can load quite a lot of things into Qt Creator without actually changing or redefining anything and just by clicking on a project file in whatever format it is. And that works great. We do have bare metal support, which basically allows us to target really tiny embedded devices with a couple of K of memory
Starting point is 00:26:05 and talk to them and debug on them. We do have a Python editor for a while now. We do have a new diff editor, which I kind of like. Yeah, we have lots of great stuff in there. This is just a question I had. Does Qt have any integration with OpenGL rendering? Can you kind of have a game that both has Qt have any integration with OpenGL rendering? Can you have a game that both has Qt widgets and natively rendered graphics? There actually is a game engine based on Qt from a third-party company.
Starting point is 00:26:37 So I've never used it, but it's there. We do, of course, support opengl for widgets and qml language is basically requires opengl even to function so that's basically all the ui you design there is basically opengl you know just for a second i want to go back to this you said you can work with all kinds of different build systems cmake autot AutoTools, QMake. I think that really stands out. I don't know of any other IDE that you could point an AutoTools project at, for instance. I don't know any other either. That's why I'm so happy about that feature.
Starting point is 00:27:18 Yeah. Yeah, it does seem like most IDEs kind of pick one or maybe two build systems and work with that tightly. Yeah. Or one like visual studio and then other build systems shoehorn themselves in. Right. Exactly. Well, the idea we have with Qt Creator was that we wanted to be an IDE for people that don't like IDs too much.
Starting point is 00:27:44 And there are a lot of those out there. Right. Yeah. To be that IDE, you always have to make sure that you can actually, that we do not interrupt the workflow that these people are used to.
Starting point is 00:28:01 So we make very sure that we don't hook into the build system in such a way that you can't run it from the command line anymore or from this, whatever, continuous integration server or whatever. So we try really hard not to do that. And that's actually something I really like about Qt Creator, too. Do you have any stats on how popular that Vim emulation mode is? We don't have any stats at all.
Starting point is 00:28:26 Okay. You know, I will attest that of the IDEs that I've used, it is the least objectionable. Thanks. No, seriously, we don't have any statistics about how many people use what. For a while, during the Nokia time frame, we had an RSS feed integrated into the front page
Starting point is 00:28:50 or startup page of Qt Creator with all the new Qt stuff. But we had a couple of people object to that so much that they forked Qt Creator and put up their own binary image somewhere on some server in Russia. So all of a sudden we didn't have any Russian users anymore because everybody was getting their copy from those guys. So we learned that lesson and stopped doing that.
Starting point is 00:29:17 I do not like it when I open Visual Studio and it says something like error can't load news. I'm like, why are you trying to? Yeah, I don't think anyone ever reads that you just click right through right okay well is there anything else you wanted to go over just in Qt in general or Qt creator
Starting point is 00:29:34 no I'm I'm happy okay well thank you so much for your time Tobias yeah thank you thanks so much for listening as tobias yeah thank you thank you for having me thanks so much for listening as we chat about c++ i'd love to hear what you think of the podcast please let me know if we're discussing the stuff you're interested in or if you have a suggestion for a topic i'd love to hear
Starting point is 00:29:55 that also you can email all your thoughts to feedback at cppcast.com i'd also appreciate if you can follow cppcast on twitter and like cppcast on facebook and of if you can follow CppCast on Twitter and like CppCast on Facebook. And of course, you can find all that info and the show notes on the podcast website at cppcast.com. Theme music for this episode is provided by podcastthemes.com.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.