Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Get data from text file and send to text entry field
Forum Updated to NodeBB v4.3 + New Features

Get data from text file and send to text entry field

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 664 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.
  • J Offline
    J Offline
    JacobNovitsky
    wrote on last edited by
    #1

    Is there something within Qt tools?

    JonBJ 1 Reply Last reply
    0
    • J JacobNovitsky

      Is there something within Qt tools?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @JacobNovitsky
      What would there be in "tools"? Assuming you mean you want this behaviour in code, just read some text from a text file and set it in whatever widget.

      J 1 Reply Last reply
      0
      • JonBJ JonB

        @JacobNovitsky
        What would there be in "tools"? Assuming you mean you want this behaviour in code, just read some text from a text file and set it in whatever widget.

        J Offline
        J Offline
        JacobNovitsky
        wrote on last edited by JacobNovitsky
        #3

        @JonB how to do so?

        I'm making AutoHotKey analog, when I press lets say ctrl + T, I want to send some text from file to field (webrowser text field, command line text field, or word document text field)

        JonBJ 1 Reply Last reply
        0
        • J JacobNovitsky

          @JonB how to do so?

          I'm making AutoHotKey analog, when I press lets say ctrl + T, I want to send some text from file to field (webrowser text field, command line text field, or word document text field)

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @JacobNovitsky
          QByteArray QIODevice::readLine(qint64 maxSize = 0) on a QFile, or other read().

          void QTextEdit::setPlainText(const QString &text) or whatever.

          J 1 Reply Last reply
          1
          • JonBJ JonB

            @JacobNovitsky
            QByteArray QIODevice::readLine(qint64 maxSize = 0) on a QFile, or other read().

            void QTextEdit::setPlainText(const QString &text) or whatever.

            J Offline
            J Offline
            JacobNovitsky
            wrote on last edited by JacobNovitsky
            #5

            @JonB oh, sure, I know QFile :) I need to get data from that string and PASTE somewhere (in MS Word document)
            upd:
            setPlainText seem to be that solution, I am right?

            JonBJ 1 Reply Last reply
            0
            • J JacobNovitsky

              @JonB oh, sure, I know QFile :) I need to get data from that string and PASTE somewhere (in MS Word document)
              upd:
              setPlainText seem to be that solution, I am right?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @JacobNovitsky
              All you wrote initially was title of

              Get data from text file and send to text entry field

              Do you think other people would know from that you are asking about pasting into a Word document? :)

              PASTE somewhere (in MS Word document)

              Do you mean paste into a running Word instance? That has nothing to do with a Qt widget....

              If you want to paste into external programs under Windows that has little to do with Qt. Maybe you can ask for paste at Windows text cursor position in any application, but I wouldn't have thought so. I don't know how AutoHotKey does whatever it does.

              J 1 Reply Last reply
              1
              • JonBJ JonB

                @JacobNovitsky
                All you wrote initially was title of

                Get data from text file and send to text entry field

                Do you think other people would know from that you are asking about pasting into a Word document? :)

                PASTE somewhere (in MS Word document)

                Do you mean paste into a running Word instance? That has nothing to do with a Qt widget....

                If you want to paste into external programs under Windows that has little to do with Qt. Maybe you can ask for paste at Windows text cursor position in any application, but I wouldn't have thought so. I don't know how AutoHotKey does whatever it does.

                J Offline
                J Offline
                JacobNovitsky
                wrote on last edited by JacobNovitsky
                #7

                What I want to accomplish:
                [0] I set cursor to web browser or sublime text editor or forum text form
                [1] I press Ctrl+T
                [2] call some function which gets QWindow or QWidget
                [3] choose between lines 1-10 -> choose line 3
                [4] it gets line 3 containt from text file

                then, line 4 contains must be PASTED In any application where you can possibly write or paste text (has cursor)

                So it proceeds PASTE (Ctrl V) but you did not really used Ctrl+C before
                It copies from my text file which holds needed text

                https://www.maketecheasier.com/assets/uploads/2020/11/Text-Expansion-QuickTextPaste-Success.jpg

                JonBJ 1 Reply Last reply
                0
                • J JacobNovitsky

                  What I want to accomplish:
                  [0] I set cursor to web browser or sublime text editor or forum text form
                  [1] I press Ctrl+T
                  [2] call some function which gets QWindow or QWidget
                  [3] choose between lines 1-10 -> choose line 3
                  [4] it gets line 3 containt from text file

                  then, line 4 contains must be PASTED In any application where you can possibly write or paste text (has cursor)

                  So it proceeds PASTE (Ctrl V) but you did not really used Ctrl+C before
                  It copies from my text file which holds needed text

                  https://www.maketecheasier.com/assets/uploads/2020/11/Text-Expansion-QuickTextPaste-Success.jpg

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @JacobNovitsky said in Get data from text file and send to text entry field:

                  So it proceeds PASTE (Ctrl V) but you did not really used Ctrl+C before

                  Have you looked at QClipboard Class ?

                  The clipboard offers a simple mechanism to copy and paste data between applications.

                  1 Reply Last reply
                  1

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved