Image is not displaying on pushbutton
I want to add an image on push button to look as a icon, 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
- #include "overview.h"
- #include "ui_overview.h"
- #include <QFile>
- #include <QMessageBox>
- Overview::Overview(QWidget *parent) :
- ui(new Ui::Overview)
- QString fileName("D:/solar4000/QT/images/actual.png");
- if(QFile(fileName).exists() == false)
- QMessageBox::warning(this, "Application", "Wrong file name : " + fileName);
- delete ui;
Please check out the code wrapping possibility [qt-project.org] of Qt. This makes your code better readable.
I have closed your other topic on this same issue. Please stick to one topic per question. Double posting is not acceptable.
What is myButton exactly? You call ui->setupUi(this), but your button does not seem to be part of your ui? I would have expected to see something like: