Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

design problem



  • Hello
    i had a weird problem in the style when i use this

            QFile styleFile( ":/style/style/style.qss" );
            styleFile.open( QFile::ReadOnly );
            QString style(styleFile.readAll());
            qApp->setStyleSheet(style); // Apply the loaded stylesheet
    

    it applies the style on :/style/style/style.qss
    but when i use a custom style for a form it forces the software to use style.qss instead of the custom style in this form


  • Lifetime Qt Champion

    Hi and welcome to the forums
    Tried fast with
    QApplication a(argc, argv);
    a.setStyleSheet("background-color: rgb(0, 255, 127);");

    and in MainWindow constructor
    setStyleSheet("background-color: rgb(0, 0, 0);");

    and that works as expected.

    This is on win 10, Qt 5.12

    I think we need more info to help you :)


Log in to reply