$B@8M}3X8&5f=j$NB<ED$G$9!#(B
QTextEdit $B>e$G1&%/%j%C%/$9$k$H!"(B $B%3%s%F%-%9%H%a%K%e!<$,I=<($5$l$^$9$,!"(B $B0lEY%a%K%e!<$rJD$8$k$H!"$=$N8e(B $BI=<($5$l$J$/$J$j$^$9!#(B $B!J$?$@$7!"%&%#%s%I%&$r:G>.2=$7$?$j!"%?%$%H%k%P!<$r(B $B%/%j%C%/$7$?$j$9$k$H:F$SI=<($5$l$k$h$&$K$O$J$j$^$9!#!K(B
======== $B0J2<$,3:Ev$N%3!<%I$G$9(B ======== #include <QApplication> #include <QtWidgets>
int main(int argc, char *argv[]) { QApplication app(argc, argv); QTextEdit *edit = new QTextEdit; edit->setText("Hello Qt!"); edit->show(); return app.exec(); } ========================================
$B0J2<$N$h$&$K%l%$%"%&%H%^%M!<%8%c(B(QVBoxLayout)$B$r(B $B;H$&$h$&$K=$@5$7$?$H$3$m!"(B $B>e=R$N8=>]$,H/@8$7$J$/$J$j$^$7$?!#(B
======== $B=$@58e$N%3!<%I(B ======== #include <QApplication> #include <QtWidgets>
int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget *window = new QWidget; QTextEdit *edit = new QTextEdit; edit->setText("Hello Qt!"); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(edit); window->setLayout(layout); window->show(); return app.exec(); } ========================================
edit->setText("Hello Qt!"); $B$N2U=j$r(B edit->setHtml("Hello Qt!"); $B$H$7$?$j!"(B QTextEdit $B$NBe$o$j$K(B QPlainTextEdit $B$r;H$C$F(B edit->setPlainText("Hello Qt!"); $B$H$+$7$F$b%l%$%"%&%H%^%M!<%8%c$r;H$o$J$$$H(B $BF1MM$N8=>]$,H/@8$7$^$9!#(B
Qt$BB&$NIT6q9g$G$7$g$&$+!)(B
$B$J$*!"$3$A$i$G;n$7$?(B Qt $B$N%P!<%8%g%s$O0J2<$NDL$j$G$9!#(B Windows $BHG(B Qt 5.5.0 Linux $BHG(B Qt 5.4.2