Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Qt Gamepad documentation
Forum Updated to NodeBB v4.3 + New Features

Qt Gamepad documentation

Scheduled Pinned Locked Moved Unsolved Game Development
22 Posts 4 Posters 11.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X xiuscut
    6 Mar 2017, 04:50

    @TimurE
    I work at Win10 64 bits and QT5.7.0 ,msvc14。It canwork at this code.
    Gamepad::Gamepad(QObject *parent) : QObject(parent)
    , m_gamepad(0)
    {
    m_gamepad = new QGamepad(0,this);//or just m_gamepad = new QGamepad; is ok//
    connect(m_gamepad,&QGamepad::connectedChanged,this,&MMGamepad::connectedChangedEvent);
    qDebug() << "A new gamepad:"<<m_gamepad->isConnected();// when start is false
    }
    void Gamepad::connectedChangedEvent(bool value)
    {
    if(value)
    {
    qDebug() << "Gamepad:: decive is connect!" ;
    }
    else
    {
    qDebug() << "Gamepad:: decive is disconnect!" ;
    }
    }
    and you can get any signal after"Gamepad:: decive is connect".

    X Offline
    X Offline
    xiuscut
    wrote on 6 Mar 2017, 05:07 last edited by
    #21

    @xiuscut said in Qt Gamepad documentation:

    connectedChangedEvent

    also remenber "QT += gamepad" in .pro and #include <QtGamepad/QGamepad>

    X 1 Reply Last reply 27 Apr 2021, 07:37
    0
    • X xiuscut
      6 Mar 2017, 05:07

      @xiuscut said in Qt Gamepad documentation:

      connectedChangedEvent

      also remenber "QT += gamepad" in .pro and #include <QtGamepad/QGamepad>

      X Offline
      X Offline
      xiuscut
      wrote on 27 Apr 2021, 07:37 last edited by
      #22
      This post is deleted!
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved