Translations:Development/Tutorials/Saving and loading/47/pt-br: Difference between revisions

From KDE TechBase
(Created page with "Os dados que o <tt>storedGet()</tt> baixou com sucesso, neste caso o conteúdo do nosso arquivo de texto, são armazenados no membro <tt>data</tt> de um <tt>[http://api.kde.or...")
 
(No difference)

Latest revision as of 19:28, 19 November 2019

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Development/Tutorials/Saving and loading)
The data that <tt>storedGet()</tt> successfully downloaded, in this case the contents of our text file, is stored in the <tt>data</tt> member of a <tt>[http://api.kde.org/frameworks-api/frameworks5-apidocs/kio/html/classKIO_1_1StoredTransferJob.html KIO::StoredTransferJob]</tt> class. But in order to display the contents of the file at text, we must use a [http://doc.qt.io/qt-5/qtextstream.html QTextStream]. We create one by passing the the data of the <tt>StoredTransferJob</tt> to its constructor and then call its <tt>readAll()</tt> function to get the text from the file. This is then passed to the <tt>setPlainText()</tt> function of our text area.

Os dados que o storedGet() baixou com sucesso, neste caso o conteúdo do nosso arquivo de texto, são armazenados no membro data de um KIO::StoredTransferJob. Mas, para exibir o conteúdo do arquivo em texto, devemos usar um QTextStream. Criamos um passando os dados do StoredTransferJob para seu construtor e, em seguida, chamamos sua função readAll() para obter o texto do arquivo. Isso é passado para a função setPlainText() da nossa área de texto.