If compiled with STL compatibility, QString
has a static method to convert a std::string
to a QString
:
std::string str = "abc";
QString qstr = QString::fromStdString(str);
More Related Contents:
- Convert std::string to QString
- How to convert QString to std::string?
- QString to char* conversion
- How to create string of strings in c++
- String comparison operators
- How do I iterate over the words of a string?
- C++ deprecated conversion from string constant to ‘char*’
- What is the lifetime of the result of std::string::c_str()?
- Why does omission of “#include ” only sometimes cause compilation failures?
- Qt Linker Error: “undefined reference to vtable” [duplicate]
- How to link opencv in QtCreator and use Qt library
- Efficient string concatenation in C++
- How is std::string implemented?
- How to return a std::string.c_str()
- How to strip all non alphanumeric characters from a string in c++?
- Is there an intra-process local pipe in Qt?
- How to (un)escape strings in C/C++?
- What is the datatype of string literal in C++?
- Converting an int to std::string
- Ncurses and Qt Interoperability
- Braces around string literal in char array declaration valid? (e.g. char s[] = {“Hello World”})
- Using std::string_view with api that expects null-terminated string
- How can CString be passed to format string %s?
- how to add zlib to an existing qt installation
- Qt macro keywords cause name collisions
- cin.getline() is skipping an input in C++ [duplicate]
- Error: C2228: left of ” must have class/struct/union
- How to write an object to file in C++
- How to convert int to string in C++
- Assign a string literal to a char* [duplicate]