Minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
c29c4cc409
commit
151e8a1664
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
|
||||||
// High DPI scaling is enabled by default from Qt 6
|
// High DPI scaling is enabled by default from Qt 6
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
// Windows: we are using the manifest file to get maximum compatibility
|
// Windows: we are using the manifest file to get maximum compatibility
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags)
|
MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags)
|
||||||
{
|
{
|
||||||
|
setAttribute(Qt::WA_DontCreateNativeAncestors);
|
||||||
|
createWinId();
|
||||||
|
|
||||||
appMainWindow = new Ui::MainWindow;
|
appMainWindow = new Ui::MainWindow;
|
||||||
appMainWindow->setupUi(this);
|
appMainWindow->setupUi(this);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
|
||||||
// High DPI scaling is enabled by default from Qt 6
|
// High DPI scaling is enabled by default from Qt 6
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
// Windows: we are using the manifest file to get maximum compatibility
|
// Windows: we are using the manifest file to get maximum compatibility
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
|
||||||
// High DPI scaling is enabled by default from Qt 6
|
// High DPI scaling is enabled by default from Qt 6
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||||
// Windows: we are using the manifest file to get maximum compatibility
|
// Windows: we are using the manifest file to get maximum compatibility
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
Widget::Widget(QWidget *parent) : QWidget(parent)
|
Widget::Widget(QWidget *parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
|
setAttribute(Qt::WA_DontCreateNativeAncestors);
|
||||||
createWinId();
|
createWinId();
|
||||||
setupUi();
|
setupUi();
|
||||||
startTimer(500);
|
startTimer(500);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||||
<assemblyIdentity type="win32" name="com.wangwenx190.framelessapplication" version="1.0.0.0"/>
|
<assemblyIdentity type="win32" name="org.wangwenx190.framelessapplication" version="1.0.0.0"/>
|
||||||
<dependency>
|
<dependency>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
|
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "framelesswindowsmanager.h"
|
#include "framelesswindowsmanager.h"
|
||||||
#include <QtCore/qvariant.h>
|
#include <QtCore/qvariant.h>
|
||||||
#include <QtCore/qdebug.h>
|
#include <QtCore/qdebug.h>
|
||||||
|
#include <QtCore/qcoreapplication.h>
|
||||||
#include <QtGui/qwindow.h>
|
#include <QtGui/qwindow.h>
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
#ifdef FRAMELESSHELPER_USE_UNIX_VERSION
|
#ifdef FRAMELESSHELPER_USE_UNIX_VERSION
|
||||||
|
@ -44,6 +45,9 @@ void FramelessWindowsManager::addWindow(QWindow *window)
|
||||||
if (!window) {
|
if (!window) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!QCoreApplication::testAttribute(Qt::AA_DontCreateNativeWidgetSiblings)) {
|
||||||
|
QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
|
||||||
|
}
|
||||||
#ifdef FRAMELESSHELPER_USE_UNIX_VERSION
|
#ifdef FRAMELESSHELPER_USE_UNIX_VERSION
|
||||||
framelessHelperUnix()->removeWindowFrame(window);
|
framelessHelperUnix()->removeWindowFrame(window);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue