From: Ralf Jung Date: Sat, 13 Jul 2013 10:40:20 +0000 (+0200) Subject: rename multixkbd -> multypo; get rid of UI magic X-Git-Url: https://git.ralfj.de/multypo.git/commitdiff_plain/1d03d11fb0aa8e3418597e7c1ab38f2b28d48924?ds=inline rename multixkbd -> multypo; get rid of UI magic --- diff --git a/qt/.gitignore b/qt/.gitignore new file mode 100644 index 0000000..b77529f --- /dev/null +++ b/qt/.gitignore @@ -0,0 +1,5 @@ +Makefile +*.o +multypo +moc_*.cpp +*.user \ No newline at end of file diff --git a/qt/main.cpp b/qt/main.cpp index 281bc97..f9ddee2 100644 --- a/qt/main.cpp +++ b/qt/main.cpp @@ -1,4 +1,4 @@ -#include "multikbd.h" +#include "multypo.h" #include #include @@ -7,18 +7,18 @@ #include #include -MultiKBD *window; +MultypoWindow *window; -class QMyApplication : public QApplication +class MultypoApplication : public QApplication { public: - QMyApplication(int &argc, char **argv) + MultypoApplication(int &argc, char **argv) : QApplication(argc, argv) {} virtual bool x11EventFilter ( XEvent * event ); }; -bool QMyApplication::x11EventFilter ( XEvent * event ) +bool MultypoApplication::x11EventFilter ( XEvent * event ) { if (!window) return false; return window->handleX11Event(event); @@ -26,8 +26,8 @@ bool QMyApplication::x11EventFilter ( XEvent * event ) int main(int argc, char *argv[]) { - QMyApplication a(argc, argv); - window = new MultiKBD(); + MultypoApplication a(argc, argv); + window = new MultypoWindow(); window->setAttribute(Qt::WA_DeleteOnClose); window->show(); diff --git a/qt/multikbd.ui b/qt/multikbd.ui deleted file mode 100644 index 552fab4..0000000 --- a/qt/multikbd.ui +++ /dev/null @@ -1,73 +0,0 @@ - - - MultiKBD - - - - 0 - 0 - 400 - 300 - - - - MultiKBD - - - - - - RadioButton1 - - - - - - - RadioButton2 - - - - - - - Qt::Vertical - - - - 20 - 211 - - - - - - - - Close - - - - - - - - - - pushButton - clicked() - MultiKBD - close() - - - 199 - 283 - - - 199 - 149 - - - - - diff --git a/qt/multikbd.cpp b/qt/multypo.cpp similarity index 85% rename from qt/multikbd.cpp rename to qt/multypo.cpp index fb30f21..6e461e3 100644 --- a/qt/multikbd.cpp +++ b/qt/multypo.cpp @@ -1,5 +1,4 @@ -#include "multikbd.h" -#include "ui_multikbd.h" +#include "multypo.h" #include #include @@ -8,20 +7,18 @@ #include #include -MultiKBD::MultiKBD(QWidget *parent) : +MultypoWindow::MultypoWindow(QWidget *parent) : QWidget(parent), - ui(new Ui::MultiKBD), xiInited(false) { - ui->setupUi(this); + } -MultiKBD::~MultiKBD() +MultypoWindow::~MultypoWindow() { - delete ui; } -void MultiKBD::showEvent ( QShowEvent * ) +void MultypoWindow::showEvent ( QShowEvent * ) { if (xiInited) return; @@ -59,12 +56,12 @@ void MultiKBD::showEvent ( QShowEvent * ) setFocus(Qt::OtherFocusReason);*/ } -void MultiKBD::handleKeyPress(int device, QString string) +void MultypoWindow::handleKeyPress(int device, QString string) { qDebug() << "Device" << device << "String" << string; } -bool MultiKBD::handleX11Event(XEvent *event) +bool MultypoWindow::handleX11Event(XEvent *event) { if (!xiInited) return false; Display *dpy = x11Info().display(); diff --git a/qt/multikbd.h b/qt/multypo.h similarity index 67% rename from qt/multikbd.h rename to qt/multypo.h index 0244467..400d4c9 100644 --- a/qt/multikbd.h +++ b/qt/multypo.h @@ -3,17 +3,13 @@ #include -namespace Ui { -class MultiKBD; -} - -class MultiKBD : public QWidget +class MultypoWindow : public QWidget { Q_OBJECT public: - explicit MultiKBD(QWidget *parent = 0); - ~MultiKBD(); + explicit MultypoWindow(QWidget *parent = 0); + ~MultypoWindow(); bool handleX11Event(XEvent *event); @@ -24,7 +20,6 @@ private: void handleKeyPress(int device, QString string); private: - Ui::MultiKBD *ui; bool xiInited; int xiOpcode; }; diff --git a/qt/multixkbd.pro b/qt/multypo.pro similarity index 76% rename from qt/multixkbd.pro rename to qt/multypo.pro index 1bea7f1..58a81a3 100644 --- a/qt/multixkbd.pro +++ b/qt/multypo.pro @@ -8,15 +8,13 @@ QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -TARGET = multixkbd +TARGET = multypo TEMPLATE = app SOURCES += main.cpp\ - multikbd.cpp + multypo.cpp -HEADERS += multikbd.h - -FORMS += multikbd.ui +HEADERS += multypo.h LIBS += -lX11 -lXi