Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

Porting from Qt 4 to Qt 5

#include <QtGui/QWidget>
#include <QtWidgets/QWidget>
#include <QWidget>
#ifdef Q_WS_WIN
// call windows API
#endif
#ifdef Q_OS_WIN
// call windows API
#endif
class MyType;
Q_DECLARE_METATYPE(MyType);
// Old Qt 4 based code. The const char * returned is
// assigned to a local variable and used
const char *name = mm.signature();
otherApi(name);

// New Naively ported Qt 5 based code
const char *name = mm.methodSignature();
// Uh-oh, name is already a dangling pointer. The QByteArray
// returned from methodSignature has already deleted the data.
otherApi(name); // This is now a crash waiting to happen.

Contacts Touch from KDE PIM with QML 1

Dolphin About page showing encoding issues

Konqueror with minor menu bug


19 Comments

13 - Jun - 2012

Sebastian Kügler

#include "QWidget"
->
#include 

13 - Jun - 2012

Admin

9 - Jul - 2012

ingengeri milano

23 - Jul - 2012

Ultracopier

23 - Jul - 2012

steveire

23 - Jul - 2012

steveire

10 - Aug - 2012

Liang Qi

18 - Aug - 2012

n3rdopolis

20 - Aug - 2012

steveire

20 - Aug - 2012

n3rdopolis

12 - Sept - 2012

Ryocchin

25 - Dec - 2012

yekz

31 - Dec - 2012

Fernando Pelliccioni

8 - May - 2013

safari

21 - May - 2013

Akash Shastri

15 - Mar - 2015

Varun Rawal

15 - Mar - 2015

Varun Rawal

7 - May - 2015

stlcours

24 - Mar - 2019

Guillermo Ibañez