Important: Please read the Qt Code of Conduct -

Stylesheet using a network paste.

  • Hi, i am triyng change a style sheet of one widget mine. After 2 seconds a background image have to change. The images is in a network paste, but they don't change. Somebody can help me?

    @ QString path = "\\\conciliacao\Monitor\Imagens";
    QDir imagens;
    imagens.setFilter(QDir::Files | QDir::NoDotAndDotDot);
    for(int y = 0; y < imagens.entryList().size(); y++){
    QString astyle = "background-image: url(" + path + imagens.entryList().at(y) + ");";

  • Hi,

    this line
    @QString + imagens.entryList().at(y) + ");";@

    looks strange. I think you should mend it first=)

  • haha the Qt project dont let my variable show(the name was just "style").

  • indeed my problem is that i want use a image that was not include in resource, can i do that?

  • Moderators

    Make sure the path is OK. Print it after adding to the QDir. Also, consider using one of QUrl static methods.

    QDir expects paths given in Unix notation (forward slash as separator).

Log in to reply