void xx::on_pushButton_clicked()
{
QFileDialog dialog(this);
dialog.setNameFilter(tr("Images (*.png *.gif *.jpg)"));
dialog.setViewMode(QFileDialog::Detail);
QString fn = QFileDialog::getOpenFileName(this,
tr("Select Image"),
"e:/",
tr("Images (*.png)"));
// Do something
}
void xx::on_pushButton_2_clicked()
{
QString ex= fn; // to be accessed from the above button selection
}
我想使用使用按钮选择的文件名来建立另一个按钮的操作。我该怎么做?