• Skip to content
  • Skip to link menu
KDE API Documentation - File Class Reference (GCompris-qt)
  • KDE Home
  • Contact Us
 

GCompris-qt

  • View on LXR
  • Comments
Signals | Public Member Functions | Static Public Member Functions | Properties | List of all members
File Class Reference
Core QML Components

#include <File.h>

Inherits QObject.

Signals

void error (const QString &msg)
 
void nameChanged ()
 

Public Member Functions

 File (QObject *parent=0)
 
Q_INVOKABLE QString read (const QString &name=QString())
 
Q_INVOKABLE bool write (const QString &data, const QString &name=QString())
 

Static Public Member Functions

static Q_INVOKABLE bool exists (const QString &path)
 

Properties

QString name
 

Detailed Description

A helper component for accessing local files from QML.

Definition at line 34 of file File.h.

Constructor & Destructor Documentation

File::File ( QObject *  parent = 0)
explicit

Constructor.

Definition at line 29 of file File.cpp.

Member Function Documentation

void File::error ( const QString &  msg)
signal

Emitted when an error occurs.

Parameters
msgError message.
bool File::exists ( const QString &  path)
static

Checks whether file path exists.

Parameters
pathFilename to check.
Returns
true if path exists, false otherwise.

Definition at line 122 of file File.cpp.

void File::nameChanged ( )
signal

Emitted when the name changes.

QString File::read ( const QString &  name = QString())

Reads contents of a file.

Parameters
name[optional] Filename to read from. If omitted reads from the file specified by the member name.
Returns
Whole file contents.
See also
name

Definition at line 61 of file File.cpp.

bool File::write ( const QString &  data,
const QString &  name = QString() 
)

Writes data to a file.

Parameters
dataText data to write.
name[optional] Filename to write to. If omitted writes to the file specified by the member name.
Returns
success of the operation.
See also
name

Definition at line 93 of file File.cpp.

Property Documentation

QString File::name
readwrite

Filename.

Accepted are absolute paths and URLs starting with the schemes 'file://' and 'qrc://'.

Definition at line 44 of file File.h.


The documentation for this class was generated from the following files:
  • File.h
  • File.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Tue Jun 2 2015 21:47:48 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

GCompris-qt

Skip menu "GCompris-qt"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List
  • Modules

Class Picker

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal