From 9fc3c91388ae6f139813fbf700efc261b430b1d6 Mon Sep 17 00:00:00 2001 From: SineStriker <55847490+SineStriker@users.noreply.github.com> Date: 周一, 11 12月 2023 14:58:06 +0800 Subject: [PATCH] Merge pull request #1 from stdware/qml --- examples/mainwindow/mainwindow.cpp | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/mainwindow/mainwindow.cpp b/examples/mainwindow/mainwindow.cpp index 65c4b12..e0c7151 100644 --- a/examples/mainwindow/mainwindow.cpp +++ b/examples/mainwindow/mainwindow.cpp @@ -32,8 +32,7 @@ void MainWindow::installWindowAgent() { auto agent = new QWK::WidgetWindowAgent(this); if (!agent->setup(this)) { - qDebug() << "Frameless handle failed to initialize."; - return; + qFatal("Frameless handle failed to initialize."); } auto titleLabel = new QLabel(); @@ -55,10 +54,18 @@ }(); auto iconButton = new QPushButton("I"); + iconButton->setAttribute(Qt::WA_Hover); + iconButton->setMouseTracking(true); auto minButton = new QPushButton("鈥�"); + minButton->setAttribute(Qt::WA_Hover); + minButton->setMouseTracking(true); auto maxButton = new QPushButton("馃棖"); maxButton->setCheckable(true); + maxButton->setAttribute(Qt::WA_Hover); + maxButton->setMouseTracking(true); auto closeButton = new QPushButton("鉁�"); + closeButton->setAttribute(Qt::WA_Hover); + closeButton->setMouseTracking(true); auto windowBar = new QWK::WindowBar(); windowBar->setIconButton(iconButton); @@ -92,5 +99,6 @@ setMenuWidget(windowBar); setCentralWidget(clockWidget); setWindowTitle("Example MainWindow"); - resize(1024, 768); + // setContentsMargins({0, 1, 0, 0}); + resize(640, 480); } -- Gitblit v1.9.1