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. Android QFileDialog returns nothing and code in background keeps running
Forum Update on Monday, May 27th 2025

Android QFileDialog returns nothing and code in background keeps running

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 669 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.
  • T Offline
    T Offline
    thorsten2102
    wrote on last edited by thorsten2102
    #1

    Hey, i'm trying to open a file on my phone
    "/storage/emulated/0/Download/testfile.txt"

    auto filename = QFileDialog::getOpenFileName(this, "choose file to encode to Base64");
    

    when i debug through the app (which is running on my phone) my standard filedialog opens

    alt text

    while the filedialog is open, it instantly returns an empty string and the code proceeds running, while the filedialog is still open.
    when i choose a file or just close the filedialog the app immediately crashes.

    when i hardcode a path the file is opended as expected

    QString filename = "/storage/emulated/0/Download/testfile.txt";
    

    some people meant that one should write his own filedialog.

    i tried this on Android 8.0 and 9.0

    I still would like to use the standard filedialog, how can i get the correct path + make the code execution stop until i have chosen a file?

    Edit: i'm using QWidgets

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mvuori
      wrote on last edited by mvuori
      #2

      I tried the native dialog in Qt 13.0 and had the same problem. I think it is likely that it just doesn¨t work.

      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