void MainWindow::update_accel() { // read the file /sys/class/i2c-adapter/i2c-3/3-001d/coord QFile file("/sys/class/i2c-adapter/i2c-3/3-001d/coord"); if (!file.open (QIODevice::ReadOnly)) { return; } else { QTextStream stream ( &file ); QString line; while( !stream.atEnd() ) { line = stream.readLine(); ui->label->setText(line); } } }