Qt学习(常用的代码段)——3-5

2019-04-15 14:07发布

this->setPixmap(QPixmap(":/pic/bg.jpg"));//导入图片 QCursor *cusor = new QCursor(QPixmap(":/pic/chui_up.png"));//更改鼠标图片 this->setCursor(*cusor); //设置图元 this->items[i] = new myItem; items[i]->setPos(this->items[i]->boundingRect().width() * (i % 4), this->items[i]->boundingRect().height() * (i/4)); //stackedWidget窗口 this->ui->stackedWidget->setCurrentIndex(1);//跳转到第二页 void MainWindow::update_time()//显示时间函数 { *this->time = this->time->addSecs(1); QString st = time->toString("hh:mm:ss"); this->ui->current_time->setText(st); } //窗口跳转 add =new Dialog(this); add->setModal(false); add->show();