[Qt-interest] doc to string cause "program unexpectedly finished" error

Knapp magick.crow at gmail.com
Fri Mar 6 16:11:35 CET 2009


Everything seems to work until this. When I click the button that
calls this slot the program ends with "program unexpectedly finished"
error.

Problem is the line starting with ui->, all I want to do is view the
xml from the QDomDocument doc. I don't understand why this does not
work. When I comment out this like it works fine.

Hope this is not a totally newbie question but I am afraid it is.
Thanks for the help!

void MainWindow::loadXML()
{
    QDomDocument doc( "AdBookML" );
    QFile file( ":/Pictures/Library__L.glb" );
    if( !file.open(QFile::ReadOnly | QFile::Text)) errorReport(tr("XML
Open file error!"));
    if( !doc.setContent( &file ))
    {
      file.close();
      errorReport(tr("XML SetContents error!"));
    }
    ui->textEdit->setText(doc.toString());
    file.close();
}

-- 
Douglas E Knapp



More information about the Qt-interest-old mailing list