title: how do you recalibrate touch events for a Qt application?
body: <p>I have a simple Qt5.2 application it's built for the TI AM335x EVM (ARM based processor). It just has 1 button on it which enables some LEDs on the board. </p>
  
  <p>The problem I'm having is that the touch event is not calibrated to the screen. Example:</p>
  
  <pre><code>*************
  *           *
  *  []       *
  *       X   *
  *           *
  *************
  </code></pre>
  
  <p>So if the <code>[]</code> is where the button is, the <code>X</code> is where you have to touch to activate it. It's like it's upside down and backwards. I've tried with larger applications (more buttons) and the trend follows. </p>
  
  <p>Now when I use the Qt4.8 GUI user interface provided by TI, the touch works as expected, so for some reason when I compile by 5.2 code it seems like it needs to be recalibrated, but I'm not sure how to do that.</p>
  
  <p>My questions:</p>
  
  <ol>
  <li>Has anyone working with Qt run into anything like this in the past?</li>
  <li>Anyone who knows Qt know if there is an ability to recalibrate programmatically? (I can't seem to find anything about this on the Qt site)</li>
  </ol>
  
  <hr>
  
  <p>Additional information that may or may not be helpful:</p>
  
  <p>My Qt environment was configured with this command:</p>
  
  <blockquote>
    <p>./configure -prefix /usr/Qt5.2 -xplatform linux-am335x-g++ -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -opensource</p>
  </blockquote>
  
  <p>Followed by a <code>make</code> and <code>make install</code>. My path is updated to include the correct version of the TI toolchain and the home configured/built version of <code>qmake</code>:</p>
  
  <blockquote>
    <p>mike@mike-VirtualBox:/usr/Qt5.2/test_button$ echo $PATH<br>
    <strong>/usr/Qt5.2/bin</strong>: <strong>/home/mike/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin</strong>:/usr/local/Trolltech/Qt-4.8.5/bin:/home/mike/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/mike/bin</p>
  </blockquote>
  
  <p>Flags used in the actual compile command:</p>
  
  <blockquote>
    <p>arm-linux-gnueabihf-g++ -c -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 -O2 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../mkspecs/linux-am335x-g++ -I. -I. -I../include -I../include/QtWidgets -I../include/QtGui -I../include/QtCore -I. -o main.o main.cpp</p>
  </blockquote>
  
  <p>The application is launched with:</p>
  
  <blockquote>
    <p>./touch_keys -platform eglfs</p>
  </blockquote>
  
  <p>The application:</p>
  
  <p>main.cpp:</p>
  
  <pre><code>#include "mainwindow.h"
  #include &lt;QApplication&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication app(argc, argv);
      MainWindow mainWindow;
      mainWindow.showMaximized();
      return app.exec();
  }
  </code></pre>
  
  <p>mainwindow.cpp</p>
  
  <pre><code>#include "mainwindow.h"
  #include &lt;QtCore/QCoreApplication&gt;
  #include &lt;QDebug&gt;
  #include &lt;QFile&gt;
  MainWindow::MainWindow(QWidget *parent)
      : QMainWindow(parent)
  {
      // Create the button, make "this" the parent
      m_button = new QPushButton("Light LEDs", this);
  
      // set size and location of the button
      m_button-&gt;setGeometry(QRect(QPoint(100, 100),
                                   QSize(200, 50)));
  
      // Connect button signal to appropriate slot
      connect(m_button, SIGNAL(released()), this, SLOT(handleButton()));
  }
  
  void MainWindow::handleButton()
  {
      char buf[10];
      // change the text
      m_button-&gt;setText("Boom");
  
      // resize button
      m_button-&gt;resize(100,100);
  }
  </code></pre>
  
  <p>mainwindow.h</p>
  
  <pre><code>#ifndef MAINWINDOW_H
  #define MAINWINDOW_H
  #include &lt;QMainWindow&gt;
  #include &lt;QPushButton&gt;
  
  namespace Ui {
      class MainWindow;
  }
  
  class MainWindow : public QMainWindow
  {
      Q_OBJECT
  public:
      explicit MainWindow(QWidget *parent = 0);
  private slots:
      void handleButton();
  private:
      QPushButton *m_button;
  };
  
  #endif // MAINWINDOW_H
  </code></pre>