Kloster
1st September 2016, 07:43
Hi there,
I tried to make use of the GUi editor in QT creator and apply images to my project using a label as displayed on youtube. but they haven't seemed to work. Can someone teach me how to add multiple pictures to my project? I also tried to include Qpixmap and link to it that way but they still didn't show up when I ran my project.
I have attached a picture of what I would like it to look like and my project code is currently as follows
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QPixmap"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
ui->label_5->setText("Pump On");
}
void MainWindow::on_pushButton_2_clicked()
{
ui->label_6->setText("Pump On");
}
void MainWindow::on_pushButton_3_clicked()
{
ui->label_7->setText("Pump On");
}
I tried to make use of the GUi editor in QT creator and apply images to my project using a label as displayed on youtube. but they haven't seemed to work. Can someone teach me how to add multiple pictures to my project? I also tried to include Qpixmap and link to it that way but they still didn't show up when I ran my project.
I have attached a picture of what I would like it to look like and my project code is currently as follows
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QPixmap"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
ui->label_5->setText("Pump On");
}
void MainWindow::on_pushButton_2_clicked()
{
ui->label_6->setText("Pump On");
}
void MainWindow::on_pushButton_3_clicked()
{
ui->label_7->setText("Pump On");
}