QT_Screen的汇编问题

Compilation issue with qt_screen

本文关键字:汇编 问题 Screen QT      更新时间:2023-10-16

我在Ubuntu OS上安装了QT5.5。

编译程序时,我要低于错误 -

这就是我为错误

../../work/mainwindow.cpp: In constructor 'MainWindow(QWidget)': 
../../work/mainwindow.cpp:63:31:
error: 'qt_screen' was not declared in this scope ui->stackedWidget-
>resize(qt_screen->deviceWidth(),qt_screeb->deviceHeight());

这是我的代码的一部分

MainWindow::MainWindow(QWidget *parent) : 
QMainWindow(parent),
ui(new Ui::MainWindow)
{
  ui->setipUi(this);
  setWindowFlags(Qt::CustomizeWindowHint);
  ui->stackedWidget->resize(qt_screen->deviceWidth().qt_screen->deviceHeight());
  ui->stackedWidget->setCurrentWidget(ui->stackedWidgetPageMain);
  initPageMain();
  touch=new Touch();
  powerButton=new PowerButton();
  auxButton=new AuxButton();
  usbOtg=new UsbOtg();
  battery=new Battery();
  panel=new Panel();
  lan=new Lan();
  hPattern= new HPattern();
  lodLog=new LodLog();
  record=new Record();
  led=new Led();
  lightsensor=new LightSensor();
}

我是否想念任何东西?

顺便说一句,我确定我已经将QScreen包含在其中。

我是否有可能在代码上设置错误?

QSCREEN类已从QT4和QT5发生了显着变化,实际上是如此之多,以至于它在QT5中被认为是新的。

QT4 QSCREEN具有称为QScreen::instance()的静态方法,该方法返回了QScreen实例指针。回到QT4中,如果我没记错的话,该指针取自全局变量qt_screen。所有这些都已更改,因此只需删除访问QT_Screen的所有代码,并通过正确访问公共API来修复它。