diff --git a/examples/player/MainWindow.cpp b/examples/player/MainWindow.cpp index fb7cda4cb..f0f1d9ceb 100644 --- a/examples/player/MainWindow.cpp +++ b/examples/player/MainWindow.cpp @@ -1325,7 +1325,7 @@ void MainWindow::onTimeSliderHover(int pos, int value) m_preview->preview(); const int w = Config::instance().previewWidth(); const int h = Config::instance().previewHeight(); - m_preview->setWindowFlags(m_preview->windowFlags() |Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint); + m_preview->setWindowFlags(Qt::Tool |Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint); m_preview->resize(w, h); m_preview->move(gpos - QPoint(w/2, h)); m_preview->show(); @@ -1333,8 +1333,18 @@ void MainWindow::onTimeSliderHover(int pos, int value) void MainWindow::onTimeSliderLeave() { - if (m_preview && m_preview->isVisible()) - m_preview->hide(); + /*if (m_preview && m_preview->isVisible()) + m_preview->hide();*/ + if (!m_preview) + { + return; + } + if (m_preview->isVisible()) + { + m_preview->close(); + } + delete m_preview; + m_preview = NULL; } void MainWindow::handleError(const AVError &e)