在窗口w上面画个黄色的框:在窗口上添加一个label,然后在label上画框

 QLabel label(&w);
    label.setScaledContents(true);
    QPixmap pix(w.size());
    pix.fill(Qt::transparent);
    QPainter p(&pix);
    p.setRenderHint(QPainter::Antialiasing);
    p.setPen(QPen(Qt::yellow,5));
    p.drawRect(w.rect().adjusted(20,20,-20,-20));
    label.setPixmap(pix);

 

相关文章:

  • 2021-12-26
  • 2021-08-26
  • 2021-06-10
  • 2021-06-06
  • 2021-12-31
  • 2022-02-13
猜你喜欢
  • 2022-12-23
  • 2021-12-04
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2021-12-13
相关资源
相似解决方案