Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Stylesheet using a network paste.
QtWS25 Last Chance

Stylesheet using a network paste.

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 3 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    felipe.c.sousa
    wrote on last edited by
    #1

    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 = "\\192.168.6.33\conciliacao\Monitor\Imagens";
    QDir imagens;
    imagens.setPath(path);
    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) + ");";
    ui->widgetImagens->setStyleSheet(astyle);
    Sleep(2000);
    }@

    From all, to all.

    1 Reply Last reply
    0
    • _ Offline
      _ Offline
      _rmn
      wrote on last edited by
      #2

      Hi,

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

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

      1 Reply Last reply
      0
      • F Offline
        F Offline
        felipe.c.sousa
        wrote on last edited by
        #3

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

        From all, to all.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          felipe.c.sousa
          wrote on last edited by
          #4

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

          From all, to all.

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            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).

            (Z(:^

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved