Showing posts with label Qt5. Show all posts
Showing posts with label Qt5. Show all posts

2019-04-22

QtCreator - Not the hero we deserved, but the hero we needed.

When people ask me what my favorite programming language is (for some reason I get asked this a lot), I answer C++ without hesitating, then after a short pause I add "...and Python as a second".

At this point I usually see the person in front of me smirking ever so faintly and I can almost hear their thoughts "such an old fashioned language luckily he got to his senses with Python". I don't mind, I just smirk right back at them because the people asking this are usually coming from a background in Java/C# or JavaScript :D

The follow-up question that I get when I am facing someone more cultivated than to be dissing on a developer's favorite language is "what is your favorite editor or IDE". And to this I answer QtCreator without as much as blinking, followed by a lengthy praise of it's stability, speed, portability and carefully curated set of features that I have come to love above all else.

So in this post I decided to share why exactly I love QtCreator so much in more detail.

Speed


When I go on about how quick QtCreator feels I just don't seem to get the point across. If I am talking to someone using JetBrains' latest incarnation or VisualStudio people look puzzled as why I mention speed as the main reason. I guess they don't value their time.

Working as a consultant I a will encounter all kinds of environments and yes I have used versions of Visual Studio from version 1.0 to the latest 2019. And in each version of VS I wait for what feels like hours every day. Every little nudge of the mouse seems to activate some kind of intellisense that blocks the entire UI for seconds while loading, also blocking the view under the empty box that is displayed. Or the project needs to be refreshed and it takes forever even for moderately sized solutions.

Or I have to manually delete obj and bin folders, just because. When re-scaling windows or re-arranging the UI it just staggers along. Scrolling stutters. Loading files is slow. Searching in project is slow. Everything feels... sluggish. Like swimming in syrup.

In QtCreator you never even think about it. It just is fast and you never loose track of your really important thoughts and ideas. The IDE simply never gets in your way.

VS, JetBrains and even Eclipse has really awesome refactoring tools that I love, but it is just not worth the wait for me.

Super important features™


There are many small things that combined gives you an edge as QtCreator user. Here are some examples:

  • The locator thing to open files, classes, line numbers etc is just completely awesome.
  • Splitting panes is awesome.
  • Search and replace tool is awesome.
  • I didn't initially see the point of kits, but they really grew on me, and now I think they are a really useful feature which I find is lacking in other IDEs. 
  • The excellent integrated example projects with full writeup and screenshots were a big hit when I was learning to use Qt and QtCreator for the first time.
  • The embedded help system actually works and is useful. And best of all... it is not full of "news".

Portability


Qt is portable. It is one of it's main selling points. And QtCreator is too. I love the fact that I can decide what platform to develop on, and not have to install Java or Mono first. QtCreator is in fact a snappy native app developed in Qt to spend no amount of memory, load fast, work fast and feel responsive on all platforms that it is built for. I especially love that it is native on Linux.

qmake

I see a lot of Qt devs hating on qmake and using cmake instead. Or automake. Or something else. I think about it differently. If you look at the goals of those tools, I think qmake makes a far better job of meeting it's goal than cmake. qmake was designed to build Qt applications while cmake is to build "any C++ application with any dependencies". I have not tried Qbs yet, maybe it is even better, but qmake serves me really really well and the tight integration in QtCreator makes me very happy. I have a huge project with lots of code. All of it builds with just one qmake build on all the platforms we support. There are no strange error messages to google or changes to the path needed on windows only. It just works.

Active development

QtCreator has gone through a bunch of really nice updates since I started using it a few years ago. To name a few:
  • Dark theme
  • Real-time compiler hints via clang
  • New icons/profile
  • Many small fixes and features such as separating out the -j parameter for parallel builds in make.

Can it be better?

