Skip to content
  • 0 Votes
    3 Posts
    2k Views
    L
    add -tslib and recompile qt and chart example but not solved ! ./configure -prefix /opt/installed/arm/QtEmbededd-5.4-static-tiny210/ -opensource -confirm-license -no-xcb -xplatform linux-arm-gnueabi-g++ -nomake examples -feature-THREAD -feature-CONCURRENT -feature-SOUND -feature-EFFECTS -no-openssl -lpthread -optimized-qmake -no-cups -qt-zlib -static -qt-libjpeg -qt-libpng -qt-sql-sqlite -qpa linuxfb -linuxfb -tslib

    export TSLIB_FBDEVICE='/dev/fb0'
    export TSLIB_TSDEVICE=/dev/touchscreen-1wire
    export TSLIB_PLUGINDIR='/usr/lib/ts'
    export TSLIB_CONFFILE='/etc/ts.conf'
    export TSLIB_CALIBFILE='/etc/pointercal'
    export TSLIB_CONSOLEDEVICE='none'
    export TSLIB_TSEVENTTYPE='INPUT'

    export QT_DEBUG_PLUGINS=1 cat /dev/touchscreen-1wire | hexdump
    0000000 0fff 0fff 07c6 8629 07c5 8626 07c5 8626
    0000010 0fff 0fff 0966 85bb 096c 85b9 0968 85a8
    0000020 0968 85a8 0fff 0fff 0964 85ba 0938 85a9
    0000030 08ba 8571 085d 8559 07a1 8573 0736 8599

    $chartthemes -platform linuxfb -plugin tslib
    QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
    QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
    QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2" since plugins are disabled in static buils
    QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QPlatformInputContextFactoryInterface" since plugins are disabled in static builds
    QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QGenericPluginFactoryInterface" since plugins are disabled in static builds
    QFactoryLoader::QFactoryLoader() ignoring "org.qt-project.Qt.QStyleFactoryInterface" since plugins are disabled in static builds

  • 0 Votes
    3 Posts
    8k Views
    S

    @phil999
    I too have struggled with getting the Tslib touchscreen implementation to work. I've spent a lot of time sprinkling print statements around in the Qt code figuring out what is going on. What I've learned is this:

    Tslib and Evdev are separate implementations that are NOT equivalent. The Tslib implementation was developed for single touch (generally resistive) touchscreens while the Evdev implementation was developed for multi-touch (generally capacitive) touchscreens. For single touch screens, every action possible can be characterized as an equivalent mouse operation and that is what Tslib does. (Note that the Tslib plugin calls handleMouseEvent, not handleTouchEvent). Conversely the Evdev implementation does handle multi-touch which has no mouse equivalent so Evdev characterizes the touchscreen events as touch events.

    You MUST get your touchscreen properly calibrated so that the coordinates are within the screen dimensions. Mouse events will only be reported to an object if they are within the object. Try recalibrating the touchscreen (ts_calibrate) and then run ts_test to be sure the touchscreen operation is correct. (We found that some versions of ts_calibrate don't work correctly and made some changes in the code ourselves.)

    Event type 50 is a notifier event that I believe is triggering the QTsLibMouseHandler::readMouseData(). You can ignore these.

    Your event filter should be looking for Mouse events. Probably these will be GraphicsSceneMousePress, GraphicsSceneMouseRelease, GraphicsSceneMouseMove, GrabMouse and UngrabMouse. (But this is object dependent.) I was using the qtbase/examples/touch/knobs application for test and debug and in the Knob::sceneEvent() function in knob.cpp, I changed the case statement to look for those 5 events. On a touch-drag-release I typically see the following sequence:

    GrabMouse
    GraphicsSceneMousePress

    A variable number of GraphicsSceneMouseMove

    GraphicsSceneMouseRelease
    UngrabMouse

    Be sure to intercept these events and not call the default QGraphicsItem::sceneEvent() handler. It will inhibit seeing all of the above events except the initial GrabMouse and GraphicsSceneMousePress

    Hope this helps!