The Viking Blog Get inspiration from Viking Software's expert insight into Qt and C++ All Categories Android C++ CMake Debugging JSON Layouts Locale QML Qt Qt Script Qt Tricks Scripting Widgets Windows Building Qt 5.4 on Windows Posted in Qt, Windows In this blog post I will go through the process of building a 32 bit Qt 5.4 with OpenSSL support on Windows. I will use Windows 8.1 64 bit and Visual Studio 2013, but there should only be minor things … QWidget Pixel Drawing Posted in Qt, Qt Tricks, Widgets In very rare occasions, we want to draw individual pixels all over a widget. Custom painted widgets are much less common. But we can often get away with much easier painting than doing individual pixels. We draw these using lines, … Encapsulation in QML Components Posted in QML In QML, it’s so easy to use properties of components directly, and it’s even the way most examples do it. But here’s my quesion: If we consider this the wrong approach in C++, isn’t it wrong in QML as well? … QObject SignalBlocker Posted in C++, Qt, Qt Tricks Sometimes you have to stop a class from emitting a signal for a while. One example that just came up on the Qt interest list was an application that modifies a file which it also monitors with a QFileSystemWatcher. You … Implementing tool tips in QML Posted in QML If you are using the Qt Components, you have tool tips available. But with the standard SDK, you’re on your own. Here, I’ll implement a simple tool tip component for you. In my application, I have a lot of Text … Custom positioners in QML Posted in QML If none of the four standard positioners (Column, Row, Flow, Grid) work for you, you can write your own. I have a pet project that involves a poker table. This is done with a list model that has a list … Ctrl +Enter Edit Handling Posted in Qt Tricks I have a pet project where I’m doing some fun stuff with Qt scripting. To quickly test small script things, I implemented a simple window that have a QPlainTextEdit where I input a script, and an output window for what … Printing Parts of an XML Tree Posted in Qt Tricks When debugging XML code, you often wonder about the contents of a subtree. If the tree is small, you can just print it. But when the XML tree gets big, this just isn’t very handy. Especially not if you are … Using Templates to Avoid Code Duplication Posted in C++ The object orientation guys have pretty much won the battle. So much, that when something doesn’t fit in a neat OO inheritance tree, it can’t be done. I recently worked on a commercial project where I saw the following code … Qt Sourcecode Structure Posted in CMake, Qt One of the questions I often get from companies that hire me to help them in their first project with Qt, is how to structure the source tree. This might look trivial to some, but if you don’t know how … « Previous 1 2 3 Next »
Building Qt 5.4 on Windows Posted in Qt, Windows In this blog post I will go through the process of building a 32 bit Qt 5.4 with OpenSSL support on Windows. I will use Windows 8.1 64 bit and Visual Studio 2013, but there should only be minor things …
QWidget Pixel Drawing Posted in Qt, Qt Tricks, Widgets In very rare occasions, we want to draw individual pixels all over a widget. Custom painted widgets are much less common. But we can often get away with much easier painting than doing individual pixels. We draw these using lines, …
Encapsulation in QML Components Posted in QML In QML, it’s so easy to use properties of components directly, and it’s even the way most examples do it. But here’s my quesion: If we consider this the wrong approach in C++, isn’t it wrong in QML as well? …
QObject SignalBlocker Posted in C++, Qt, Qt Tricks Sometimes you have to stop a class from emitting a signal for a while. One example that just came up on the Qt interest list was an application that modifies a file which it also monitors with a QFileSystemWatcher. You …
Implementing tool tips in QML Posted in QML If you are using the Qt Components, you have tool tips available. But with the standard SDK, you’re on your own. Here, I’ll implement a simple tool tip component for you. In my application, I have a lot of Text …
Custom positioners in QML Posted in QML If none of the four standard positioners (Column, Row, Flow, Grid) work for you, you can write your own. I have a pet project that involves a poker table. This is done with a list model that has a list …
Ctrl +Enter Edit Handling Posted in Qt Tricks I have a pet project where I’m doing some fun stuff with Qt scripting. To quickly test small script things, I implemented a simple window that have a QPlainTextEdit where I input a script, and an output window for what …
Printing Parts of an XML Tree Posted in Qt Tricks When debugging XML code, you often wonder about the contents of a subtree. If the tree is small, you can just print it. But when the XML tree gets big, this just isn’t very handy. Especially not if you are …
Using Templates to Avoid Code Duplication Posted in C++ The object orientation guys have pretty much won the battle. So much, that when something doesn’t fit in a neat OO inheritance tree, it can’t be done. I recently worked on a commercial project where I saw the following code …
Qt Sourcecode Structure Posted in CMake, Qt One of the questions I often get from companies that hire me to help them in their first project with Qt, is how to structure the source tree. This might look trivial to some, but if you don’t know how …