C++ - Boost - Using Boost.Python Numpy from_data()

If you are using Python then NumPy is quite interesting for manipulating arrays. But how do we do that with C++ and Boost.Python NumPy extension? That’s what we are going to see in this Windows tutorial with an easy example of the from_data() method. First of all We need to install Python 3 and Boost on your computer. So in order to have the exact same software and libraries installed in the exact same locations, I suggest to follow the 2 following tutorials: ...

November 24, 2019

C++ - Boost - Building the Boost.Python NumPy extension as a library

If you are a scientist and interested in Python, you certainly already know the NumPy package. In this tutorial I’ll propose to explain how to install it on Windows in order to be used with the Boost.Python library. We’ll also make an Hello world example. First of all We need to install Python 3 and Boost on your computer. So in order to have the exact same software and libraries installed in the exact same locations, I suggest to follow the 2 following tutorials: ...

November 19, 2019

C++ - Boost - Using Boost.Python library on Windows to create a DLL

Communication between 2 different language isn’t so easy. It’s often possible to find libraries to help us achieve this behaviour. That’s what we are going to see in this Boost.Python tutorial for Windows. Let’s get started. First of all We need to install Python 3 and Boost on your computer. So in order to have the exact same software and libraries installed in the exact same locations, I suggest to follow the 2 following tutorials: ...

November 13, 2019

C++ - Boost - Setting up on Windows 10

Boost libraries are some of the famous ones in the C++ world. They contain tons of functionalities but aren’t so easy to use or even understand. First things first, let’s try to install it in on our dear Windows 10 operating system (it should work as well on Windows 11). And test it with Visual Studio 2017 and Visual Studio 2019. Ready? Let’s do it in this Boost installation tutorial for Windows 10. ...

November 10, 2019

C++ - Qt Framework - Using QStyledItemDelegate for displaying a QCheckBox in a QTableView

Adding text and numbers in an QAbstractItemModel was the easy part of the Qt Model/View design. In this tutorial we are going a bit further by adding a QCheckBox directly on each item of a column. But instead of using the createEditor() method we’re going to use only the paint() one. Let’s painting. First of all For this example adding a visual QObject is generally made with the createEditor() method. ...

March 15, 2019

C++ - Windows - Creating a dynamic-link library (DLL)

Creating a .DLL is an interesting process that allows a better comprehension how a dynamic-link library works on Windows. No need to say that we’ll use Visual Studio for that. Ready to dynamic linking? Let’s link. First of all We need of course Visual Studio 2017 but feel free to use the version of your choice. We’are going to create a dynamic-link library, at first, then create an application that’ll use this library. ...

March 14, 2019

C++ - Qt Framework - Using QAbstractItemModel with QTableView and QListView

The QAbstractItemModel is usually used with views like QTableView, QTreeView or QListView. We’re going to see how to use this class in a very easy example. To be honest nothing is easy but we’ll use the minimum elements in order to have something useful for every new project. Let’s see that in this QAbstractItemModel tutorial. First of all The Model/View design is quite different from the classic Widgets. Indeed, here the view and the model are separated in at least two different classes. ...

March 11, 2019

C++ - Qt Framework - Using QDataStream

The QDataStream class allows to stock data from an input and give back this data to an output. Quite interesting when you want, for example, to transfer data from a computer to another. Let’s see that in this QDataStream tutorial. First of all In this tutorial we’re going to create a custom object (BadprogDS) and transfer it to another one. It’ll involve overload stream operators such as “«” and “»”. ...

February 4, 2019

C++ - Visual Studio IDE - Sharing project property sheets on many projects

What is really annoying is to do again and again the same task without having something new to do. Set a Visual Studio project is one of this thing that you would like to automatize. The property manager allows us to do this kind of mechanism. We, indeed, are going to see how to share configurations from many C++ projects. Let’s get started. First of all Visual Studio IDE: https://visualstudio.microsoft.com/ Let’s create a solution and 3 projects: ...

January 9, 2019

C++ - Design pattern - Command

The Command design pattern creates a list of objects on which we’re going to apply a generic method. It’s a bit unusal because an object will request a method as parameter. This makes the Command design pattern a versatile one but maybe not so easy to handle at first. Once again an interesting study case. Let’s see that in this Command design pattern tutorial. First of all GitHub: https://github.com/badprog/badprog-design-pattern-command There are many ways to use this Command design pattern. ...

August 14, 2018