Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Path filename
Forum Update on Monday, May 27th 2025

Path filename

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 188 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.
  • E Offline
    E Offline
    Eternus
    wrote on last edited by
    #1

    I need load a image I have this:
    "/Users/macbook/Documents/Projekty_programovanie/QT_APPS/Test/images/yt.png"

    but I want only "/image/yt.png"

    JonBJ 1 Reply Last reply
    0
    • E Eternus

      I need load a image I have this:
      "/Users/macbook/Documents/Projekty_programovanie/QT_APPS/Test/images/yt.png"

      but I want only "/image/yt.png"

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Eternus
      Are you sure you want /image/yt.png? It's possible, but more likely you'll want image/yt.png?

      In any case, there is QString::split() to split a string into a list on a character, or there is QFileInfo/QDir which you can use in combination to parse the path properly and pick up the segments you want. Even simpler may be QDir::relativeFilePath()....

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Eternus
        wrote on last edited by Eternus
        #3

        @JonB

        thanks for reply this is image/yt.png way...
        I want because If I move somewhere without computer I want can be worked on another computer

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Is it a sub-folder beside your application executable ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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