rename multixkbd -> multypo; get rid of UI magic
authorRalf Jung <post@ralfj.de>
Sat, 13 Jul 2013 10:40:20 +0000 (12:40 +0200)
committerRalf Jung <post@ralfj.de>
Sat, 13 Jul 2013 10:40:20 +0000 (12:40 +0200)
qt/.gitignore [new file with mode: 0644]
qt/main.cpp
qt/multikbd.ui [deleted file]
qt/multypo.cpp [moved from qt/multikbd.cpp with 85% similarity]
qt/multypo.h [moved from qt/multikbd.h with 67% similarity]
qt/multypo.pro [moved from qt/multixkbd.pro with 76% similarity]

diff --git a/qt/.gitignore b/qt/.gitignore
new file mode 100644 (file)
index 0000000..b77529f
--- /dev/null
@@ -0,0 +1,5 @@
+Makefile
+*.o
+multypo
+moc_*.cpp
+*.user
\ No newline at end of file
index 281bc971d6aa837a39cfd9a782a2a2f105f18a44..f9ddee2eb3aa3fa9adedbdb2983c78dffcb80aab 100644 (file)
@@ -1,4 +1,4 @@
-#include "multikbd.h"
+#include "multypo.h"
 #include <QApplication>
 
 #include <QDebug>
 #include <QApplication>
 
 #include <QDebug>
@@ -7,18 +7,18 @@
 #include <X11/extensions/XInput2.h>
 #include <X11/Xutil.h>
 
 #include <X11/extensions/XInput2.h>
 #include <X11/Xutil.h>
 
-MultiKBD *window;
+MultypoWindow *window;
 
 
-class QMyApplication : public QApplication
+class MultypoApplication : public QApplication
 {
 public:
 {
 public:
-       QMyApplication(int &argc, char **argv)
+       MultypoApplication(int &argc, char **argv)
                : QApplication(argc, argv) {}
 
        virtual bool x11EventFilter ( XEvent * event );
 };
 
                : 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);
 {
        if (!window) return false;
        return window->handleX11Event(event);
@@ -26,8 +26,8 @@ bool QMyApplication::x11EventFilter ( XEvent * event )
 
 int main(int argc, char *argv[])
 {
 
 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();
        
        window->setAttribute(Qt::WA_DeleteOnClose);
        window->show();
        
diff --git a/qt/multikbd.ui b/qt/multikbd.ui
deleted file mode 100644 (file)
index 552fab4..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MultiKBD</class>
- <widget class="QWidget" name="MultiKBD">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>MultiKBD</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <widget class="QRadioButton" name="radioButton">
-     <property name="text">
-      <string>RadioButton1</string>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QRadioButton" name="radioButton_2">
-     <property name="text">
-      <string>RadioButton2</string>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>211</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <widget class="QPushButton" name="pushButton">
-     <property name="text">
-      <string>Close</string>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources/>
- <connections>
-  <connection>
-   <sender>pushButton</sender>
-   <signal>clicked()</signal>
-   <receiver>MultiKBD</receiver>
-   <slot>close()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>199</x>
-     <y>283</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>199</x>
-     <y>149</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
similarity index 85%
rename from qt/multikbd.cpp
rename to qt/multypo.cpp
index fb30f2125bf923e4748ae6fd955a7185dcecd1aa..6e461e3abb35d461027bcdf3ac3e0be4897aff99 100644 (file)
@@ -1,5 +1,4 @@
-#include "multikbd.h"
-#include "ui_multikbd.h"
+#include "multypo.h"
 
 #include <QX11Info>
 #include <QDebug>
 
 #include <QX11Info>
 #include <QDebug>
@@ -8,20 +7,18 @@
 #include <X11/extensions/XInput2.h>
 #include <X11/Xutil.h>
 
 #include <X11/extensions/XInput2.h>
 #include <X11/Xutil.h>
 
-MultiKBD::MultiKBD(QWidget *parent) :
+MultypoWindow::MultypoWindow(QWidget *parent) :
        QWidget(parent),
        QWidget(parent),
-       ui(new Ui::MultiKBD),
        xiInited(false)
 {
        xiInited(false)
 {
-       ui->setupUi(this);
+       
 }
 
 }
 
-MultiKBD::~MultiKBD()
+MultypoWindow::~MultypoWindow()
 {
 {
-       delete ui;
 }
 
 }
 
-void MultiKBD::showEvent ( QShowEvent * )
+void MultypoWindow::showEvent ( QShowEvent * )
 {
        if (xiInited) return;
 
 {
        if (xiInited) return;
 
@@ -59,12 +56,12 @@ void MultiKBD::showEvent ( QShowEvent * )
        setFocus(Qt::OtherFocusReason);*/
 }
 
        setFocus(Qt::OtherFocusReason);*/
 }
 
-void MultiKBD::handleKeyPress(int device, QString string)
+void MultypoWindow::handleKeyPress(int device, QString string)
 {
        qDebug() << "Device" << device << "String" << string;
 }
 
 {
        qDebug() << "Device" << device << "String" << string;
 }
 
-bool MultiKBD::handleX11Event(XEvent *event)
+bool MultypoWindow::handleX11Event(XEvent *event)
 {
        if (!xiInited) return false;
        Display *dpy = x11Info().display();
 {
        if (!xiInited) return false;
        Display *dpy = x11Info().display();
similarity index 67%
rename from qt/multikbd.h
rename to qt/multypo.h
index 0244467e59634094cc349252ea509d67d43fe1c5..400d4c995eb848d19bbfeebf13d75d4bbbad6481 100644 (file)
@@ -3,17 +3,13 @@
 
 #include <QWidget>
 
 
 #include <QWidget>
 
-namespace Ui {
-class MultiKBD;
-}
-
-class MultiKBD : public QWidget
+class MultypoWindow : public QWidget
 {
        Q_OBJECT
        
 public:
 {
        Q_OBJECT
        
 public:
-       explicit MultiKBD(QWidget *parent = 0);
-       ~MultiKBD();
+       explicit MultypoWindow(QWidget *parent = 0);
+       ~MultypoWindow();
 
        bool handleX11Event(XEvent *event);
 
 
        bool handleX11Event(XEvent *event);
 
@@ -24,7 +20,6 @@ private:
        void handleKeyPress(int device, QString string);
 
 private:
        void handleKeyPress(int device, QString string);
 
 private:
-       Ui::MultiKBD *ui;
        bool xiInited;
        int xiOpcode;
 };
        bool xiInited;
        int xiOpcode;
 };
similarity index 76%
rename from qt/multixkbd.pro
rename to qt/multypo.pro
index 1bea7f102cc911839f525a56e0de235ec6343833..58a81a385bf28db8a136836d585b33ef2e969817 100644 (file)
@@ -8,15 +8,13 @@ QT       += core gui
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
-TARGET = multixkbd
+TARGET = multypo
 TEMPLATE = app
 
 
 SOURCES += main.cpp\
 TEMPLATE = app
 
 
 SOURCES += main.cpp\
-        multikbd.cpp
+        multypo.cpp
 
 
-HEADERS  += multikbd.h
-
-FORMS    += multikbd.ui
+HEADERS  += multypo.h
 
 LIBS += -lX11 -lXi
 
 LIBS += -lX11 -lXi