[closed] Image is not displaying on pushbutton
-
Hi Everyone,
I want to add an image on push button, below is the code. The only problem is the app is running without a single error but the image is not being displayed on the button
Can anyone tell me what is wrong in the code.....Resource file is properly added and also the path is correctCode: (Overview.cpp)
@
#include "overview.h"
#include "ui_overview.h"
#include <QFile>
#include <QMessageBox>Overview::Overview(QWidget *parent) : QMainWindow(parent), ui(new Ui::Overview) { ui->setupUi(this); QString fileName("D:/solar4000/QT/images/actual.png"); if(QFile(fileName).exists() == false) QMessageBox::warning(this, "Application", "Wrong file name : " + fileName); else myButton.setIcon(QIcon(fileName)); } Overview::~Overview() { delete ui; }
@
Thanks
-
Closed due to "double":/forums/viewthread/16237/ posting. Please stick to a single topic for a single question.