Hi folks,

Is it a bug or feature?

class TextFileViewException
    :    public std::runtime_error
{
public:
    explicit TextFileViewException( const QString & what );
    ~TextFileViewException() throw();

    //! \return What happened as QString.
    const QString & whatAsQString() const;

private:
    //! What happened?
    QString m_what;
}; // class TextFileViewException

TextFileViewException::TextFileViewException( const QString & what )
:    std::runtime_error( what.toLocal8Bit() )
    ,    m_what( what )
{
}

TextFileViewException::~TextFileViewException() throw()
{
}

const QString &
TextFileViewException::whatAsQString() const
{
    return m_what;
}

This exception class compiles successfully with MSVC 2013 and Qt 5.5.1.

Look at this line:

std::runtime_error( what.toLocal8Bit() )

std::runtime_error() constructs from QByteArray... How it is possible?

--
Best Regards,
Igor Mironchik.

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to