Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Why we can't load large size file from file dialog and display data of file on textArea in qml?

Why we can't load large size file from file dialog and display data of file on textArea in qml?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 482 Views 2 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.
  • T Offline
    T Offline
    Tejas P
    wrote on last edited by Tejas P
    #1

    I am trying to browse a file through FileDialog and display the content of file into TextArea of qml integrate with python. It works properly with small size file, but TextArea as well as app getting stuck when we browse a large size file. so, How to load large size file from FileDialog and update text of TextArea with data of file in qml?

    FileDialog {
       id: fileDialog
       visible: visible
       onAccepted: {
         setOption(DontUseNativeDialogs, true)
         console.log("Accepted: " + fileUrl)
         fileTextArea.text = fileDialog.fileUrl
         fileIoObject.source = fileUrl
         fileIoObject.read()
         }
    }
    TextArea {
      id: jsonTextArea
      text: fileIoObject.jsonString
    }
    
    I expect the solution, how to load large size file from FileDialog and update text of TextArea with data of file in qml.
    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      How big is the file?

      Do you need the text to be editable or read only? If the latter, you can use Text element.

      Does your file contain any rich text? If not, then set your component to parse and displaye in PlainText mode, it will save a lot of time.

      (Z(:^

      T 1 Reply Last reply
      2
      • sierdzioS sierdzio

        How big is the file?

        Do you need the text to be editable or read only? If the latter, you can use Text element.

        Does your file contain any rich text? If not, then set your component to parse and displaye in PlainText mode, it will save a lot of time.

        T Offline
        T Offline
        Tejas P
        wrote on last edited by
        #3

        hi @sierdzio ,
        My file is more than 15MB.
        yes I want, Text to be editable.
        No, my file not contain any rich text so, i will try your suggestion.

        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