Building histograms in QT is done using Qwt. The logic of building them is similar to building graphs. (First, I suggest reading this.) Let's consider a simple example of building a histogram using QwtPlotHistogram.
Unfortunately, in QT there is no convenient component TChart (from Borland, for Delphi/Builder). But there is a good alternative - Qwt. There should be no problems with adding graphs and histograms, but sometimes (depending on the task) there may be difficulties with bubbles. But not now. Let's start with regular graphs.
Very often, when modeling physical processes, it is necessary to implement a random number generator (or simply "random"). Let's start with the basics. In fact, there is no perfect, "correct" random number generator. To some extent, this task can be performed by a girl, as female logic is also a random generator (and a pretty good one). But we are interested in implementing it in QT.