Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. WinRT Filepicker and CX
Forum Update on Monday, May 27th 2025

WinRT Filepicker and CX

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
winrt filepickewindows phone 8qt5.7.0
4 Posts 3 Posters 1.4k 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.
  • M Offline
    M Offline
    max.mustermann
    wrote on last edited by max.mustermann
    #1

    Hello,

    I am writing a mobile application(using QT5.7 with VC2015) for WP8.1/Android/iOS, and I would need to have a FilePicker/FileDialog.

    For that I tried to use the example code from Microsoft:

    FileOpenPicker^ openPicker = ref new FileOpenPicker();
    openPicker->ViewMode = PickerViewMode::Thumbnail;
    openPicker->SuggestedStartLocation = PickerLocationId::PicturesLibrary;
    openPicker->FileTypeFilter->Append(".jpg");
    openPicker->FileTypeFilter->Append(".jpeg");
    openPicker->FileTypeFilter->Append(".png");
    
    openPicker->PickSingleFileAndContinue();
    

    but when I run the application, I get the following Exception:

    The application called an interface that was marshalled for a different thread.
    WinRT information: The application called an interface that was marshalled for a different thread.
    

    And also I don't know how to get the result, use the CX async stuff together with QT

    Thanks

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by hskoglund
      #2

      Hi, maybe this Stackoverflow link will help

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mkalinow
        wrote on last edited by
        #3

        As soon as you see this error message:
        "
        The application called an interface that was marshalled for a different thread.
        WinRT information: The application called an interface that was marshalled for a different thread.
        "
        It implies that the call itself has to be called from the Xaml Thread. Basically anything which does something visually will need to execute there.

        Out of curiosity, why are you not using QFileDialog? In any case you can see its implementation (also how to invoke things on the xaml thread) here:
        http://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp#n245

        1 Reply Last reply
        0
        • M Offline
          M Offline
          max.mustermann
          wrote on last edited by
          #4

          First of all sorry for my very late reply, totally forgot about this forum.

          I tried to use the QFileDialog from QtWidgets with my QtQuick application, but when closing the filepicker the app stays frozen .
          Actually I have similar problems with all the CX async stuff, not calling the callback function.

          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