C++ (Qt)QTextEdit edit;edit.setReadOnly(true);edit.insertPlainText("text");
C++ (Qt)#include "widget.h"#include "ui_widget.h" #include <QApplication>#include <QAxObject>#include <QAxWidget>#include <QtWidgets>#include <QString> Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget){ ui->setupUi(this);} Widget::~Widget(){ delete ui;} int main(int argc, char *argv[]){ QApplication a(argc, argv); Widget mainWindow; mainWindow.setWindowTitle("qwerty"); QVBoxLayout layout(&mainWindow); mainWindow.show(); return a.exec();} void Widget::on_pushButton_clicked(){ this->close();}
ui->
ui->textEdit->setText("текст");
C++ (Qt)#include <QWidget> class MyWidget : public QWidget { public: MyWidget(QWidget *parent = 0); };
Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget){ ui->setupUi(this); ui->textEdit->setText("текст");}
C++ (Qt)int main(int argc, char *argv[]){ QApplication a(argc, argv); Widget mainWindow; mainWindow.show(); return a.exec();}