Tell me, how can you implement such a "custom" component (similar to timeline music editors)? You need to get a graded "container" with lines where you can add objects. Added objects can be moved with the mouse only along the line where the object was added. What is an "object"? Suppose QButton is not important in principle .. any widget. The result should be something like this enter image description here

or something like that

enter image description here

  • Qt which version? - ixSci
  • Qt version 5 used - jaroslav

1 answer 1

You can create your component in two ways; the easiest is to take the existing components and on the basis of them to make your own. You can even use a designer for this. More details in the official documentation and here again.

There is another way, it is more complicated, but it represents more freedom: you can draw everything yourself in C ++, and then register this as a component of QtQuick and use it along with other components in QML code. About this, too, is written in the documentation .


Here is another link from Runet

  • ixSci, thanks. The information looked. But so far I can’t figure out how to combine the object container and the gradation line. Looked towards QCustomPlot and GridView on qml. - jaroslav
  • Can anyone have any better ideas? - jaroslav
  • @jaroslav, everything is simple, in fact. You just need to build on the existing model and combine visual elements according to them. But you have neither a model nor a specific visual requirement in the question, and no one will solve the abstract problem completely for you. - ixSci
  • ixSci, sorry .. just do not know how else to describe. you need to get a graded "container" with lines where you can add objects. added objects can be moved with the mouse only along the line where the object was added. What is an "object"? let's say QButton, not important in principle .. any widget. in the end, something like this upload.wikimedia.org/wikipedia/ro/timeline/… should turn out - jaroslav
  • @jaroslav, add this to the question by changing it. This will lift it up and others will see it. If I have time tomorrow, I'll take a look - ixSci 4:02 pm