Answer the question
In order to leave comments, you need to log in
How to access ui qT elements?
Such a problem:
I create a QT project in the studio, I add a GUI class. In the designer I make one button pushButton
.hpp
#pragma once
#ifndef MAINWINDOW_HPP
#define MAINWINDOW_HPP
#include <QMainWindow>
namespace Ui {class MainWindow;}
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget * parent = Q_NULLPTR);
~MainWindow();
public:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_HPP
#include "mainwindow.hpp"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget * parent) : QMainWindow(parent) {
ui = new Ui::MainWindow();
ui->setupUi(this);
MainWindow::~MainWindow() {
delete ui;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question