Hi,
I made a floating widget a while ago, it's a bit rough on the edges, but it could be helpful to your case.
It just needs a parent and a trigger, it'll do the rest on its own.
For a QLabel, you could use the linkActivated signal, since I believe clicking is a more controllable trigger compared to hovering, which could be triggered by mistake. But if you're determined on relying on mouse hover, you could use linkHovered instead.
Here's an example:
#include <QApplication>
#include <QSlider>
#include <QLabel>
#include "mfloatwidget.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//style the link to make it look like normal text
//and provide whatever text for the actual link, it'll be enough to trigger linkActivated
QLabel label("<a style=\"color: white; text-decoration:none;\" href=\"someText\">100%</a>");
label.setAlignment(Qt::AlignCenter);
MFloatWidget floatingWidget(&label);
QSlider slider(Qt::Horizontal);
//addWidget is a custom method to add widgets to the floating widget
floatingWidget.addWidget(&slider);
//clicking the label text will pop up the floating widget which contains the slider
label.connect(&label, &QLabel::linkActivated, &floatingWidget, &QWidget::show);
label.show();
return a.exec();
}
[image: 524e9109-b16b-4124-a763-3c1bd6956906.gif]
You can find some explanation about the custom widget on my blog: How to make a floating widget in Qt, and the link to the public repository if this is useful/useable.