show data in external window with custom widget in qt

Sometime you need to show data in external window with custom widget(s). This little code will help you.

function showCustomWidget() {
 
 QDialog *dlgMultiLine =    new QDialog();
 QGridLayout *gridLayout = new QGridLayout(dlgMultiLine);
 QPlainTextEdit *txtMultiline = new QPlainTextEdit();
 
 txtMultiline->setPlainText(this->toPlainText());
 
 gridLayout->addWidget(txtMultiline, 0, 0, 1, 1);
 dlgMultiLine->show();
 
}

Popularity: 60% [?]

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Leave a Reply