#include class myLabel: public QLabel { public: myLabel() { this->setAlignment(Qt::AlignCenter); }; ~ myLabel(){}; void wheelEvent ( QWheelEvent * event ) { if(event->modifiers()==Qt::AltModifier) qDebug()<<"Got it the Alt"; if(event->modifiers()==Qt::ShiftModifier) qDebug()<<"Got it the Shift"; else qDebug()<modifiers(); }; public: static int x; }; int main(int argc, char **argv) { QApplication app(argc, argv); QMainWindow *window = new QMainWindow(); QWidget *centralWidget = new QWidget(window); QHBoxLayout* layout = new QHBoxLayout(centralWidget); myLabel* scrollStepLabel = new myLabel(); layout->addWidget(scrollStepLabel); window->setCentralWidget(centralWidget); window->show(); return app.exec(); }