QGyroscope *gyroscope;
QGyroscopeReading *reader;
gyroscope = new QGyroscope(this);
gyroscope->start();
reader = gyroscope->reading();
qreal x = reader->x();
qreal y = reader->y();
qreal z = reader->z();
qDebug()<<"x 是:" <<x;
qDebug()<<"y 是:" <<y;
qDebug()<<"z 是:" <<z;
ui->label_y->setText(QString::number(y));
ui->label_x->setText(QString::number(x));
ui->label_z->setText(QString::number(z));
1
WordTian 2019-03-12 17:53:33 +08:00 via Android
权限?
|
2
pp710680429 OP 没有啊,感光的传感器是正常的,就这个和加速度计不行!
|