mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 19:44:59 +00:00
chore: update framelesshelper
This commit is contained in:
parent
2d81950e3f
commit
d33e8a7eff
3 changed files with 38 additions and 6 deletions
|
@ -11,7 +11,6 @@
|
|||
#include "dialog.h"
|
||||
#include "mousetap/mousetap.h"
|
||||
#include "stream.h"
|
||||
#include "windownativeeventfilter.h"
|
||||
#include "windowframelesshelper.h"
|
||||
|
||||
static Dialog *g_mainDlg = Q_NULLPTR;
|
||||
|
@ -80,10 +79,6 @@ int main(int argc, char *argv[])
|
|||
|
||||
QQmlApplicationEngine engine("qrc:/MainWindow.qml");
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
WindowNativeEventFilter::Instance()->Init();
|
||||
#endif
|
||||
|
||||
// windows下通过qmake VERSION变量或者rc设置版本号和应用名称后,这里可以直接拿到
|
||||
// mac下拿到的是CFBundleVersion的值
|
||||
qDebug() << app.applicationVersion();
|
||||
|
|
|
@ -10,5 +10,16 @@ HEADERS += \
|
|||
SOURCES += \
|
||||
$$PWD/keepratiowidget.cpp \
|
||||
$$PWD/magneticwidget.cpp \
|
||||
$$PWD/windowframelesshelper.mm \
|
||||
$$PWD/windownativeeventfilter.cpp
|
||||
|
||||
win32 {
|
||||
SOURCES += $$PWD/windowframelesshelper.cpp
|
||||
}
|
||||
|
||||
mac {
|
||||
SOURCES += $$PWD/windowframelesshelper.mm
|
||||
}
|
||||
|
||||
linux {
|
||||
SOURCES += $$PWD/windowframelesshelper.cpp
|
||||
}
|
||||
|
|
26
QtScrcpy/uibase/windowframelesshelper.cpp
Normal file
26
QtScrcpy/uibase/windowframelesshelper.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "windowframelesshelper.h"
|
||||
#include "windownativeeventfilter.h"
|
||||
|
||||
WindowFramelessHelper::WindowFramelessHelper(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QQuickWindow *WindowFramelessHelper::target() const
|
||||
{
|
||||
return m_target;
|
||||
}
|
||||
|
||||
void WindowFramelessHelper::setTarget(QQuickWindow *target)
|
||||
{
|
||||
if (target == m_target) {
|
||||
return;
|
||||
}
|
||||
m_target = target;
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
WindowNativeEventFilter::Instance()->Init();
|
||||
#endif
|
||||
|
||||
emit targetChanged();
|
||||
}
|
Loading…
Add table
Reference in a new issue