Skip to content

Commit

Permalink
add a pure qt standalone demo
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesdelbeke committed Jan 31, 2023
1 parent 7d67fea commit 04b3ad0
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions samples/qt_sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""
a pure qt demo
"""

import unimenu.dccs.qt
from PySide2 import QtWidgets

data = {
'items':
[
{
'items':
[
{
'command': 'print("hello 1")',
'label': 'tool1'
},
{
'command': 'print("hello 2")',
'label': 'tool2'
}
],
'label': 'Tools'
}
]
}

# create placeholder qt window
app = QtWidgets.QApplication([])
window = QtWidgets.QMainWindow()
menu = window.menuBar()

# setup tools menu from config
unimenu.dccs.qt.QtMenuMaker.setup_menu(data, parent=menu)

window.show()
app.exec_()

0 comments on commit 04b3ad0

Please sign in to comment.