Tag Archives: Programming Tools

Dark Fusion Theme for Qt 5

My favorite new theme (for Windows applications, at least) is the Fusion theme that came with Qt 5. I was working on an application recently where the people I was making it for wanted to be able to switch between a lighter and darker theme. Luckily, the Fusion theme uses the applications color palette. I’m putting the code up on Github in a gist, but there won’t be the code to switch between the two themes. I’ll post that later as a quick tip/tutorial.

You can find the theme on Github here. Alternatively, I’m posting the code below in a collapsed code box. Feel free to make changes and submit them back on Github though! You can use this theme in all your applications, but be sure to tell me about them if you can. I’d love to see what people do with it. 🙂


QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, QColor(25,25,25));
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);
darkPalette.setColor(QPalette::Button, QColor(53,53,53));
darkPalette.setColor(QPalette::ButtonText, Qt::white);
darkPalette.setColor(QPalette::BrightText, Qt::red);
darkPalette.setColor(QPalette::Link, QColor(42, 130, 218));

darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
darkPalette.setColor(QPalette::HighlightedText, Qt::black);

qApp->setStyleSheet("QToolTip { color: #ffffff; background-color: #2a82da; border: 1px solid white; }");

Run As Admin Utility Application

Recently, I wrote a small, win32 native utility to launch executables with administrator rights by utilizing a UAC prompt when launching the other application. You can check out the full source on Github if you want to learn more. The application can also utilize configurable and dynamic command line arguments, if your application needs that.

The release binary is around 30KB in size, and produces no pop-up windows unless there is an error. Errors are handled pretty well and displayed using a discrete message box. Feel free to redistribute it with your application, and attribution would be nice (just leave the executable name intact 😉 ).

Also, if you could, comment or let me know if you are using it. I’d love to get any feedback you have on it, or you can use the Github issue system for bugs/feature requests. A friend of mine has already told me he will be using this for his Python application, since he cannot find a better way to launch his application with administrator rights by default.

Check back often to see if I add new builds that support more features! Happy coding!

You can find the latest releases on Github here

Get some color back in Visual Studio 2012 icons!

If you are still using Visual Studio 2010 (or older?), then you can just ignore this. Apparently, Microsoft’s UI design team decided to change the icons to a more “monochrome” color palette in VS 2012, so what you get is essentially gray icons for everything. These icons are a far cry from what we have come to know as save, open file, open folder, etc. However, I personally don’t really care to be honest, unlike most developers. If you seriously use Visual Studio 2012, then there is no reason you shouldn’t do these two things:

  • Learn those shortcuts! This is a must. Visual Studio has so many shortcuts that most actions take two keys plus a modifier! It sure beats having to look through context menus that are so big, they fill up more than 1,080 pixels vertically…
  • Customize the layout where everything is somewhere you can find immediately. Re-arrange the toolbars and memorize the icons’ respective locations. Even if you know all the shortcuts (unlikely), there are still some things I prefer doing with the mouse–namely opening files, as it’s easier to use the mouse to browse through the files.

If this still isn’t enough, there is always the NiceVS Visual Studio extension, which appears to bring back the colored icons so many people have come to miss so much. Use at your own risk, however, as I didn’t even bother to test this plugin. If Microsoft’s made a UI decision that coincides with the Metro UI (which everyone also seems to hate), it isn’t going away easily. There’s no sense in installing a plugin to try and undo what Microsoft has done, in my opinion.

Qt Creator 2.8.0 is finally here!

At long last, we have the release version of Qt Creator 2.8.0! I can’t wait to fill up all my monitors with multiple Qt Creator windows, and refactor C++ like C# (okay, maybe not that good… yet). If I’d have to ask for a feature improvement though, it’d be speeding up the autocompletion. Visual Studio is still way ahead in terms of that, however, Qt Creator is free and open-source, so I am not complaining. 😉

You can read the Digia write-up over on their Qt blog for all the finer details.

MultiEditing Visual Studio Extension

Lately, I’ve been using Sublime Text for some lighter jobs where Visual Studio/Qt Creator just isn’t needed. I have really been loving Sublime Text’s multi-cursor feature. I can’t believe every IDE doesn’t have this! The feature is really, really handy for a lot of cases. However, I stumbled upon this handy Visual Studio plugin that emulates multiple cursors where Visual Studio does not!

It’s free, so I encourage you to pick it up today. I didn’t notice any slowdown from using the plugin, but that’s going to be minute if you have a machine capable of running Visual Studio 2012 with a whole bunch of other extensions + a giant solution (that you have been meaning to organize…). The only thing I could complain about–if I’m allowed to complain since it’s free and I love it so much–would be that some shortcuts that I use in the text editor don’t seem to work across multiple cursors. For me, this is namely the CTRL and SHIFT keys for movement and selection.

You can find the extension on the Visual Studio Extension Gallery website here. The extension worked in C# and C++, and it appears to support other languages as well.

Let me know if there are any other great VS extensions I should check out sometime! I’d also like to hear if you think Visual Studio should include this feature in an upcoming release, because I sure think it would add a great productivity enhancement for editing code.


Speeding up Compile Times with Jom

So you have finally got a decent-sized native project on your hands. You realize that your compile times are beginning to take so long you have to keep a video game on handy (Alt + Tab is your friend) while it builds, links, etc. When the finished compile pops up, you realize that you’ve left out a minus sign on line 529 of Math.cpp. Reluctantly  you close the app that just took 30 seconds to pop up, and go into your IDE (If you have a project this big you better be using one), hit Ctrl + G and go to line 529.

Continue reading