-1

I have a problem with changing the color of the background of my tabWidget into the same color as MainWindow. I have tried fiddling with palletes, but it didn't change anything. I want to change the white area to be gray.

tabView and Mainwindow

Kestrel
  • 29
  • 5

1 Answers1

0

Use css in qrc file.

for example in css file:

QWidget
{
    background-color: #111a22;
    color: #ffffff;
}

QMainWindow:hover
{
   ...etc
}

QListWidget::item:selected
{
    border: 1.2px;
    border-color: #562956;
    border-style: outset;
    border-radius: 1px;
}

QPushButton
{
    border: 1.2px;
    border-color: #562956;
    border-style: outset;
    border-radius: 2px;
    height: 15%;
}

for load in main.cpp

QFile *file = new QFile(":/style.css");
    file->QIODevice::open(QFile::ReadOnly);
    a.QApplication::setStyleSheet(file->QIODevice::readAll());

look at this: https://doc.qt.io/qt-5/stylesheet-reference.html

bogdyname
  • 358
  • 2
  • 10