blob: bcdc30d0fae8bd5594dd7472f6f226c1efe3417c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
//===========================================
// Lumina-DE source code
// Copyright (c) 2017, Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
#include "NativeWindow.h"
// === PUBLIC ===
NativeWindow::NativeWindow(WId id) : QObject(){
winid = id;
WIN = QWindow::fromWinId(winid);
}
NativeWindow::~NativeWindow(){
hash.clear();
//WIN->deleteLater(); //This class only deals with Native windows which were created outside the app - they need to be cleaned up outside the app too
}
WId NativeWindow::id(){
return winid;
}
QWindow* NativeWindow::window(){
return WIN;
}
QVariant NativeWindow::property(NativeWindow::Property prop){
if(hash.contains(prop)){ return hash.value(prop); }
return QVariant(); //null variant
}
void NativeWindow::setProperty(NativeWindow::Property prop, QVariant val){
if(prop == NativeWindow::None){ return; }
hash.insert(prop, val);
emit PropertyChanged(prop, val);
}
void NativeWindow::requestProperty(NativeWindow::Property prop, QVariant val){
if(prop == NativeWindow::None){ return; }
emit RequestPropertyChange(winid, prop, val);
}
|