While I love QtCreator, I stil have some wishes for the QtCreator devs going forward!

  • A place to download plugins/extensions. I come across posts online that state QtCreator has a rich plugin architecture but I never found a single plugin or extension, nor any information on where to find them or install/use them. If it was made available somehow in an app-store that would be awesome!
  • Faster loading speed, and integrate it into O/S like text editor so I can use my IDE as a text editor. This is in the "nice to have" category for sure, but just imagine it. It would definitely be a killer feature.
  • Better support for other languages such as Python out of the box. I would love to add a Pyhon project and at least be able to run it using the Python environments that are already on my computer without having to do any manual configuration.
  • I know this is probably a big change, but. I think that having the UI designer as a separate "mode" is a big mistake. It should be opened inside an editor tab instead of the completely separate mode screen. The UX for switching between source and UI editing is clumsy at best.
  • The maintenance tool is awesome except... the UI. I mean com'on guys, Qt stands for excellent UIs, why this abomination from the 1990'? The update process could be streamlined so that download happens automatically in background then a subtle button would simply ask if you want to restart for update to take effect or similar.
  • More C++ refactoring options. Basic things like "move class to separate file" and "make const version of method" etc.
  • Include native support for cling. Not only would CERN love you, but the rest of the world would too. Think about the shift in development cycle? Just edit code in real time while app is running. It would definitely be a killer feature.
  • Apply dark theme to integrated help. I want my choice in dark to be for ALL of QtCreator!
  • Better help integration. I mentioned that that the system help works and is useful, but there are some times when I hit F1 to see relevant help (for example with cursor on a member inside Qt header file) and nothing happens. It should recognize context for help more places. Even mark it somewhere that hitting F1 now will give you relevant help.
  • Search and replace is nice and fast. But it is not as powerful as in notepad++. I didn't know I missed those features until I used them once. Also the UI for search/replace is sometimes cumbersome. I don't know how the case-insensitive, regex and whole words features works. Adding some context help and a list of examples would improve it a whole lot.
  • The project tree is either too sparse or too cluttered. Giving more control of how to show the project and the files in the tree would be nice.
  • The highlighted lines feature where errors, warnings, search hits and more are super useful, but it is not possible to click them to jump directly to the line in question, which in my opinion is a sorely needed feature. Also I think they could be symbols that are grouped when there are many in the same area. When you hover the group it will expand to how all the marks so you can click them individually. It is difficult to remember the different colors. I still don't know what white and green means.
  • I wish the integrated examples were updated as some are showing their age. I understand it is a conscious choice to not spend time on this, but marketing apt. of The Qt Company / Digia should know how huge an impact this feature has on beginners (read: potential customers). Keeping it updated and fresh should be among top 10 points on marketing plan!
There, all done!

Now I can go back to programming.

2016-12-18

Two new widgets

I have been making tremendous pace on the OctoMY™ development lately. Despite being sick several times and super stressed out at work I managed to put in some serious coding effort.

My latest innovations include two new widgets;

The first is the user interface for remote controlling wheeled robots, where first channel is throttle and second is steering angle. It looks like this:

OctoMY™ Remote interface for RC Car type robot.
Relevant code is here.

It works as expected, the red dot follows your movements along the wheel to steer, while the yellow bar grows with the distance you move away from the wheel in upward direction, indicating higher throttle. If you move below the wheel the bar turns blue and you will start reversing (or breaking, depending on your controller).

The second interface is part of the agent configuration program and allows the user to sett up the number of actuators and the correct mapping of named agent outputs to indexed controller input channels. It looks like this:

OctoMY™ Agent interface for mapping outputs to servos.
Relevant code is here.

To use it, simply select the number of actuators you will be needing in the spin-box at the top. Proceed to name them their logical names using the rename button. Finally, map them to indexed servos by clicking the buttons to connect in order. I was especially happy with the way my "virtual wires" turned out.

2016-03-20

Qt5.6 is out now

OctoMY™ is in many ways a showcase of Qt. Not only because I happen to think that Qt is the best development platform ever, but because it also happens to be a perfect fit for the project.

Fore each feature I want to add there seems to be a perfect Qt module ready to handle it. It is mind-blowing. Need to make a new parser with dynamic loading of shared objects that allow controlling arduino boards over serial, crossplatform? Check. Need to gather real-time data from GPS, accellerometer, gyro, compass and temperature sensors on Android and stream them over UDP together with video from 2 cameras attached via USB to display them in fancy 3D accelerated views on desktop application running on Ubuntu -or- another Android application? Check. Compile all my icons in SVG format directly into the binary? Check. I could go on an on about this, but I won't.

Instead I want to celebrate the arrival of the latest version Qt5.6, because it has (as always) an impressive list of new cool features and bug fixes) that I have been waiting eagerly for:

  • Support for C++14
  • Updated Qt3D (I need a way to render the robot state, and the last version of Qt3D left a lot to be deserved)
  • Updated Camera support (this was really buggy on my platforms)
It also promises a lot of bug-fixes because it is a long term support version.