21 #include "../core/system/eptexception.h"
26 mKeyboardGraphicsView(nullptr) {
28 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
29 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
52 float deltaX = 1.f / numberOfKeys;
65 QGraphicsView::showEvent(event);
71 QGraphicsView::resizeEvent(event);
KeyboardGraphicsView * mKeyboardGraphicsView
Pointer to the KeyboardGraphicsView.
Implementation of the GraphicsViewAdapter in Qt using QGraphicsView.
const Keyboard * getKeyboard() const
Getter for mKeyboard.
virtual void setZOrder(double z)
Set the z order of the element (here implemented without function)
virtual GraphicsItem * drawFilledRect(double x, double y, double w, double h, PenType pen, FillTypes fill) override
Abstract function: Draw a filled rectangle.
AutoScaledToKeyboardGraphicsView(QWidget *parent, DrawerBase *drawer)
Constructor.
void addAutoScaledGraphicsView(AutoScaledToKeyboardGraphicsView *view)
Function to add a AutoScaledToKeyboardGraphicsView.
void resizeEvent(QResizeEvent *event) override
Reimplemented to keep the visible view with the KeyboardGraphicsView.
void setSceneRect(const QRectF &rect)
Setter function for the scene rectangle.
Class for a single item in a graphics view.
GraphicsItem * getGraphicItemByRole(RoleType role)
Get the first of all graphics elements with a given role.
void setKeyIndexAndItemRole(int index, RoleType role)
Short function for setting the key index and the role.
~AutoScaledToKeyboardGraphicsView()
Destructor.
int getNumberOfKeys() const
void highlightKey(int key)
Function that will highlight the given key.
void setKeyboard(KeyboardGraphicsView *keyboardgraphicsview)
Setter function for the keyboard.
void showEvent(QShowEvent *event) override
Reimplemented to keep the visible view with the KeyboardGraphicsView.
Abstract base class for drawing 2d graphics.
QRectF getVisibleContentsRect() const