create a custom dialog box with multi line input in qt

//create a custom dialog box with multi line input
void MainWindow::createMultilineInput()
{
//class variable    
dlgMultiLine =    new QDialog(this);
 
//local variable
    QGridLayout *gridLayout = new QGridLayout(dlgMultiLine);
 
//class variable
    txtMultiline = new QPlainTextEdit();
 
    txtMultiline->setObjectName(QString::fromUtf8("txtMultiline"));
    gridLayout->addWidget(txtMultiline, 0, 0, 1, 1);
    QDialogButtonBox *buttonBox = new QDialogButtonBox();
    buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
    buttonBox->setOrientation(Qt::Horizontal);
    buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
 
    gridLayout->addWidget(buttonBox, 1, 0, 1, 1);
 
    connect(buttonBox,SIGNAL(accepted()),this,SLOT(on_acceptLoadHtml()));
    connect(buttonBox,SIGNAL(rejected()),this,SLOT(on_rejectLoadHtml()));
 
    dlgMultiLine->show();
}
Category(s): Qt, Qt-Tips
Tags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

 

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">