Skip to content
Snippets Groups Projects

Consistent path separators for Qt

Qt uses "/" as a path separator internally. From the QDir documentation:

Qt uses "/" as a universal directory separator in the same way that "/" is used as a path separator in URLs. If you always use "/" as a directory separator, Qt will translate your paths to conform to the underlying operating system.

QDir::separator() is provided as a helper to write and feed paths to native, non-Qt functions:

You do not need to use this function to build file paths. If you always use "/", Qt will translate your paths to conform to the underlying operating system. If you want to display paths to the user using their operating system's separator use toNativeSeparators().

Until now, we were using a mixture of QDir::separator() and "/" as path separators. Let's be consistent about it, follow the Qt documentation, and use "/" from now on.

Edited by Dimitri Papadopoulos Orfanos

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    Compare with previous version

  • added 18 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 2 commits

    • 03a33a84 - Consistent path separators for Qt
    • 563502fa - Use QString and Qt paths

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • resolved all threads

  • added 4 commits

    Compare with previous version

  • added 13 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • @mpaouris Would you agree to approve this merge request?

  • added 1 commit

    • 75e5517b - Fix errors found by reviewer

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading