How to set image on QPushButton?

前端 未结 8 429
时光说笑
时光说笑 2020-11-30 21:34

I want to set an image on QPushButton, and the size of QPushButton should depend on the size of the image. I am able to do this when using QL

8条回答
  •  南方客
    南方客 (楼主)
    2020-11-30 22:11

    QPushButton *button = new QPushButton;
    button->setIcon(QIcon(":/icons/..."));
    button->setIconSize(QSize(65, 65));
    

提交回复
热议问题