1. Erik Segerdell
  2. Valentina Studio
  3. Четверг, Май 02 2019, 08:50 PM
  4.  Подписаться через email
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( ... );
f.close();


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

Thanks!
Комментарий
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' );
f.close();
Комментарий
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.

Categories

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. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories