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. Case sensitive pathname in WIndows

Case sensitive pathname in WIndows

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 2.4k Views 1 Watching
  • 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
    erik kruyt
    wrote on last edited by
    #1

    How can I get the case sensitive pathname of a file in Windows?
    If I use QFileInfo.filePath I get the uppercase notation only.

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

      Hi,

      What is the input you are giving to QFileInfo ?

      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
      • E Offline
        E Offline
        erik kruyt
        wrote on last edited by
        #3

        Due to vacation just now!

        I create a QFileInfo object from a filename supplied by the user.

            QFileInfo fi(getFilename(FileKind::Source,i));
        

        I like to have fi.baseName() with the actual case as in the Windows explorer. This filename is used to generate a make file. Make from Mingw is case senstitive.

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

          Can you show the code where you ask the file from the user ?

          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
          • E Offline
            E Offline
            erik kruyt
            wrote on last edited by
            #5

            The getFilename method extracts the filename from a tree with project files.
            To much code to show. The case of the filenames in the tree does not always match the case of the actual filenames.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MuldeR
              wrote on last edited by
              #6

              Have you tried QFileInfo::canonicalFilePath() ???

              My OpenSource software at: http://muldersoft.com/

              Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

              Go visit the coop: http://youtu.be/Jay...

              1 Reply Last reply
              0
              • E Offline
                E Offline
                erik kruyt
                wrote on last edited by
                #7

                Yes I tried. That does not get the actual case of the path either.

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

                  What version of Windows and Qt are you using ?

                  Can you show an example of original file path and Qt output ?

                  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