Since the QT version of the recent project has been upgraded from qt4.8 to qt5.5, although the change from 4 to 5 is small, there are a number of questions that need to be recorded to help more people.
1. Because QT5 has moved most of the desktop components to the QT widgets module, it is necessary to include the Qtwidgets module where the Qtgui is protected
2, garbled problem.
For VS, because of window history, the std::string (standard string) is garbled when using UTF8 encoding on VS, so GBK encoding is temporarily used on vs. QT5 removes the qtextcodec::setcodecforcstrings () function, so when it comes to writing Chinese constants directly in CPP, use macros qstringliteral parcels directly, such as qstringliteral ("I am a kanji"); If the kanji are stored in a variable, the fromlocal8bit static method is used.
For Linux, using GBK encoding directly, QString has a member method tostdstring, which converts the string of the QString type to std::string,qstring: Fromstdstring method to convert standard string to qstring type
3. Add JSON module
Are the standard jion strings described in the form of key-value pairs?, the key is a string, the value can be a JSON object, a JSON array, or a JSON value
The value of the Qjsonvalue:json string
Qjsonobject:json Object
Qjsonarray:json array?
4, the use of Qwebview and other WebKit related visual parts, Qt5 alone into the Qtwebkitwidgets module, so add header file # # #
5, join multiple Connect overloaded method, when the new Connect link, will use type detection, if the compiler does not match will error?
6, Qtmutimedia replaced the phonon?
C + + interface changes
porting C + + applying QT 5
by the way: Qt can use Qaxwidget or Qwebview to embed the Web page, but Qt UI refreshes in the main thread, so when the web window refreshes, the entire app will feign animation, it is recommended to use CEF to embed the browser, powerful , but the dynamic library is large
Qt4 some issues with upgrading to QT5