projects
/
multypo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add a label to the UI
[multypo.git]
/
qt
/
multypo.cpp
diff --git
a/qt/multypo.cpp
b/qt/multypo.cpp
index 6e461e3abb35d461027bcdf3ac3e0be4897aff99..a5d81375048e331c225eeb45add07f89dfc4fab7 100644
(file)
--- a/
qt/multypo.cpp
+++ b/
qt/multypo.cpp
@@
-2,6
+2,8
@@
#include <QX11Info>
#include <QDebug>
#include <QX11Info>
#include <QDebug>
+#include <QHBoxLayout>
+#include <QLabel>
#include <X11/Xlib.h>
#include <X11/extensions/XInput2.h>
#include <X11/Xlib.h>
#include <X11/extensions/XInput2.h>
@@
-11,7
+13,13
@@
MultypoWindow::MultypoWindow(QWidget *parent) :
QWidget(parent),
xiInited(false)
{
QWidget(parent),
xiInited(false)
{
-
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ setLayout(layout);
+
+ mainLabel = new QLabel(this);
+ layout->addWidget(mainLabel);
+
+ setMinimumSize(300, 300);
}
MultypoWindow::~MultypoWindow()
}
MultypoWindow::~MultypoWindow()
@@
-50,15
+58,12
@@
void MultypoWindow::showEvent ( QShowEvent * )
XISelectEvents (dpy, winId(), &eventmask, 1);
xiInited = true;
XISelectEvents (dpy, winId(), &eventmask, 1);
xiInited = true;
-
- /*activateWindow();
- raise();
- setFocus(Qt::OtherFocusReason);*/
}
void MultypoWindow::handleKeyPress(int device, QString string)
{
qDebug() << "Device" << device << "String" << string;
}
void MultypoWindow::handleKeyPress(int device, QString string)
{
qDebug() << "Device" << device << "String" << string;
+ mainLabel->setText(QString("%1 pressed on %2").arg(string).arg(device));
}
bool MultypoWindow::handleX11Event(XEvent *event)
}
bool MultypoWindow::handleX11Event(XEvent *event)