ColinDuquesnoy / QDarkStyleSheet

A dark style sheet for QtWidgets application
Other
2.76k stars 725 forks source link

Qt5 C++:QCheckBox does not display checkbox #347

Open bigbang95 opened 4 months ago

bigbang95 commented 4 months ago

Describe Your Environment

[Versions from your environment]

Language

C++

What is the problem?

As shown in the following figure, for the light and dark theme, the QCheckBox control does not display the checkbox on the left square

normal: 2024-03-08_092150

problem: 2024-03-08_092246 2024-03-08_092333

QDarkStyle installation steps

  1. code:
    QFile f("qdarkstyle/light/lightstyle.qss");

    if (!f.exists()) {
        QMessageBox::warning(this, "", "Unable to set stylesheet, file not found\n");
    }
    else {
        f.open(QFile::ReadOnly | QFile::Text);
        QTextStream ts(&f);
        qApp->setStyleSheet(ts.readAll());
    }
  1. Copy qdarkstyle to the program root directory