disabled slider scroll

This commit is contained in:
Hane 2024-05-07 19:38:17 +02:00
commit 16604277fb
2 changed files with 17 additions and 5 deletions

View file

@ -10,6 +10,14 @@ void MeterSlider::setPeakValue(float peakValue) {
this->peakValue = peakValue;
}
bool MeterSlider::event(QEvent* ev) {
if (ev->type() == QEvent::Wheel) {
ev->setAccepted(false);
return false;
}
return QSlider::event(ev);
}
void MeterSlider::paintEvent(QPaintEvent *event) {
QStyleOptionSlider sliderComplex = QStyleOptionSlider();
sliderComplex.initFrom(this);
@ -246,7 +254,7 @@ void MainWindow::compose() {
windowHeight += bottom;
log_debugcpp("windowHeight loop: " + std::to_string(windowHeight));
}
windowHeight += mainMenuBar->height();
windowHeight += mainMenuBar->sizeHint().height();
log_debugcpp("windowHeight final value: " + std::to_string(windowHeight));
//Undoing scrolling
@ -406,7 +414,7 @@ ChannelWidget::ChannelWidget(uint32_t channelCount, EndpointHandler* eph, QWidge
*/
//uint32_t epChannelCount = eph->getChannelCount();
for(uint64_t channel = 0, col = 0, row = 0; channel < channelCount && channelCount > 1; channel++){
QSlider* tmp = new QSlider(Qt::Horizontal);
MeterSlider* tmp = new MeterSlider(Qt::Horizontal);
QLabel* tmpLb = new QLabel("");
tmp->setTickInterval(5);
tmp->setSingleStep(1);
@ -656,7 +664,6 @@ void EndpointWidget::customEvent(QEvent* ev) {
QWidget::customEvent(ev);
}
EndpointWidget::~EndpointWidget() {
timer->stop();
delete timer;