QPalette palette; palette.setColor(QPalette::Button, QColor(0xFF, 0xFF, 0x00)); button->setPalette(palette);
QPalette palette; palette.setColor(QPalette::Window, Qt::black); palette.setColor(QPalette::WindowText, Qt::green); textEdit->setPalette(palette);This code creates a QPalette object and sets the background color to black and the text color to green for a textEdit widget. The package library for this code is most likely the Qt GUI library.