From cdc0311a6ea8e9f9d1cae7257a8580350e58ed86 Mon Sep 17 00:00:00 2001 From: agriche Date: Tue, 10 Nov 2015 11:19:55 +0100 Subject: [PATCH] The document list all changes on deprecated files. --- changes_porting_qt5.txt | 647 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 647 insertions(+) create mode 100644 changes_porting_qt5.txt diff --git a/changes_porting_qt5.txt b/changes_porting_qt5.txt new file mode 100644 index 00000000..3702136e --- /dev/null +++ b/changes_porting_qt5.txt @@ -0,0 +1,647 @@ + ******************************* + * PORTING QT4->QT5 * + * CHANGES * + ******************************* + + + + + + + + + + QtSingleApplication replacement for Qt5 +---------------------------------------- + +http://blog.kadu.im/2015/01/qtsingleapplication-replacement-for-qt5.html + + + + +UBWidgetMessageAPI.cpp +------------------------ + +-replace mGraphicsWidgetItem->page()->mainFrame()->evaluateJavaScript(js); by (Line 67) + +QtWebKitWidgets + + +UBGraphicsWidgetItem.h +--------------------- + +- add #include + + +UBGraphicsMediaItem.cpp +*----------------------- + +- comment //Phonon::createPath(mMediaObject, mAudioOutput); (line 109) +- replace //mMediaObject->setCurrentSource(QMediaSource(absoluteMediaFilename)); by mMediaObject->setMedia(QUrl::fromLocalFile(absoluteMediaFilename)); (Line 191) +- replace //mAudioOutput = new QMediaPlayer(format, this); by mAudioOutput = new QMediaPlayer; +- replace //mMediaObject->seek(mInitialPos); by mMediaObject->setPosition(mInitialPos); + + +UBGraphicsMediaItem.h +----------------------- + +- replace QAudioOutput *mAudioOutput; by QMediaPlayer *mAudioOutput; + +- replace //mMediaObject->setTickInterval(50); by mMediaObject->setPosition(50); + +UBGraphicsMediaItemDelegate.h +------------------------------- + +- add #include header file + + +UBGraphicsMediaItemDelegate.cpp +------------------------------- + +- replace UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, QMediaObject* pMedia, QObject * parent) + +by UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, QMediaPlayer* pMedia, QObject * parent) + + +- replace //mMediaObject->setCurrentSource(mSource); by mMediaObject->setMedia(QUrl::fromLocalFile(pMediaFileUrl)); + +- replace //QMediaObject* media = delegated()->mediaObject(); by QMediaPlayer* media = delegated()->mediaObject(); + +- replace //remainingTime() by ((media->duration()-media->position()) <= 0) { + + +- replace totalTime()); by duration() (L246) + +- replace //QMediaObject* media = delegated()->mediaObject(); + QMediaPlayer* media = delegated()->mediaObject(); + //mMediaControl->totalTimeChanged(media->totalTime()); + mMediaControl->totalTimeChanged(media->duration()); (line 267) + +- replace QMediaPlayer* media = delegated()->mediaObject();if (media->state() == QMediaPlayer::PlayingState) + +- replace // delegated()->mediaObject()->setCurrentSource(delegated()->mediaFileUrl()); + delegated()->mediaObject()->setCurrentSource(delegated()->mediaFileUrl()); + +- replace // delegated()->mediaObject()->setCurrentSource(delegated()->mediaFileUrl()); + delegated()->mediaObject()->setMedia(delegated()->mediaFileUrl()); line 230 + +UBGraphicsItemDelegate.cpp +---------------------------- + +-replace //mDelegate->mediaObject()->seek(tickPos); by mDelegate->mediaObject()->setPosition(tickPos); (line 1445) +- replace //button->scale(0.8,0.8); by button->setScale(0.8); + + + +UBGraphicsGroupContainerItem.cpp +---------------------------------- + +replace //foreach(QGraphicsItem *child, children()) by foreach(QGraphicsItem *child, childItems()) Line 287 + + + +UBGraphicsScene.cpp +------------------- + +- replace //graphicsWidget->scale(ssf, ssf); by graphicsWidget->setScale(ssf); (1394) +- replace //svgItem->scale(sscale, sscale); by svgItem->setscale(sscale); (1521) + +- replace //item->scale(ratio, ratio); by item->setscale(ratio); (1817) +- replace //pixmapItem->scale(pScaleFactor, pScaleFactor); by pixmapItem->setScale(pScaleFactor); (1273) + + +UBFileSystemUtils.cpp +-------------------- + + +- replace QDesktopServices by QStandardPaths ; (line 138,139, + + +UBGraphicsMediaItem +------------------- + +- replace //translate(translation.x(), translation.y()); by setPos(translation.x(), translation.y()); line 355 + +UBGraphicsDelegateFrame.cpp +---------------------------- + + - replace //translate(center.x(), center.y()); by setPos(center.x(), center.y()); line 840 + - replace //translate(-center.x(), -center.y()); by setPos(-center.x(), -center.y()); line 840 + - replace rotate(-angle); by setRotation(rotation() - angle); line 840 + + +GraphicsPDFItem.cpp +---------------------- +- replace //#include by #include + + +UBThumbnailWidget.cpp +--------------------- + +- replace //setAcceptsHoverEvents(true); by setAcceptHoverEvents(enabled); (line775) (accept without "s") + + +UBFeaturesWidget.cpp +-------------------- + +- add #include +- add #include header()->setResizeMode(eItemColumn_Desc, QHeaderView::Stretch); + mpTree->header()->setSectionResizeMode(eItemColumn_Desc, QHeaderView::Stretch); + + //mpTree->header()->setResizeMode(eItemColumn_Close, QHeaderView::Custom); + mpTree->header()->setSectionResizeMode(eItemColumn_Close, QHeaderView::Custom); (Line 64) + +UBWebPluginPDFWidget.cpp +-------------------------- + +- add //#include by #include + + +UBSpinningWheel.h +------------------ + +- add #include + + +UBFeaturesWidget.cpp +--------------------- + +- add replace QWidget *eventSource = (QWidget*)event->source(); by QWidget *eventSource = event->source(); + + +UBSpinningWheel.cpp +------------------- + +- replace //painter.rotate(30 * (mPosition % 12)); by int val = mPosition.load(); and painter.rotate(30 * (val % 12)); + +PDFRenderer.cpp +--------------- + +- replace //if (mRefCount == 0) by if (mRefCount.load() == 0) + + +UBThumbnailWidget.cpp +--------------------- + +- replace //mLassoRectItem = new QGraphicsRectItem(0, scene()); by QRectF rect_init(0,0,0,0); and mLassoRectItem = new QGraphicsRectItem(rect_init, (QGraphicsItem *)scene()); + + +UBDocumentThumbnailWidget.cpp +----------------------------- + +-replace //mDropCaretRectItem = new QGraphicsRectItem(0, scene()); by QRectF rectInit(0,0,0,0); and mDropCaretRectItem = new QGraphicsRectItem(rectInit, (QGraphicsItem*)scene()); + + +UBPlatformUtils_win.cpp +------------------------ + +- replace //#include by #include + + +XPDFRenderer.cpp +---------------- + +- replace //if (sInstancesCount == 0 && globalParams) by if (sInstancesCount.load() == 0 && globalParams) + + +C:\Qt_ide\5.2.1\msvc2010\include\QtCore\qdatetime.h +--------------------------------------------------- +qdatetime.h.patch +------------------ + + +- error C2589: '('˙: jeton non conforme … droite de '::' +- error C2059: erreur de syntaxe˙: '::' + +--- qtbase/src/corelib/tools/qdatetime.h 9 03:11:14 2013 ++++ qtbase/src/corelib/tools/qdatetime.h 30 18:15:30 2013 +@@ -120,7 +120,7 @@ + inline qint64 toJulianDay() const { return jd; } + + private: +- static inline qint64 nullJd() { return std::numeric_limits::min(); } ++ static inline qint64 nullJd() { return (std::numeric_limits::min)(); } + static inline qint64 minJd() { return Q_INT64_C(-784350574879); } + static inline qint64 maxJd() { return Q_INT64_C( 784354017364); } + + +UBDisplayManager.h +-------------------- + +- replace //#include by #include + + +UBDockPalette.cpp +---------------- + +- replace //iconPixmap.setAlphaChannel(transparencyPix); by the block codes as following : + + //---------------------------------------------- + QImage image = iconPixmap.toImage() ; + image.setAlphaChannel(transparencyPix.toImage()); + iconPixmap = iconPixmap.fromImage(image); + //----------------------------------------------- + + +UBWindowsMediaFile.cpp +--------------------- + +- replace //#include by #include +- replace //if (FAILED(mWMWriter->AllocateSample(pImage.numBytes(), &sampleBuffer))) by if (FAILED(mWMWriter->AllocateSample(pImage. byteCount()(), &sampleBuffer))) + +- replace //memcpy((void*) rawBuffer, imageBuffer, pImage.numBytes()); by memcpy((void*) rawBuffer, imageBuffer, pImage.byteCount()); + +UBWaveRecorder.cpp +------------------- + + +UBGraphicsProtractor.h +---------------------- +- replace //#include by #include + + +UBGraphicsCompass.cpp +---------------------- + +- replace //setAcceptsHoverEvents(true); by setAcceptHoverEvents(true); + + +UBGraphicsProtractor.h +---------------------- + +- replace //#include by +#include +#include +#include + + +UBGraphicsProtractor.cpp +------------------------- + +-replace //translate(rect().center().x(), rect().center().y()); by setPos(rect().center().x(), rect().center().y()); line 205 + +-replace //translate(-rect().center().x(), -rect().center().y()); by setPos(-rect().center().x(), -rect().center().y()); line 210 +-replace //mResetSvgItem->translate(-resetButtonRect().left(), -resetButtonRect().top()); by mResetSvgItem->setpos(-resetButtonRect().left(), -resetButtonRect().top()); + all translate->setPos (Lines 464,468,473,475,477,480,482,484, + +- replace //mMarkerSvgItem->rotate(- mStartAngle - mCurrentAngle); by mMarkerSvgItem->setRotation(- mStartAngle - mCurrentAngle); +- replace //mRotateSvgItem->rotate(-mStartAngle); by mRotateSvgItem->setRotation( -mStartAngle); (Line 482) + +- replace //mResetSvgItem->rotate(-mStartAngle); by mResetSvgItem->setRotation(-mStartAngle); (Line 467) +- replace //mResizeSvgItem->rotate(-mStartAngle); by mResizeSvgItem->setRotation(-mStartAngle); Line 478) + + + +- replace //mMarkerSvgItem->scale(scale, scale);//this do not impact the bounding box of thr svg item... by mMarkerSvgItem->setScale( scale);//this do not impact the bounding box of thr svg item... + + (line 503) + +- replace //mRotateSvgItem->scale(scale, scale);//this do not impact the bounding box of thr svg item... (Line 492) + mRotateSvgItem->setScale(scale);//this do not impact the bounding box of thr svg item... + +- replace //mResetSvgItem->scale(scale * antiSc, scale * antiSc);//this do not impact the bounding box of thr svg item... + mResetSvgItem->setScale(scale * antiSc);//this do not impact the bounding box of thr svg item... (Line 473) + + + +- replace //scale(1.5, 1.5); by setScale(1.5); (Line 82) + +- replace //mCloseSvgItem->rotate(-mStartAngle); by mCloseSvgItem->setRotation(-mStartAngle); (Line 458) + +- replace //scale(scaleFactor); by setScale(scaleFactor); + +- replace //mCloseSvgItem->scale(scale * antiSc, scale * antiSc);//this do not impact the bounding box of thr svg item... by + mCloseSvgItem->setSale(scale * antiSc);//this do not impact the bounding box of thr svg item... (Line 467) + +- replace // mResizeSvgItem->scale(scale * antiSc, scale * antiSc);//this do not impact the bounding box of thr svg item... + mResizeSvgItem->setScale(scale * antiSc);//this do not impact the bounding box of thr svg item... (Line 490) + + + +UBAbstractDrawRuler.h +---------------------- + + - replace //#include by +#include + + +UBWaveRecorder.cpp +------------------- + +-replace // QString deviceName = QString:: fromUtf16(caps.szPname); by QString deviceName = QString::fromWCharArray(caps.szPname) ; (Line 67) + +-replace //devices << QString::fromUtf16(caps.szPname); by devices << QString::fromWCharArray(caps.szPname); (Line 242) + + + +UBAbstractDrawRuler.cpp +------------------------ + +- replace //item.setAcceptsHoverEvents(true); by item.setAcceptHoverEvents(true); + +UBCustomCaptureWindow.h +------------------------ + +- replace //#include by include + + + +UBWebKitUtils.h +--------------- + +-replace //#include by #include + + +UBWindowCaptureDelegate_win.h +------------------------------ + - replace //#include by #include + +UBOEmbedParser.cpp +------------------ + +-replace toAscii--> toLatin1 qurl.setEncodedUrl(url.toLatin1()); (line 230) + +-replace + + +WBSqueezeLabel.h +----------------- + +- replace //#include by #include + + +UBWindowCaptureDelegate_win.cpp +-------------------------------- + +- replace //mCapturedPixmap = QPixmap::grabWindow(mCurrentWindow); + mCapturedPixmap = QScreen::grabWindow(mCurrentWindow); + +UBOEmbedParser.cpp +----------------- + +- replace //qurl.setEncodedUrl(url.toAscii()); by qurl.setUrl(url.toLatin1(),QUrl::TolerantMode); + + + +WBChaseWidget.cpp +------------------ + +- replace //#include by #include + + +WBChaseWidget.h +----------------- + +-replace //#include by #include + + + +WBModelMenu.h +-------------- + +-replace //#include by #include + + + +WBUrlLineEdit.cpp +----------------- + -replace //#include by #include + + +WBEditTableView.cpp +-------------------- + +- replace //#include by #include + +WBEditTableView.h +------------------ + -replace //#include by #include + + +WBSearchLineEdit.cpp +--------------------- + +-replace //#include by +#include + +WBToolBarSearch.cpp +------------------- + +//#include +#include + +//#include +#include + + +WBToolBarSearch.h +------------------ + + +-replace //#include +#include + +WBSearchLineEdit.h +------------------ + +//#include +#include + +WBWebTrapWebView.cpp +--------------------- + + +- replace +//#include +//#include +by +#include +#include + + + +WBWebTrapWebView.h +------------------- + +- replace +//#include +//#include +by +#include +#include + + +WBToolBarSearch.cpp +------------------- + + +-add on the top of the file +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +# include +#endif + + +WBUrlLineEdit.h +--------------- +- replace //#include by //#include + + +WBWebView.h +----------- + + +- replace //#include +//#include + +#include +#include + +WBDownloadManager.cpp +---------------------- + +- replace storageLocation by QStandardPaths => QStandardPaths::writableLocation( QStandardPaths::DesktopLocation + + + +WBToolBarSearch.cpp +-------------------- + + urlQuery1.addQueryItem(QLatin1String("q"), searchText); + url.setQuery(urlQuery1); + + urlQuery2.addQueryItem(QLatin1String("ie"), QLatin1String("UTF-8")); + url.setQuery(urlQuery2); + + urlQuery3.addQueryItem(QLatin1String("oe"), QLatin1String("UTF-8")); + url.setQuery(urlQuery3); + + urlQuery4.addQueryItem(QLatin1String("client"), QLatin1String("uniboard-browser")); + url.setQuery(urlQuery4); + + + /*url.addQueryItem(QLatin1String("q"), searchText); + url.addQueryItem(QLatin1String("ie"), QLatin1String("UTF-8")); + url.addQueryItem(QLatin1String("oe"), QLatin1String("UTF-8")); + url.addQueryItem(QLatin1String("client"), QLatin1String("uniboard-browser")); + */ + + +WBTabWidget.cpp +---------------- + +-replace //#include by #include + + +WBTabWidget.h +------------- +- replace //#include by #include + +Utils.cpp +--------- + +- replace toascii() by toLatin1() + +**** +TODO +**** +- solve //mCapturedPixmap = QPixmap::grabWindow(mCurrentWindow); + mCapturedPixmap = QScreen::grabWindow((HWND)mCurrentWindow); + +UBGlobals.h +----------- + +replace //#ifdef Q_WS_WIN by #ifdef Q_OS_WIN + + +UBCFFAdaptor.cpp +---------------- + +************************************************ + TODO +************************************************ + +- to solve dstList.setInsertInOrder(true); (Line 1954) + +qtsingleapplication.h +--------------------- + +- replace //#include by #include + +- comment //QtSingleApplication(int &argc, char **argv, Type type); + + +WBTabWidget.h +-------------- + +- replace //#include by #include + + +WBBrowserWindow.h +------------------ + +- replace //#include ;//#include by + +#include +#include + + +WBHistory.h +----------- + - replace //#include ;//#include by + +#include +#include + + + +UBGlobals.h +------------ + +- replace //#ifdef Q_WS_WIN by #ifdef Q_OS_WIN + +UBWindowCaptureDelegate_win.cpp +------------------------------- + +- solve the HWND -->WId window conversion from //mCapturedPixmap = QPixmap::grabWindow(mCurrentWindow); +=> solution : add into the UBWindowCaptureDelegate_win.h header : the inclusion header #include + +UBWindowCaptureDelegate_win.h +------------------------------- +#ifdef Q_OS_WIN +#include +#endif + + + + +qtsingleapplication.cpp +------------------------ + +- replace the old verison by the sources files repository + +qtsingleapplication.h +------------------------ + +- add the snippet code: + // Obsolete: + void initialize(bool dummy = true) + { isRunning(); Q_UNUSED(dummy) } + + + + + + +