Changing Contents when Slecting other widgets
Moved
Unsolved
Qt for Python
-
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
import sysdef foo():
app = QApplication(sys.argv)
window = QWidget()
window.setStyleSheet("""
background-color: green;
""")
btn1 = QPushButton('My_Button', window)
btn1.setStyleSheet("""
QPushButton{
background-color:yellow;
}
""")
btn1.setGeometry(25,25,50,50)
window.resize(100,100)
window.show()
sys.exit(app.exec())
if name == "main":
foo()If i press tab the My_Button is selected, so what i want is when i select a widget it changes content(here QWidget,background) of other widgets