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

 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();
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容