]> git.lyx.org Git - lyx.git/blob - src/support/qstring_helpers.cpp
Remove support for Qt < 4.2
[lyx.git] / src / support / qstring_helpers.cpp
1 /**
2  * \file qstring_helpers.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Dekel Tsur
7  * \author Jürgen Spitzmüller
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "qstring_helpers.h"
15 #include "unicode.h"
16
17 #include <QVector>
18
19
20 namespace lyx {
21
22 using std::string;
23
24 docstring const qstring_to_ucs4(QString const & qstr)
25 {
26         QVector<uint> const ucs4 = qstr.toUcs4();
27         return docstring(ucs4.begin(), ucs4.end());
28 }
29
30
31 string const fromqstr(QString const & str)
32 {
33         return str.isEmpty() ? string() : string(str.toUtf8());
34 }
35
36 } // namespace lyx