FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnetLab/Test/TestPyQt.cs at master · harperjohnarc/pythonnetLab · GitHub
harperjohnarc
pythonnetLab
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnetLab
/
Test
/
TestPyQt.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
67 lines (63 loc) · 2.04 KB
Breadcrumbs
pythonnetLab
/
Test
/
TestPyQt.cs
Copy path
File metadata and controls
67 lines (63 loc) · 2.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using
Python
.
Runtime
;
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
Linq
;
using
System
.
Text
;
namespace
Test
{
class
TestPyQt
{
public
static
void
PyQt4PurePython
(
)
{
using
(
Py
.
GIL
(
)
)
{
PythonEngine
.
Exec
(
"import sys
\n
"
+
"from PyQt4.QtGui import QApplication, QWidget
\n
"
+
"app = QApplication(sys.argv)
\n
"
+
"w = QWidget()
\n
"
+
"w.resize(400, 300)
\n
"
+
"w.move(400, 400)
\n
"
+
"w.setWindowTitle('basic')
\n
"
+
"w.show()
\n
"
+
"app.exec_()
\n
"
+
"# sys.exit(app.exec_())
\n
"
)
;
}
}
public
static
void
PyQt5PurePython
(
)
{
using
(
Py
.
GIL
(
)
)
{
PythonEngine
.
Exec
(
"import sys
\n
"
+
"from PyQt5.QtWidgets import QApplication, QWidget
\n
"
+
"app = QApplication(sys.argv)
\n
"
+
"w = QWidget()
\n
"
+
"w.resize(400, 300)
\n
"
+
"w.move(400, 400)
\n
"
+
"w.setWindowTitle('hello pyqt5 from CLR')
\n
"
+
"w.show()
\n
"
+
"app.exec_()
\n
"
)
;
}
}
public
static
void
PyQt5
(
)
{
using
(
Py
.
GIL
(
)
)
{
var
scope
=
Py
.
CreateScope
(
)
;
var
sys
=
scope
.
Import
(
"sys"
)
;
var
QApplication
=
scope
.
Import
(
"PyQt5.QtWidgets.QApplication"
,
"QApplication"
)
;
var
QWidget
=
scope
.
Import
(
"PyQt5.QtWidgets.QApplication"
,
"QWidget"
)
;
var
app
=
QApplication
(
sys
.
argv
)
;
var
w
=
QWidget
(
)
;
w
.
resize
(
400
,
300
)
;
w
.
move
(
400
,
400
)
;
w
.
setWindowTitle
(
"hello pyqt5 from CLR"
)
;
w
.
show
(
)
;
app
.
exec_
(
)
;
}
}
}
}
Back
|
FazBrowse Home
|
New Git URL