Unsolved Porting from QT4.6 to QT5
-
@Qt-Enthusiast
just use the c++ versions
true
false
(in small letters) -
what is significance of FALSE and TRUE in Qt4
-
Also I am getting an error
mainwindow.h:17:0: error: "Q_NULLPTR" redefined [-Werror]is Q_NULLPTR defined in SRC of QT5
-
@Qt-Enthusiast Please post your code (mainwindow.h).
Also it is better to use nullptr from C++11 now. -
@mrjj
is FALSE and TRUE defined in qt4 code -
-
Then why I am getting this error when I am changing the library to Qt5
-
@Qt-Enthusiast Do you use same compiler for both Qt versions?
-
@Qt-Enthusiast said in Porting from QT4.6 to QT5:
Then why I am getting this error when I am changing the library to Qt5
Because you also changed your compiler?
-
Yes
I changed just the qt version. What is significance of Q_NULLPTR -
@Qt-Enthusiast Well, if you search a bit you will find this in Qt source:
#ifdef Q_COMPILER_NULLPTR # define Q_NULLPTR nullptr #else # define Q_NULLPTR NULL #endif
If you have a C++11 compiler Q_NULLPTR will be nullptr, else it will be the old C/C++ NULL.
You can use Q_NULLPTR if you have to support older C++ compilers which do not know anything about nullptr and newer C++ compilers. -
how to solve the following error
error: no matching function for call to 'QGraphicsTextItem::QGraphicsTextItem(const char [5], int, QGraphicsScene*&)'
cursor = new QGraphicsTextItem("0, 0", 0, scene); -
@Qt-Enthusiast Go here and check what constructors QGraphicsTextItem has: http://doc.qt.io/qt-5/qgraphicstextitem.html
-
Hi
I saw
http://doc.qt.io/qt-5/qgraphicsscene.htmlQGraphicsItem * itemAt(const QPointF &position, const QTransform &deviceTransform) const
QGraphicsItem * itemAt(qreal x, qreal y, const QTransform &deviceTransform) constbuit still could not find the correct fix for compliation error
What const QTransform &deviceTransform shall I use
error: no matching function for call to 'QGraphicsScene::itemAt(QPointF&)'
QPointF m ;
QGraphicsItem *currentItem = scene->itemAt(m); -
@Qt-Enthusiast http://doc.qt.io/qt-5/qgraphicsscene.html#itemAt has two parameters not one.
Try to pass QTransform() as second parameter. -
I am getting issue
I am getting errors like
file.cxx: In member function 'bool fileMgr::showURL(QString)':
error: 'QWebView' does not name a type
340 static QWebView *sBrowser = NULL;
341 ^I tried to do
#include QtWebKitWidgets
#include QtWebViewIt is giving me an error that not able to find file QtWebKitWidgets .
can some one help me in solving the problem
-
@Qt-Enthusiast said in Porting from QT4.6 to QT5:
It is giving me an error that not able to find file QtWebKitWidgets .
can some one help me in solving the problem
-
I am using solution
#include <QtWebKit/QtWebKit>
#include <QtWebKitWidgets/QtWebKitWidgets>is that solution Ok
-
@Qt-Enthusiast Why not simply
#include <QWebView> ```?
-
@Qt-Enthusiast said in Porting from QT4.6 to QT5:
is that solution Ok
Did you read the link I gave you?