N
N
Nikita31642020-11-18 20:20:14
PyQt
Nikita3164, 2020-11-18 20:20:14

Why doesn't PyQT5 widget style change?

I work with Python and SQLite code. The style for the widget should be unloaded from the database and put on the widget, but this does not happen. The style is unloaded correctly, so the problem is not with the database. Is there any way to fix this?

def unload(self):
    cur = self.con.cursor()
    rezult = cur.execute('''SELECT DISTINCT Название, label, Текст, Статус, LCD, Время, kol, kol_1, kol_2 FROM Задачи
                            WHERE Дата LIKE ?''', (str(self.date),))
    rows = cur.fetchall()
    for row in rows:
        exec('{}.setStyleSheet('.format(row[0]) + '"""{}""")'.format(row[3]))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question