Untitled

 avatar
unknown
python
4 years ago
1.8 kB
4
Indexable
import abjad
import os
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (
	QApplication, 
	QDialog, 
	QGridLayout, 
	QGroupBox, 
	QHBoxLayout, 
	QLabel, 
	QLineEdit,
	QPushButton,
	QVBoxLayout
)



class Window(QDialog):

	def __init__(self, parent=None):
		super(Window, self).__init__(parent)

		groupBox1 = QGroupBox('Group 1')
		groupBox1.setCheckable(False)
		groupBox1.setChecked(False)

		imageLabel = QLabel()
		pixmap = QPixmap('test.jpg')
		imageLabel.setPixmap(pixmap)

		layout = QVBoxLayout()
		layout.addWidget(imageLabel)
		layout.addStretch(1)
		groupBox1.setLayout(layout)

		groupBox2 = QGroupBox('Group 2')
		groupBox2.setCheckable(False)
		groupBox2.setChecked(False)

		debugLabel = QLabel()
		lineEdit = QLineEdit('s3cRe7')
		lineEdit.textChanged[str].connect(self.onLineEditTextChanged)
		drawButton = QPushButton('Draw')
		drawButton.clicked.connect(self.onDrawButtonClicked)

		layout = QVBoxLayout()
		layout.addWidget(debugLabel)
		layout.addWidget(lineEdit)
		layout.addWidget(drawButton)
		layout.addStretch(1)
		groupBox2.setLayout(layout)

		main_layout = QGridLayout()
		main_layout.addWidget(groupBox1, 0, 0, 1, 2)
		main_layout.addWidget(groupBox2, 1, 0, 1, 2)
		self.setLayout(main_layout)
		self.setWindowTitle("BlackMetalPro 1.0")

	def onLineEditTextChanged(self, text):
		print(text)

	def onDrawButtonClicked(self):
		print('clicked')
		string = "c'16 f' g' a' d' g' a' b' e' a' b' c'' f' b' c'' d''16"
		voice_1 = abjad.Voice(string, name="Voice_1")
		staff_1 = abjad.Staff([voice_1], name="Staff_1")
		abjad.show(staff_1, output_directory=os.getcwd(), should_open=False)

app = QApplication(sys.argv)

window = Window()
window.show()

sys.exit(app.exec())
Editor is loading...