Add Qtgamepad cross compiling qt for raspberrypi0-wifi



  • Goodmorning,
    I've built a working image and toolchain for raspberrypio-wifi starting from b2qt distro.
    I could modify the b2qt-embedded-qt5-image.bb recipe as follow for having qtcharts but it doesn't work with qtgamepad. More precisely, it doesn't warn any error or mistake but inside the toolchain path there is no trace of qtgamepad.
    Has anyone faced this problem?
    Thank you.

    IMAGE_INSTALL += "qtcharts qtgamepad"
    

  • Lifetime Qt Champion

    Hi,

    I haven't used Boot2Qt yet but did you check that you have all dependencies required to build the module ?



  • Hello StGaist,
    regarding the dependencies, I tried adding the ones indicated in the following link, in IMAGE_INSTALL but unsuccessfully.
    https://layers.openembedded.org/layerindex/recipe/59814/
    In toolchain path inside Qt3DInput, regarding qtgamepad, there is only the qgamepadinput_p.h, shown below. Don't know if this information can help.

    /****************************************************************************
    **
    ** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
    ** Contact: http://www.qt-project.org/legal
    **
    ** This file is part of the Qt3D module of the Qt Toolkit.
    **
    ** $QT_BEGIN_LICENSE:LGPL3$
    ** Commercial License Usage
    ** Licensees holding valid commercial Qt licenses may use this file in
    ** accordance with the commercial license agreement provided with the
    ** Software or, alternatively, in accordance with the terms contained in
    ** a written agreement between you and The Qt Company. For licensing terms
    ** and conditions see http://www.qt.io/terms-conditions. For further
    ** information use the contact form at http://www.qt.io/contact-us.
    **
    ** GNU Lesser General Public License Usage
    ** Alternatively, this file may be used under the terms of the GNU Lesser
    ** General Public License version 3 as published by the Free Software
    ** Foundation and appearing in the file LICENSE.LGPLv3 included in the
    ** packaging of this file. Please review the following information to
    ** ensure the GNU Lesser General Public License version 3 requirements
    ** will be met: https://www.gnu.org/licenses/lgpl.html.
    **
    ** GNU General Public License Usage
    ** Alternatively, this file may be used under the terms of the GNU
    ** General Public License version 2.0 or later as published by the Free
    ** Software Foundation and appearing in the file LICENSE.GPL included in
    ** the packaging of this file. Please review the following information to
    ** ensure the GNU General Public License version 2.0 requirements will be
    ** met: http://www.gnu.org/licenses/gpl-2.0.html.
    **
    ** $QT_END_LICENSE$
    **
    ****************************************************************************/
    
    #ifndef QGAMEPADINPUT_P_H
    #define QGAMEPADINPUT_P_H
    
    //
    //  W A R N I N G
    //  -------------
    //
    // This file is not part of the Qt API.  It exists for the convenience
    // of other Qt classes.  This header file may change from version to
    // version without notice, or even be removed.
    //
    // We mean it.
    //
    
    #include <Qt3DInput/qabstractphysicaldevice.h>
    
    #include <Qt3DInput/private/qt3dinput_global_p.h>
    
    QT_BEGIN_NAMESPACE
    
    namespace Qt3DInput {
    class QGamepadInputPrivate;
    
    class QT3DINPUTSHARED_PRIVATE_EXPORT QGamepadInput : public QAbstractPhysicalDevice
    {
        Q_OBJECT
        Q_PROPERTY(int deviceId READ deviceId WRITE setDeviceId NOTIFY deviceIdChanged)
    public:
        explicit QGamepadInput(Qt3DCore::QNode *parent = nullptr);
    
        int deviceId() const;
        void setDeviceId(int deviceId);
    
    Q_SIGNALS:
        void deviceIdChanged();
    
    private:
        Q_DECLARE_PRIVATE(QGamepadInput)
    };
    
    } // Qt3DInput
    QT_END_NAMESPACE
    
    #endif // QGAMEPADINPUT_P_H
    

  • Lifetime Qt Champion

    Qt3D is not related to QtGamepad.

    Did you set sdl2 in PACKAGECONFIG ?



  • Hello @SGaist,
    I tried to add PACKAGECONFIG += "sdl2", it compiles but I cannot find qtgamepad cross-compiled. Reading on the net, qtgamepad is a new add-on library that comes version 5.12. My b2qt version is 5.11. Is that a possible reason why I cannot find it?
    Thank you for your help.


  • Lifetime Qt Champion

    The module itself is already usable, it's in tech preview but you can use it with Qt 5.11



  • Hello @SGaist ,
    if that so, I've run out any ideas. Instead of Qtgamepad, I can use simple linux GPIOs, but I was curious to try gamepad. Maybe in future b2qt version, they'll add qgamepad as default, so I'll see what I'm doing wrong.
    Thank you for you time.



  • Hello to all,
    After some more time, I succeeded to add qtgamepad. Basically, instead of modifying the image recipe b2qt-embedded-qt5-image.bb, I had to change the recipe contained in packagegrup packagegroup-b2qt-embedded-qt5-toolchain-target.bb.

    RDEPENDS_${PN} += " \
        ${MACHINE_EXTRA_INSTALL_SDK} \
        packagegroup-core-standalone-sdk-target \
        \
        .....
        qtgamepad-dev \
        "
    

    I believe that I can do this change in image recipe b2qt-embedded-qt5-image.bb using MACHINE_EXTRA_INSTALL_SDK +=qtgamepad-dev, not test though.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.