| 1 | 
 – | 
 //#define USING_VM_TABLET_WARNING_FIX // Comment this line if not using a mac vm | 
 
 
 
 
 
 
 
 
 
 | 2 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 | 3 | 
 – | 
 #ifdef USING_VM_TABLET_WARNING_FIX | 
 
 
 
 
 
 
 
 
 
 | 4 | 
 – | 
 #include <qapplication.h> | 
 
 
 
 
 
 
 
 
 
 | 5 | 
 – | 
 void myMessageOutput(QtMsgType type, const QMessageLogContext &, const QString & str); | 
 
 
 
 
 
 
 
 
 
 | 6 | 
 – | 
 #endif | 
 
 
 
 
 
 
 
 
 
 | 7 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 1 | 
   | 
 #include <QtWidgets/QApplication> | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 2 | 
   | 
 #include "mainwindow.h" | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 3 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 4 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 5 | 
   | 
 int main(int argc, char *argv[]) | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 6 | 
   | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 7 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 | 14 | 
 – | 
 #ifdef USING_VM_TABLET_WARNING_FIX | 
 
 
 
 
 
 
 
 
 
 | 15 | 
 – | 
     qInstallMessageHandler(myMessageOutput); | 
 
 
 
 
 
 
 
 
 
 | 16 | 
 – | 
 #endif | 
 
 
 
 
 
 
 
 
 
 | 17 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 8 | 
   | 
     QApplication a(argc, argv); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 9 | 
   | 
     MainWindow w; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 10 | 
   | 
     w.show(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 | 
   | 
     a.setStyleSheet("QStatusBar::item { border: 0px; }"); //hide QLabels border in status bar //http://qt-project.org/forums/viewthread/18743 | 
 
 
 
 
 
 
 
 
 
 
 
 | 12 | 
 < | 
      | 
 
 
 
 
 
 
 
 
 
 | 12 | 
 > | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 13 | 
   | 
     return a.exec(); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 14 | 
   | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 15 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 | 26 | 
 – | 
 #ifdef USING_VM_TABLET_WARNING_FIX | 
 
 
 
 
 
 
 
 
 
 | 27 | 
 – | 
 void myMessageOutput(QtMsgType type, const QMessageLogContext &, const QString & str) | 
 
 
 
 
 
 
 
 
 
 | 28 | 
 – | 
 { | 
 
 
 
 
 
 
 
 
 
 | 29 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 | 30 | 
 – | 
     const char * msg = str.toStdString().c_str(); | 
 
 
 
 
 
 
 
 
 
 | 31 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 | 32 | 
 – | 
     switch (type) { | 
 
 
 
 
 
 
 
 
 
 | 33 | 
 – | 
     case QtWarningMsg: | 
 
 
 
 
 
 
 
 
 
 | 34 | 
 – | 
         if(QString(msg)=="QNSView handleTabletEvent: This tablet device is unknown (received no proximity event for it). Discarding event."){ // ignore this message | 
 
 
 
 
 
 
 
 
 
 | 35 | 
 – | 
             return; | 
 
 
 
 
 
 
 
 
 
 | 36 | 
 – | 
         } | 
 
 
 
 
 
 
 
 
 
 | 37 | 
 – | 
         else{ | 
 
 
 
 
 
 
 
 
 
 | 38 | 
 – | 
             fprintf(stderr, "%s\n", msg); | 
 
 
 
 
 
 
 
 
 
 | 39 | 
 – | 
             break; | 
 
 
 
 
 
 
 
 
 
 | 40 | 
 – | 
         } | 
 
 
 
 
 
 
 
 
 
 | 41 | 
 – | 
     case QtFatalMsg: | 
 
 
 
 
 
 
 
 
 
 | 42 | 
 – | 
         fprintf(stderr, "%s\n", msg); | 
 
 
 
 
 
 
 
 
 
 | 43 | 
 – | 
         abort(); | 
 
 
 
 
 
 
 
 
 
 | 44 | 
 – | 
     default: | 
 
 
 
 
 
 
 
 
 
 | 45 | 
 – | 
         fprintf(stderr, "%s\n", msg); | 
 
 
 
 
 
 
 
 
 
 | 46 | 
 – | 
         break; | 
 
 
 
 
 
 
 
 
 
 | 47 | 
 – | 
     } | 
 
 
 
 
 
 
 
 
 
 | 48 | 
 – | 
 } | 
 
 
 
 
 
 
 
 
 
 | 49 | 
 – | 
 #endif |