Work on SoundMacroEditor

This commit is contained in:
Jack Andersen
2018-07-21 17:45:47 -10:00
parent 321c2d9a3c
commit 441a3dbfd9
9 changed files with 700 additions and 66 deletions

View File

@@ -3,8 +3,10 @@
#include <QSvgRenderer>
#include <QMouseEvent>
#include <QScrollArea>
#include <QApplication>
#include <QScrollBar>
/* Used for generating transform matrices to map coordinate space */
/* Used for generating transform matrices to map SVG coordinate space */
static QTransform RectToRect(const QRectF& from, const QRectF& to)
{
QPolygonF orig(from);
@@ -193,6 +195,15 @@ void KeyboardWidget::leaveEvent(QEvent* event)
m_statusFocus->exit();
}
void KeyboardWidget::wheelEvent(QWheelEvent* event)
{
if (QScrollArea* scroll = qobject_cast<QScrollArea*>(parentWidget()->parentWidget()))
{
/* Send wheel event directly to the scroll bar */
QApplication::sendEvent(scroll->horizontalScrollBar(), event);
}
}
void KeyboardWidget::showEvent(QShowEvent* event)
{
if (QScrollArea* scroll = qobject_cast<QScrollArea*>(parentWidget()->parentWidget()))