Hi, I have the following working code but I only want to display the actual file name (not the entire file path) in the "openFileNameLabel" label. How can I do this?
void Blaster::setOpenFileName()
{
tr("Select a Blaster File)"),
openFileNameLabel->text(),
tr("Blaster Files (*.cmd);;Text Files (*.txt)"),
&selectedFilter,
options);
if (!fileName.isEmpty())
openFileNameLabel->setText(fileName);
}
{
QFileDialog::Options options;
QString selectedFilter;
fileName = QFileDialog::getOpenFileName(this,
tr("Select a Blaster File)"),
openFileNameLabel->text(),
tr("Blaster Files (*.cmd);;Text Files (*.txt)"),
&selectedFilter,
options);
if (!fileName.isEmpty())
openFileNameLabel->setText(fileName);
}
To copy to clipboard, switch view to plain text mode
any help is appreciated. Thanks
Bookmarks