I would use QSlider with QLabel (s) as shown below. My usual caveat is that you may need some fine tuning and tuning yourself.
main.cpp
#include <QMainWindow> #include <QApplication> #include <QGridLayout> #include <QSlider> #include <QLabel> class MainWindow Q_DECL_FINAL : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = Q_NULLPTR) : QMainWindow(parent) { QSlider *slider = new QSlider(Qt::Horizontal, this); slider->setRange(1, 4); slider->setSingleStep(1); QLabel *label1 = new QLabel("Novice", this); QLabel *label2 = new QLabel("Intermediate", this); QLabel *label3 = new QLabel("Advanced", this); QLabel *label4 = new QLabel("Expert", this); QGridLayout *layout = new QGridLayout; layout->addWidget(slider, 0, 0, 1, 4); layout->addWidget(label1, 1, 0, 1, 1); layout->addWidget(label2, 1, 1, 1, 1); layout->addWidget(label3, 1, 2, 1, 1); layout->addWidget(label4, 1, 3, 1, 1); setLayout(layout); } }; #include "main.moc" int main(int argc, char **argv) { QApplication application(argc, argv); MainWindow mainWindow; mainWindow.show(); return application.exec(); }
main.pro
TEMPLATE = app TARGET = main QT += widgets SOURCES += main.cpp
Assembly and launch
qmake && make && ./main
lpapp source share