Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-48037

Qt.openUrlExternally works different ways on Windows and Linux

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.5.0
    • None
    • Windows 7, Kubuntu

      For opening file or directory I should use prefix "file://" on Linux system, while on Windows that will not work. However, specifying path without prefix "file://" will work fine.

      QML samples below.

      Windows

      Qt.openUrlExternally('C:/1.jpg');
      Qt.openUrlExternally('C:/mydir');
      

      Linux

      Qt.openUrlExternally('file:///home/user/1.jpg');
      Qt.openUrlExternally('file:///home/user');
      

      Again: windows code snipped will NOT work on Linux, and vice versa. It's not convenient for cross-platform development.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            danclax danclax
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes