Skip to content

Instantly share code, notes, and snippets.

@sunjun
Created February 3, 2016 09:58
Show Gist options
  • Save sunjun/d7fb240fb821ce78e94d to your computer and use it in GitHub Desktop.
Save sunjun/d7fb240fb821ce78e94d to your computer and use it in GitHub Desktop.
gist
ui->setupUi(this);
QDesktopWidget *desktop = QApplication::desktop();
QRect screen = desktop->screenGeometry();
int screenWidth = screen.width();
int screenHeight = screen.height();
this->setFixedSize(screenWidth, screenHeight);
QRect r = ui->label->geometry();
r.setWidth(screenWidth);
r.setCoords(0,screenHeight/2, screenWidth, screenHeight/2+20);
// r.adjust(0,screenHeight/2, screenWidth, screenHeight/2+20);
ui->label->setGeometry(r);
ui->label->setText("你好,请刷身份证进行登录");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment