更新代码

This commit is contained in:
feiyangqingyun
2023-01-30 11:41:50 +08:00
parent 890c06d443
commit d35ca11ee2
30 changed files with 85 additions and 68 deletions

View File

@@ -319,7 +319,7 @@ bool FramelessDialog::nativeEvent(const QByteArray &eventType, void *message, lo
}
//识别标题栏拖动产生半屏全屏效果
if (titleBar != 0 && titleBar->rect().contains(pos)) {
if (titleBar && titleBar->rect().contains(pos)) {
QWidget *child = titleBar->childAt(pos);
if (!child) {
*result = HTCAPTION;

View File

@@ -319,7 +319,7 @@ bool FramelessMainWindow::nativeEvent(const QByteArray &eventType, void *message
}
//识别标题栏拖动产生半屏全屏效果
if (titleBar != 0 && titleBar->rect().contains(pos)) {
if (titleBar && titleBar->rect().contains(pos)) {
QWidget *child = titleBar->childAt(pos);
if (!child) {
*result = HTCAPTION;

View File

@@ -319,7 +319,7 @@ bool FramelessWidget::nativeEvent(const QByteArray &eventType, void *message, lo
}
//识别标题栏拖动产生半屏全屏效果
if (titleBar != 0 && titleBar->rect().contains(pos)) {
if (titleBar && titleBar->rect().contains(pos)) {
QWidget *child = titleBar->childAt(pos);
if (!child) {
*result = HTCAPTION;

View File

@@ -26,7 +26,7 @@ FramelessWidget2::FramelessWidget2(QObject *parent) : QObject(parent)
bool FramelessWidget2::eventFilter(QObject *watched, QEvent *event)
{
if (widget != 0 && watched == widget) {
if (widget && watched == widget) {
if (event->type() == QEvent::WindowStateChange) {
//解决mac系统上无边框最小化失效的bug
#ifdef Q_OS_MACOS