Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QDeclarativeError Class Reference

The QDeclarativeError class encapsulates a QML error. More...

 #include <QDeclarativeError>

This class was introduced in Qt 4.7.

Public Functions

QDeclarativeError ()
QDeclarativeError ( const QDeclarativeError & other )
int column () const
QString description () const
bool isValid () const
int line () const
void setColumn ( int column )
void setDescription ( const QString & description )
void setLine ( int line )
void setUrl ( const QUrl & url )
QString toString () const
QUrl url () const
QDeclarativeError & operator= ( const QDeclarativeError & other )

Related Non-Members

QDebug operator<< ( QDebug debug, const QDeclarativeError & error )

Detailed Description

The QDeclarativeError class encapsulates a QML error.

QDeclarativeError includes a textual description of the error, as well as location information (the file, line, and column). The toString() method creates a single-line, human-readable string containing all of this information, for example:

 file:///home/user/test.qml:7:8: Invalid property assignment: double expected

You can use qDebug() or qWarning() to output errors to the console. This method will attempt to open the file indicated by the error and include additional contextual information.

 file:///home/user/test.qml:7:8: Invalid property assignment: double expected
         y: "hello"
            ^

See also QDeclarativeView::errors() and QDeclarativeComponent::errors().

Member Function Documentation

QDeclarativeError::QDeclarativeError ()

Creates an empty error object.

QDeclarativeError::QDeclarativeError ( const QDeclarativeError & other )

Creates a copy of other.

int QDeclarativeError::column () const

Returns the error column number.

See also setColumn().

QString QDeclarativeError::description () const

Returns the error description.

See also setDescription().

bool QDeclarativeError::isValid () const

Returns true if this error is valid, otherwise false.

int QDeclarativeError::line () const

Returns the error line number.

See also setLine().

void QDeclarativeError::setColumn ( int column )

Sets the error column number.

See also column().

void QDeclarativeError::setDescription ( const QString & description )

Sets the error description.

See also description().

void QDeclarativeError::setLine ( int line )

Sets the error line number.

See also line().

void QDeclarativeError::setUrl ( const QUrl & url )

Sets the url for the file that caused this error.

See also url().

QString QDeclarativeError::toString () const

Returns the error as a human readable string.

QUrl QDeclarativeError::url () const

Returns the url for the file that caused this error.

See also setUrl().

QDeclarativeError & QDeclarativeError::operator= ( const QDeclarativeError & other )

Assigns other to this error object.

Related Non-Members

QDebug operator<< ( QDebug debug, const QDeclarativeError & error )

Outputs a human readable version of error to debug.

Publicit�

Best Of

Actualit�s les plus lues

Semaine
Mois
Ann�e

Le Qt Developer Network au hasard

Logo

Utiliser QML et QtWebKit avec PySide

Le Qt Developer Network est un r�seau de d�veloppeurs Qt anglophone, o� ils peuvent partager leur exp�rience sur le framework. Lire l'article.

Communaut�

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la r�daction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, �crite par Nokia Corporation and/or its subsidiary(-ies). Les �ventuels probl�mes r�sultant d'une mauvaise traduction ne sont pas imputables � Nokia. Qt 4.7
Copyright © 2012 Developpez LLC. Tous droits r�serv�s Developpez LLC. Aucune reproduction, m�me partielle, ne peut �tre faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'� 3 ans de prison et jusqu'� 300 000 E de dommages et int�r�ts. Cette page est d�pos�e � la SACD.
Vous avez d�nich� une erreur ? Un bug ? Une redirection cass�e ? Ou tout autre probl�me, quel qu'il soit ? Ou bien vous d�sirez participer � ce projet de traduction ? N'h�sitez pas � nous contacter ou par MP !
 
 
 
 
Partenaires

H�bergement Web