cgyan1
12th February 2012, 13:06
Hi,
I was wondering what the best approach for creating a custom widget that contains moving parts is. Say I was going to create something from scratch like a slider widget similar to QSlider, for example, then the handle of the slider obviously must be able to be dragged. If this widget was designed in QtDesigner then, unless I'm mistaken, in order for the handle to be promoted to be able to receive direct mouse events in a custom class, the handle itself must be in one of the structured layouts which defeats its purpose of it being movable. I experimented by placing some widgets inside a parent widget without any structured layouts applied and promoted a couple of the child widgets but they do not show when the code is run.
So what would be the best approach/structure of designing something along these lines?
I was wondering what the best approach for creating a custom widget that contains moving parts is. Say I was going to create something from scratch like a slider widget similar to QSlider, for example, then the handle of the slider obviously must be able to be dragged. If this widget was designed in QtDesigner then, unless I'm mistaken, in order for the handle to be promoted to be able to receive direct mouse events in a custom class, the handle itself must be in one of the structured layouts which defeats its purpose of it being movable. I experimented by placing some widgets inside a parent widget without any structured layouts applied and promoted a couple of the child widgets but they do not show when the code is run.
So what would be the best approach/structure of designing something along these lines?