normal bir ana pencereye pixmap aracılığıyla image eklemek çok basit.
Fakat h_box ve v_box kullanılan yerlere asla resim ekleyemedim.
Bir Müzik oynatıcısı yaptım. Arkaplan rengi ve butonlarını ayarladım (renkler).
Son olarak arkaplanın üzerine küçük küçük nota işaretleri koymak istedim.
Ancak nasıl image ekleyebileceğimi bilmiyorum.
from PyQt5.QtWidgets import QMainWindow , QApplication , QLabel
import sys
import Music #qtdesigner
import simpleaudio as sa
from PyQt5.QtGui import QPixmap
class Pencere(QMainWindow, Music.Ui_muzikler):
def __init__(self):
super().__init__()
self.setupUi(self)
self.wave_obj1 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/Wav/Force.wav")
self.wave_obj2 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/Wav/Faded.wav")
self.wave_obj3 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/Wav/Live Fast.wav")
self.wave_obj4 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/Wav/Dream It Possible.wav")
self.wave_obj5 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/Wav/Nimet.wav")
self.wave_obj6 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/Wav/Frag Out.wav")
self.wave_obj7 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/Wav/Lost On You.wav")
self.wave_obj8 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/Wav/Hear A Fire.wav")
self.wave_obj9 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/Wav/Ya Lili.wav")
self.wave_obj10 = sa.WaveObject.from_wave_file("C:/Users/taylan öztürk/Desktop/NCS/Alan Walker/River Flows.wav")
self.pushButton_11.setStyleSheet("background : rgb(255, 51, 112);")
self.pushButton_2.setStyleSheet("background:rgb(153,120,152,255);")
self.pushButton_6.setStyleSheet("background:rgb(108,102,107,255);")
self.pushButton_9.setStyleSheet("background:rgb(153,120,152,255);")
self.pushButton_10.setStyleSheet("background:rgb(108,102,107,255);")
self.pushButton_8.setStyleSheet("background:rgb(153,120,152,255);")
self.pushButton_7.setStyleSheet("background:rgb(108,102,107,255);")
self.pushButton_5.setStyleSheet("background:rgb(153,120,152,255);")
self.pushButton_4.setStyleSheet("background:rgb(108,102,107,255);")
self.pushButton_3.setStyleSheet("background:rgb(153,120,152,255);")
self.pushButton.setStyleSheet("background:rgb(108,102,107,255);")
self.setStyleSheet("background-color: black")
labelimage = QLabel(self)
pixmap = QPixmap("kartal.jpg")
labelimage.setPixmap(pixmap)
labelimage.move(0,0)
#self.pushButton_x.setStyleSheet("background: rgb(153,120,152,255")
#self.*pushButton_x*.setStyleSheet("background: rgb(108,102,107,255)")
self.pushButton.clicked.connect(self.click1)
self.pushButton_2.clicked.connect(self.click2)
self.pushButton_3.clicked.connect(self.click3)
self.pushButton_4.clicked.connect(self.click4)
self.pushButton_5.clicked.connect(self.click5)
self.pushButton_6.clicked.connect(self.click6)
self.pushButton_7.clicked.connect(self.click7)
self.pushButton_8.clicked.connect(self.click8)
self.pushButton_9.clicked.connect(self.click9)
self.pushButton_10.clicked.connect(self.click10)
self.pushButton_11.clicked.connect(self.click11) #stopbutton
def click1(self):
self.wave_obj10.play()
def click2(self):
self.wave_obj1.play()
def click3(self):
self.wave_obj9.play()
def click4(self):
self.wave_obj8.play()
def click5(self):
self.wave_obj7.play()
def click6(self):
self.wave_obj2.play()
def click7(self):
self.wave_obj6.play()
def click8(self):
self.wave_obj5.play()
def click9(self):
self.wave_obj3.play()
def click10(self):
self.wave_obj4.play()
def click11(self):
sa.stop_all()
app = QApplication(sys.argv)
pencere = Pencere()
pencere.setWindowTitle("Music Player")
pencere.show()
sys.exit(app.exec_())
kodlar bu şekilde.
html ile position absolute yapar gibi nasıl image ekleyebilirim ?