summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-28 20:18:18 +0200
committerwm4 <wm4@nowhere>2014-09-28 20:18:18 +0200
commit34fc0720f763b67c2643c40408f8bdc80d288fef (patch)
tree464e35e46d8bb392501b01f370bd0422824542a8
parent3273db1ef72a9d1ee76ba704ace6c1b1898ab945 (diff)
downloadmpv-34fc0720f763b67c2643c40408f8bdc80d288fef.tar.bz2
mpv-34fc0720f763b67c2643c40408f8bdc80d288fef.tar.xz
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.
-rw-r--r--DOCS/client_api_examples/qtexample.cpp14
1 files 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;
}