From 6c76dda4f0560991c326d7a01ccb10a0726eefdb Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Fri, 4 Dec 2020 11:52:59 +0800 Subject: [PATCH] Update README.md Adapt to the latest changes in code. Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- README.md | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 2c8ac76..a2a0ed0 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Please refer to [the QWidget example](/examples/QWidget/main.cpp) for more detai QMainWindow *mainWindow = new QMainWindow; // Qt's internal function. Make sure it's a top level window. mainWindow->createWinId(); -const QWindow *win = mainWindow->windowHandle(); +QWindow *win = mainWindow->windowHandle(); // Disable resizing of the given window. Resizing is enabled by default. FramelessWindowsManager::setResizable(win, false); // All the following values should not be DPI-aware, just use the @@ -77,22 +77,11 @@ FramelessWindowsManager::setResizable(win, false); // them yourself, this code will do the scaling according to DPI // internally and automatically. // Maximum window size -FramelessWindowsManager::setMaximumSize(win, {1280, 720}); +win->setMaximumSize(1280, 720); // Minimum window size -FramelessWindowsManager::setMinimumSize(win, {800, 540}); -// How to set ignore areas: -// The geometry of something you already know, in window coordinates -FramelessWindowsManager::addIgnoreArea(win, {100, 0, 30, 30}); -// The geometry of a widget, in window coordinates. -// It won't update automatically when the geometry of that widget has -// changed, so if you want to add a widget, which is in a layout and -// it's geometry will possibly change, to the ignore list, try the -// next method (addIgnoreObject) instead. -FramelessWindowsManager::addIgnoreArea(win, pushButton_close.geometry()); +win->setMinimumSize(800, 540); // The **POINTER** of a QWidget or QQuickItem FramelessWindowsManager::addIgnoreObject(win, ui->pushButton_minimize); -// Move a QWidget or QWindow to the center of its current desktop. -FramelessWindowsManager::moveWindowToDesktopCenter(win); ``` ## Supported Platforms