From 34fc0720f763b67c2643c40408f8bdc80d288fef Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 28 Sep 2014 20:18:18 +0200 Subject: DOCS/client_api_examples: qtexample: remove broken resizing The intention was to adjust the window size to video size. It never worked well; it prevented the user to make the window smaller. For unknown reason it stopped resizing properly as well. This is just a cheap example, and I don't intend to fight with Qt, so replace the "demonstration" behavior by something slightly lamer. --- DOCS/client_api_examples/qtexample.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/DOCS/client_api_examples/qtexample.cpp b/DOCS/client_api_examples/qtexample.cpp index 84b1102055..2740bd9f67 100644 --- a/DOCS/client_api_examples/qtexample.cpp +++ b/DOCS/client_api_examples/qtexample.cpp @@ -96,16 +96,14 @@ void MainWindow::handle_mpv_event(mpv_event *event) mpv_get_property(mpv, "dheight", MPV_FORMAT_INT64, &h) >= 0 && w > 0 && h > 0) { - // Force Qt to resize the mpv window to video size. You probably - // want to do something more sophisticated here, because: - // A) it prevents the user from making the window smaller for no - // reason (I was unsure how to make Qt do the right thing) - // B) the MPV_EVENT_VIDEO_RECONFIG event doesn't necessarily imply - // a resize, and you should check yourself if the video - // dimensions really changed + // Note that the MPV_EVENT_VIDEO_RECONFIG event doesn't necessarily + // imply a resize, and you should check yourself if the video + // dimensions really changed. // mpv itself will scale/letter box the video to the container size // if the video doesn't fit. - mpv_container->setMinimumSize(w, h); + std::stringstream ss; + ss << "Reconfig: " << w << " " << h; + statusBar()->showMessage(QString::fromStdString(ss.str())); } break; } -- cgit v1.2.3