1. Erik Segerdell
  2. Valentina Studio
  3. 木, 5月 02 2019, 08:50 PM
  4.  メールで購読
We'd like to set up a widget in a form that would export data to a file, e.g. to export a table as a CSV file on the Desktop. There is a widget option Set Action > File > Write Data, which produces the code template:

f = new QFile( '/path/to/file' );
f.open( QIODevice.OpenMode.WriteOnly );
f.write( ... );

But I can't find any further documentation on how to customize this code to make it work.

There are no comments made yet.
Sergey Pashkov 承諾済みの回答
Hello Erik,

Incorrect flag for open mode in the template.

Here's a working sample:

f = new QFile( '/tmp/test.txt' );
f.open( QIODevice.WriteOnly );
f.write( 'test text' );
There are no comments made yet.
  • ページ :
  • 1

There are no replies made for this post yet.
However, you are not allowed to reply to this post.


Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories