void SlideShow::openPlaylist()
{
QString path = QFileDialog::getOpenFileName(this);
if (!path.isEmpty()) {
playlist->clear();
playlist->load(QUrl::fromLocalFile(path));
}
}
void SlideShow::openDirectory()
{
QString path = QFileDialog::getExistingDirectory(this);
if (!path.isEmpty()) {
playlist->clear();
QDir dir(path);
foreach (const QString &fileName, dir.entryList(QDir::Files))
playlist->addMedia(QUrl::fromLocalFile(dir.absoluteFilePath(fileName)));
statusChanged(imageViewer->mediaStatus());
toolBar->setEnabled(playlist->mediaCount() > 0);
}
}
杂记
最新推荐文章于 2024-08-03 23:59:53 发布