|
像这样?(写鼠标滚轮事件)
1:头文件内定义:
private slots:
void mouseWheel(QWheelEvent* event);
2:源文件内:
connect(ui->customplot,SIGNAL(mouseWheel(QWheelEvent*)),this,SLOT(mouseWheel(QWheelEvent*)));
void MainWindow::mouseWheel(QWheelEvent* event)
{
ui->customplot->yAxis->setRangeLower(0);
} |
|