KDAB_Tree_Header_Mobile KDAB_Tree_Header_Web

Trusted Software Excellence since 1999

Jesper K. Pedersen

269 results

When you implement a model, it is worthwhile remembering that one day an intern, with far less experience than you, might implement a proxy model which sits on top of your model and acts as the view. This proxy model might be broken in ways you couldn't even imagine, so better check that the index provided are actually referring to valid data in your model.

As the title suggests, here Jesper live codes a model based on QAbstractTableModel.

Finally, it is time to learn how to implement our own models. We will start with lists and tables in this episode, and later move on to tree models.

In the previous episode we saw the very high level view of model/view. Here, the descent towards actual code begins. On the way there we will discuss how to address the individual items in the views (while simple for a table, not so straightforward for a tree), and the properties we can get for each cell.

After two episodes talking about the item versions of lists, tables, and trees, we now turn our attention to the model/view version of that story. Using model/view offers a great opportunity to do a separation between business logic and presentation. In this episode we will learn how each of the parts fits together.

In this episode, we will continue looking at the item based widgets for lists, tables, and trees. We will cover "the current item", selection, sorting and event handling.

Qt has two kinds of lists, tables, and trees. One kind uses a model/view setup which gives a great separation between data and presentation. The other one is item based, meaning your data is stored in the items, just like the checked value is stored inside the checkbox.

On the fly translations are doable, but as we will show during the demonstration, they can also be rather difficult to get right.

What does tr() really do? Is it a function, a macro, or what is it, and where is it located? How about QT_TRANSLATE_NOOP, and when do I need that? Find the answers to all these questions and more in this episode.

As the title of this presentation indicates, this episode is a bit of odds and ends. Nevertheless, we will talk about some rather important things, among which is: How to avoid forgetting to translate some strings?

In this video Jesper demonstrates how to set up CMake for translating your Qt application.

In this episode we will look at the process for making your application ready for being translated, plus how the translation tools works.

In this episode, Jesper discusses some non-trivial painting code. It includes coordinate transformations, discussions of cosmetic pens and more.

Sometimes the simple questions come with a super complex answer. Question: How do you draw a rectangle around a piece of text? Answer: Uh ohh, hold my beer (or coffee or ...) ..... 

Printing in Qt is easy! Learn how in this episode.

In this episode I'll implement a simple bar chart, which involves painting the actual bars.

With your current knowledge of QPainter, you would likely have a hard time if I asked you to draw an analog clock. Obviously, you know you can draw a line between two points with drawLine, but how do you determine these two points for say the 5 o'clock marker?

Where are the pixels for the outline of a rectangle drawn? Inside the rectangle? Outside the rectangle? Or in between?

In this episode, we will look at the operations that QPainter offers, and especially, try to understand the drawText() method which is far from trivial.

Qt has a poor man's version of theming your application by changing the color schemes. It is most certainly used in KDE, but besides that I've never really seen it in action. It does, however, have quite some impact on how you do something as simple as changing the background color of a push button. Watch this episode to learn more.

JesperKjaerPedersen

Jesper K. Pedersen

HR Director / COO