mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-03 06:33:50 +08:00
7d7f0054e5
date: 2024-02-21T23:02:42 master commit: 0b4d08fab8e35a264bc7383e878538f8083c33e5
41 lines
701 B
C++
41 lines
701 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include <QFrame>
|
|
#include <QPushButton>
|
|
#include <QStackedLayout>
|
|
|
|
class KeyButton : public QPushButton {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
KeyButton(const QString &text, QWidget *parent = 0);
|
|
bool event(QEvent *event) override;
|
|
};
|
|
|
|
class KeyboardLayout : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit KeyboardLayout(QWidget* parent, const std::vector<QVector<QString>>& layout);
|
|
};
|
|
|
|
class Keyboard : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit Keyboard(QWidget *parent = 0);
|
|
|
|
private:
|
|
QStackedLayout* main_layout;
|
|
|
|
private slots:
|
|
void handleButton(QAbstractButton* m_button);
|
|
|
|
signals:
|
|
void emitKey(const QString &s);
|
|
void emitBackspace();
|
|
void emitEnter();
|
|
};
|