刚刚试了一下,可是提示open was not declared in this scope. 我包含了头文件啊
源码如下:
#include "smartdelaywidget.h"
#include <QApplication>
#include <QWSServer>
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int fd;
QApplication a(argc, argv);
SmartDelayWidget w;
QWSServer::setCursorVisible(false); //hide the cursor
w.setWindowFlags(Qt::FramelessWindowHint); //hide the Window title
w.show();
fd = open("/dev/pwm", 0);
if (fd < 0) {
perror("open pwm_buzzer device");
exit(1);
}
return a.exec();
}