void Form::on_treeWidget_itemClicked(QTreeWidgetItem* item, int column){ m_ui->textBrowser->setSource(QUrl("file:///E:/Qt/My/Newpro/lex_1.html")); }
// create First itemQTreeWidgetItem *item = new QTreeWidgetItem(ui.treeWidget);item->setText(0, tr("First Item"));item->setData(0, Qt::UserRole, QString("c:/index.html"));// create Second itemitem = new QTreeWidgetItem(ui.treeWidget, item);item->setText(0, tr("Child Item"));item->setData(0, Qt::UserRole, QString("c:/child.html"));...connect(ui.treeWidget, SIGNAL(itemSelectionChanged () ), SLOT(on_itemSelectionChanged () ));...void myForm::on_itemSelectionChanged () { if (!ui.treeWidget->currentItem()) return; ui.textBrowser->setSource(QUrl(ui.treeWidget->currentItem()->data(0, Qt::UserRole).toString()));}