Revert changes pushed to wrong branch

When the time comes to merge dev into master (for real), the
following may be useful:
https://metlos.wordpress.com/2012/01/13/
git-merging-after-a-revert/
preferencesAboutTextFull
Craig Watson 9 years ago
parent bc27f484c8
commit 4aa0ee6197
  1. 14
      OpenBoard.pro
  2. 27
      TEST_OpenBoard_Win32.txt
  3. 844
      changes_porting_qt5.txt
  4. 2
      src/adaptors/UBExportAdaptor.cpp
  5. 1
      src/adaptors/UBExportFullPDF.cpp
  6. 1
      src/adaptors/UBExportPDF.cpp
  7. 1
      src/adaptors/UBMetadataDcSubsetAdaptor.cpp
  8. 17
      src/adaptors/UBSvgSubsetAdaptor.cpp
  9. 1
      src/adaptors/UBSvgSubsetAdaptor.h
  10. 2
      src/adaptors/UBThumbnailAdaptor.cpp
  11. 2
      src/adaptors/publishing/UBDocumentPublisher.cpp
  12. 7
      src/adaptors/publishing/UBDocumentPublisher.h
  13. 1
      src/api/UBLibraryAPI.h
  14. 2
      src/api/UBW3CWidgetAPI.cpp
  15. 2
      src/api/UBWidgetMessageAPI.cpp
  16. 8
      src/api/UBWidgetUniboardAPI.cpp
  17. 8
      src/board/UBBoardController.cpp
  18. 3
      src/board/UBBoardController.h
  19. 16
      src/board/UBBoardPaletteManager.cpp
  20. 24
      src/board/UBBoardView.cpp
  21. 5
      src/board/UBBoardView.h
  22. 1
      src/board/UBFeaturesController.cpp
  23. 1
      src/board/UBFeaturesController.h
  24. 1
      src/core/UB.h
  25. 56
      src/core/UBApplication.cpp
  26. 32
      src/core/UBApplication.h
  27. 68
      src/core/UBApplicationController.cpp
  28. 6
      src/core/UBApplicationController.h
  29. 6
      src/core/UBDisplayManager.cpp
  30. 1
      src/core/UBDisplayManager.h
  31. 2
      src/core/UBDocumentManager.cpp
  32. 5
      src/core/UBDownloadManager.cpp
  33. 4
      src/core/UBOpenSankoreImporter.cpp
  34. 4
      src/core/UBPersistenceManager.cpp
  35. 4
      src/core/UBPreferencesController.cpp
  36. 1
      src/core/UBPreferencesController.h
  37. 38
      src/core/UBSettings.cpp
  38. 32
      src/core/main.cpp
  39. 3
      src/desktop/UBCustomCaptureWindow.cpp
  40. 3
      src/desktop/UBCustomCaptureWindow.h
  41. 20
      src/desktop/UBDesktopAnnotationController.cpp
  42. 4
      src/desktop/UBDesktopPalette.cpp
  43. 4
      src/desktop/UBDesktopPalette.h
  44. 1
      src/desktop/UBWindowCapture_linux.cpp
  45. 6
      src/document/UBDocumentController.cpp
  46. 1
      src/document/UBDocumentController.h
  47. 7
      src/domain/UBGraphicsDelegateFrame.cpp
  48. 2
      src/domain/UBGraphicsGroupContainerItem.cpp
  49. 6
      src/domain/UBGraphicsItemDelegate.cpp
  50. 65
      src/domain/UBGraphicsMediaItem.cpp
  51. 40
      src/domain/UBGraphicsMediaItem.h
  52. 123
      src/domain/UBGraphicsMediaItemDelegate.cpp
  53. 14
      src/domain/UBGraphicsMediaItemDelegate.h
  54. 10
      src/domain/UBGraphicsScene.cpp
  55. 4
      src/domain/UBGraphicsWidgetItem.cpp
  56. 1
      src/domain/UBGraphicsWidgetItem.h
  57. 2
      src/domain/UBSelectionFrame.cpp
  58. 1
      src/domain/UBUndoCommand.h
  59. 2
      src/frameworks/UBBase32.cpp
  60. 2
      src/frameworks/UBCoreGraphicsScene.h
  61. 8
      src/frameworks/UBCryptoUtils.cpp
  62. 8
      src/frameworks/UBFileSystemUtils.cpp
  63. 2
      src/frameworks/UBPlatformUtils.h
  64. 5
      src/frameworks/UBPlatformUtils_linux.cpp
  65. 6
      src/globals/UBGlobals.h
  66. 9
      src/gui/UBActionPalette.cpp
  67. 2
      src/gui/UBActionPalette.h
  68. 1
      src/gui/UBCircleFrame.h
  69. 1
      src/gui/UBColorPicker.h
  70. 4
      src/gui/UBDockPalette.cpp
  71. 3
      src/gui/UBDocumentThumbnailWidget.cpp
  72. 1
      src/gui/UBDocumentTreeWidget.h
  73. 4
      src/gui/UBDownloadWidget.cpp
  74. 3
      src/gui/UBFeaturesActionBar.cpp
  75. 3
      src/gui/UBFeaturesActionBar.h
  76. 10
      src/gui/UBFeaturesWidget.cpp
  77. 6
      src/gui/UBFeaturesWidget.h
  78. 4
      src/gui/UBFloatingPalette.cpp
  79. 4
      src/gui/UBMagnifer.cpp
  80. 1
      src/gui/UBMagnifer.h
  81. 12
      src/gui/UBMainWindow.cpp
  82. 4
      src/gui/UBMainWindow.h
  83. 2
      src/gui/UBMessageWindow.cpp
  84. 2
      src/gui/UBMessageWindow.h
  85. 4
      src/gui/UBMessagesDialog.cpp
  86. 1
      src/gui/UBMessagesDialog.h
  87. 2
      src/gui/UBMousePressFilter.cpp
  88. 10
      src/gui/UBRubberBand.cpp
  89. 3
      src/gui/UBScreenMirror.cpp
  90. 1
      src/gui/UBScreenMirror.h
  91. 2
      src/gui/UBSpinningWheel.cpp
  92. 8
      src/gui/UBThumbnailWidget.cpp
  93. 6
      src/gui/UBToolWidget.cpp
  94. 1
      src/gui/UBToolWidget.h
  95. 2
      src/gui/UBToolbarButtonGroup.cpp
  96. 4
      src/gui/UBToolbarButtonGroup.h
  97. 1
      src/gui/UBWidgetMirror.h
  98. 1
      src/gui/UBZoomPalette.cpp
  99. 4
      src/network/UBNetworkAccessManager.cpp
  100. 4
      src/pdf-merger/Utils.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

@ -28,15 +28,10 @@ VERSION_RC = $$replace(VERSION_RC, "r", "240") # 0xF0
QT += webkit
QT += svg
QT += network
QT += phonon
QT += xml
QT += script
QT += xmlpatterns
QT += uitools
QT += multimedia
QT += webkitwidgets
QT += multimediawidgets
QT += printsupport
QT += core
INCLUDEPATH += src
@ -64,10 +59,9 @@ include(src/pdf-merger/pdfMerger.pri)
DEPENDPATH += $$THIRD_PARTY_PATH/quazip/
INCLUDEPATH += $$THIRD_PARTY_PATH/quazip/
include($$THIRD_PARTY_PATH/quazip/quazip.pri)
DEPENDPATH += $$THIRD_PARTY_PATH/qt/singleapplication
INCLUDEPATH += $$THIRD_PARTY_PATH/qt/singleapplication
include($$THIRD_PARTY_PATH/qt/singleapplication/qtsingleapplication.pri)
include($$THIRD_PARTY_PATH/qt/lockedfile/qtlockedfile.pri)
DEPENDPATH += $$THIRD_PARTY_PATH/trolltech/singleapplication
INCLUDEPATH += $$THIRD_PARTY_PATH/trolltech/singleapplication
include($$THIRD_PARTY_PATH/trolltech/singleapplication/qtsingleapplication.pri)
FORMS += resources/forms/mainWindow.ui \
resources/forms/preferences.ui \

@ -1,27 +0,0 @@
****************************
* TEST OpenBoard *
* under Win32 (Windows 7) *
* *
****************************
======================|====================|
Modules | Status |
======================|====================|
Network Manager | web OK |
----------------------|--------------------|
the video media |.avi not working |
| .mp4 works in small|
| format |
----------------------|--------------------|
audio | OK |
----------------------|--------------------|
| |
----------------------|--------------------|
| |
----------------------|--------------------|
| |
----------------------|--------------------|

@ -1,844 +0,0 @@
*******************************
* PORTING QT4->QT5 *
* CHANGES *
* win32 compilaton &exec *
*******************************
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 <QtWebKitWidgets/QWebFrame>
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 <QtMultimedia/QMediaPlayer> 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 <QtGui/QStyleOptionGraphicsItem> by #include <QtWidgets/QGraphicsItem>
UBThumbnailWidget.cpp
---------------------
- replace //setAcceptsHoverEvents(true); by setAcceptHoverEvents(enabled); (line775) (accept without "s")
UBFeaturesWidget.cpp
--------------------
- add #include <QtWebKitWidgets/QWebview>
- add #include <Qt
OpenBoard.pro
-------------
- add QT += gui
UBDownloadWidget.cpp
--------------------
- replace //mpTree->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 <QtGui> by #include <QtWidgets>
UBSpinningWheel.h
------------------
- add #include <QAtomicInt>
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 <QtGui> by #include <QtWidgets>
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<qint64>::min(); }
+ static inline qint64 nullJd() { return (std::numeric_limits<qint64>::min)(); }
static inline qint64 minJd() { return Q_INT64_C(-784350574879); }
static inline qint64 maxJd() { return Q_INT64_C( 784354017364); }
UBDisplayManager.h
--------------------
- replace //#include <QtGui> by #include <QtWidgets>
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 <QtGui> by #include <QtWidgets>
- 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 <QtGui> by #include <QtWidgets>
UBGraphicsCompass.cpp
----------------------
- replace //setAcceptsHoverEvents(true); by setAcceptHoverEvents(true);
UBGraphicsProtractor.h
----------------------
- replace //#include <QtGui> by
#include <QtWidgets>
#include <QtWidgets/QGraphicsItem>
#include <QtWidgets/QGraphicsView>
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 <QtGui> by
#include <QtWidgets>
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 <QtGui> by include <QtWidgets>
UBWebKitUtils.h
---------------
-replace //#include <QtWebKit> by #include <QtWebKitWidgets>
UBWindowCaptureDelegate_win.h
------------------------------
- replace //#include <QtGui> by #include <QtWidgets>
UBOEmbedParser.cpp
------------------
-replace toAscii--> toLatin1 qurl.setEncodedUrl(url.toLatin1()); (line 230)
-replace
WBSqueezeLabel.h
-----------------
- replace //#include <QtGui/QLabel> by #include <QtWidgets>
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 <QtGui> by #include <QtWidgets>
WBChaseWidget.h
-----------------
-replace //#include <QtGui> by #include <QtWidgets>
WBModelMenu.h
--------------
-replace //#include <QtGui> by #include <QtWidgets>
WBUrlLineEdit.cpp
-----------------
-replace //#include <QtGui> by #include <QtWidgets>
WBEditTableView.cpp
--------------------
- replace //#include <QtGui/QKeyEvent> by #include <QtWidgets>
WBEditTableView.h
------------------
-replace //#include <QtGui> by #include <QtWidgets>
WBSearchLineEdit.cpp
---------------------
-replace //#include <QtGui> by
#include <QtWidgets>
WBToolBarSearch.cpp
-------------------
//#include <QtGui>
#include <QtWidgets>
//#include <QtWebKit>
#include <QtWebKitWidgets>
WBToolBarSearch.h
------------------
-replace //#include <QtGui>
#include <QtWidgets>
WBSearchLineEdit.h
------------------
//#include <QtGui>
#include <QtWidgets>
WBWebTrapWebView.cpp
---------------------
- replace
//#include <QtGui>
//#include <QtWebKit>
by
#include <QtWidgets>
#include <QtWebKitWidgets>
WBWebTrapWebView.h
-------------------
- replace
//#include <QtGui>
//#include <QtWebKit>
by
#include <QtWidgets>
#include <QtWebKitWidgets>
WBToolBarSearch.cpp
-------------------
-add on the top of the file
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
# include <QUrlQuery>
#endif
WBUrlLineEdit.h
---------------
- replace //#include <QtGui> by //#include <QtWebKit>
WBWebView.h
-----------
- replace //#include <QtGui>
//#include <QtWebKit>
#include <QtWidgets>
#include <QtWebKitWidgets>
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 <QtGui> by #include <QtWidgets>
WBTabWidget.h
-------------
- replace //#include <QtGui> by #include <QtWidgets>
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 <QtGui/QApplication> by #include <QGuiApplication>
- comment //QtSingleApplication(int &argc, char **argv, Type type);
WBTabWidget.h
--------------
- replace //#include <QtWebKit> by #include <QtWebKitWidgets>
WBBrowserWindow.h
------------------
- replace //#include <QtGui> ;//#include <QtWebKit> by
#include <QtWidgets>
#include <QtWebKitWidgets>
WBHistory.h
-----------
- replace //#include <QtGui> ;//#include <QtWebKit> by
#include <QtWidgets>
#include <QtWebKitWidgets>
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 <qwindowdefs_win.h>
UBWindowCaptureDelegate_win.h
-------------------------------
#ifdef Q_OS_WIN
#include <qwindowdefs_win.h>
#endif
qtsingleapplication.cpp
------------------------
- replace the content by the source file repository (CW)
qtsingleapplication.h
------------------------
- replace the content by the source file repository (CW)
UBWindowCaptureDelegate_win.cpp
--------------------------------
************************************************
TODO
************************************************
- solve the // mCapturedPixmap = QPixmap::grabWindow(mCurrentWindow); => pb of conversion between HWND and WId.
qtlockedfile_win.cpp
---------------------
- add #if QT_VERSION >= 0x050000
#define QT_WA(unicode, ansi) unicode
#endif
qtsingleapplication.cpp
-------------------------
- remove the contentfrom source repository(CW).
qtsingleapplication.h
-------------------------
- remove the contentfrom source repository(CW).
qtlocalpeer.h
-------------
- replace the content by the old basis source repository (OpenBoard-Third-party)
qtlocalpeer.cpp
---------------
- replace the content by the old basis source repository (OpenBoard-Third-party)
UBNetworkAccessManager.cpp
--------------------------
- replace //#include <QtGui> by #include <QtWidgets>
- replace // introMessage = introMessage.arg(Qt::escape(reply->url().toString())).arg(Qt::escape(reply->url().toString())); by :
introMessage = introMessage.arg(QString(reply->url().toString())).toHtmlEscaped().arg(QString(reply->url().toString())).toHtmlEscaped();
WBHistory.cpp
--------------
- replace //#include <QtGui> by #include <QtWidgets>
- replace reset() by beginResetModel();
m_sourceRowCache.clear();
endResetModel(); (Line 1213,1268,)
-replace //reset(); by
beginResetModel();
endResetModel(); (Line 999,1006..)
}
- replace createIndex(row, column, 0); by (Line 969,1131,1140)
createIndex(row, column);
WBHistory.h
------------
- replace class WBHistoryFilterModel : public QAbstractProxyModel, by
class WBHistoryFilterModel : public QAbstractProxyModel, public QAbstractItemModel
- ?? pb at the level of compiler error:
UBBoardView.cpp
----------------
************************************************
TODO done cf below
************************************************
SOLVE THE ItemAt
- comment the mouseReleaseEvent method
- comment the mousePressEvent method
WBHistory.cpp
--------------
- comment and remove //beginResetModel(); and //endResetModel(); (Line 247)
- comment and remove //beginResetModel(); and //endResetModel(); (Line 837-843)
UBApplication.cpp
------------------
-remove and comment //QApplication::setStyle(new UBStyle()); // Style is owned and deleted by the application.
UBTrapFlashController.h
-----------------------
- replace //#include <QtGui> by #include <QtWidgets>.
UBTrapFlashController.cpp
-------------------------
- replace //#ifdef Q_WS_WIN // Defined on Windows. by#ifdef Q_OS_WIN // Defined on Windows.
UBPodcastController.cpp
-------------------------
-replace QDesktopServices::storageLocation. (Line 715)
-replace by QStandardPaths::writableLocation.
- replace repaintRect = repaintRect.unite(mSceneRepaintRectQueue.dequeue()); by repaintRect = repaintRect.united(mSceneRepaintRectQueue.dequeue());
- replace QRectF maxRect = rect.intersect(viewportRect); by RectF maxRect = rect.intersected(viewportRect);
- replace repaintRect = repaintRect.unite(mWidgetRepaintRectQueue.dequeue()); by repaintRect = repaintRect.united(mWidgetRepaintRectQueue.dequeue());
main.cpp
----------
- move QMessageLogContext context_m; on line 58
- replace // qt_message_output(type, msg); by qt_message_output(type,context_m, msg);
COMPILATION STATUS IN DEBUG STATUS :
************************************
- compile all libraries (freetype.lib quazip.lib,xpdf.lib) with success
- issue: error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0'
=> solution: complation in RELEASE MODE
- problem : LINK : fatal error LNK1123: échec lors de la conversion en fichier COFF msvc 2010 qt 5.2
=> solution :
Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1
- install the followin tools in your computer quth the msvc 2010 config:
cf https://support.microsoft.com/fr-fr/kb/2934068 :
support microsoft : " Erreur se produit lorsque vous installez le Kit de développement logiciel Windows pour Windows 7 et.NET Framework 4 "
steps :
------
1) remove and reinstall Microsoft Visual C++ 2010 SP1 Redistributable Package (x32) : vcredist_x32.exe
2) remove and reinstall Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) : vcredist_x64.exe
3) install Microsoft Windows SDK for Windows 7 and .NET Framework 4 (ISO).
4) reinstall Microsoft Visual Studio 2010 Service Pack 1 (Installer) download the iso from the link https://www.microsoft.com/en-us/download/confirmation.aspx?id=23691
cf link : https://msdn.microsoft.com/fr-fr/library/7dz62kfh.aspx
cf http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval
=> solution : the tools cvtres.exe was broken so copy C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe
into C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
OpenBoard.pro
--------------
- pb: fatal error LNK1123: échec lors de la conversion en fichier COFF vs 2010 qt 5.2 => add QMAKE_LFLAGS += /INCREMENTAL:NO
UBBoardView.cpp
----------------
the ItemAt issue was solved by the last update methods from the repository.
UBGraphicsTextItem.cpp
----------------------
- replace //#include <QtGui> by #include <QtWidgets>.

@ -23,7 +23,7 @@
*/
#include <QFileDialog>
#include "UBExportAdaptor.h"

@ -29,7 +29,6 @@
#include <QtCore>
#include <QtSvg>
#include <QPrinter>
#include "core/UBApplication.h"
#include "core/UBSettings.h"

@ -29,7 +29,6 @@
#include <QtCore>
#include <QtSvg>
#include <QPrinter>
#include "core/UBApplication.h"
#include "core/UBSettings.h"

@ -29,7 +29,6 @@
#include <QtGui>
#include <QtXml>
#include <QDesktopWidget>
#include "core/UBSettings.h"
#include "core/UBApplication.h"

@ -30,7 +30,6 @@
#include <QtCore>
#include <QtXml>
#include <QGraphicsTextItem>
#include <QDomElement>
#include "domain/UBGraphicsSvgItem.h"
#include "domain/UBGraphicsPixmapItem.h"
@ -330,7 +329,7 @@ QUuid UBSvgSubsetAdaptor::sceneUuid(UBDocumentProxy* proxy, const int pageIndex)
UBGraphicsScene* UBSvgSubsetAdaptor::loadScene(UBDocumentProxy* proxy, const QByteArray& pArray)
{
UBSvgSubsetReader reader(proxy, UBTextTools::cleanHtmlCData(QString(pArray)).toLatin1());
UBSvgSubsetReader reader(proxy, UBTextTools::cleanHtmlCData(QString(pArray)).toAscii());
return reader.loadScene();
}
@ -1336,7 +1335,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro
QUuid uuid = UBGraphicsScene::getPersonalUuid(groupItem);
if (!uuid.isNull()) {
QDomElement curGroupElement = groupDomDocument->createElement(tGroup);
curGroupElement.setAttribute(aId, uuid.toString());
curGroupElement.setAttribute(aId, uuid);
UBGraphicsGroupContainerItem* group = dynamic_cast<UBGraphicsGroupContainerItem*>(groupItem);
if(group && group->Delegate()){
if(group->Delegate()->isLocked())
@ -1352,7 +1351,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro
persistGroupToDom(item, curParent, groupDomDocument);
else {
QDomElement curSubElement = groupDomDocument->createElement(tElement);
curSubElement.setAttribute(aId, tmpUuid.toString());
curSubElement.setAttribute(aId, tmpUuid);
curGroupElement.appendChild(curSubElement);
}
}
@ -1991,9 +1990,9 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::audioItemToLinkedAudio(UBGraphicsMed
graphicsItemToSvg(audioItem);
if (audioItem->mediaObject()->state() == QMediaPlayer::PausedState && (audioItem->mediaObject()->duration() - audioItem->mediaObject()->position()) > 0)
if (audioItem->mediaObject()->state() == Phonon::PausedState && audioItem->mediaObject()->remainingTime() > 0)
{
qint64 pos = audioItem->mediaObject()->position();
qint64 pos = audioItem->mediaObject()->currentTime();
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "position", QString("%1").arg(pos));
}
@ -2020,9 +2019,9 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::videoItemToLinkedVideo(UBGraphicsMed
graphicsItemToSvg(videoItem);
if (videoItem->mediaObject()->state() == QMediaPlayer::PausedState && (videoItem->mediaObject()->duration() - videoItem->mediaObject()->position()) > 0)
if (videoItem->mediaObject()->state() == Phonon::PausedState && videoItem->mediaObject()->remainingTime() > 0)
{
qint64 pos = videoItem->mediaObject()->position();
qint64 pos = videoItem->mediaObject()->currentTime();
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "position", QString("%1").arg(pos));
}
@ -2140,7 +2139,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
{
if (!svgX.isNull() && !svgY.isNull())
{
#ifdef Q_OS_WIN
#ifdef Q_WS_WIN
gItem->setPos(svgX.toString().toFloat(), svgY.toString().toFloat());
#endif
}

@ -30,7 +30,6 @@
#include <QtGui>
#include <QtXml>
#include <QGraphicsItem>
#include "frameworks/UBGeometryUtils.h"

@ -95,7 +95,7 @@ const QPixmap* UBThumbnailAdaptor::get(UBDocumentProxy* proxy, int pageIndex)
if (file.exists())
{
//Warning. Works only with modified Qt
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
pix->load(fileName, 0, Qt::AutoColor);
#else
pix->load(fileName, 0, Qt::AutoColor, false);

@ -24,7 +24,7 @@
#include <QPushButton>
#include "UBDocumentPublisher.h"

@ -30,13 +30,6 @@
#include <QtGui>
#include <QtNetwork>
#include <QDialog>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QDialogButtonBox>
#include <QLabel>
#include <QLineEdit>
#include <QTextEdit>
typedef struct
{

@ -30,7 +30,6 @@
#include <QtGui>
#include <QtWebKit>
#include <QWebView>
class UBLibraryAPI : public QObject
{

@ -59,7 +59,7 @@ UBW3CWidgetAPI::~UBW3CWidgetAPI()
QString UBW3CWidgetAPI::uuid()
{
if (mGraphicsW3CWidget)
return mGraphicsW3CWidget->uuid().toString();
return mGraphicsW3CWidget->uuid();
else
return "";
}

@ -23,7 +23,7 @@
*/
#include <QWebFrame>
#include "UBWidgetMessageAPI.h"

@ -514,7 +514,7 @@ void UBWidgetUniboardAPI::ProcessDropEvent(QGraphicsSceneDragDropEvent *event)
QString str = "test string";
QMimeData mimeData;
mimeData.setData(tMimeText, str.toLatin1());
mimeData.setData(tMimeText, str.toAscii());
sDownloadFileDesc desc;
desc.dest = sDownloadFileDesc::graphicsWidget;
@ -556,7 +556,7 @@ void UBWidgetUniboardAPI::ProcessDropEvent(QGraphicsSceneDragDropEvent *event)
}
qDebug() << destFileName;
QString mimeText = createMimeText(downloaded, contentType, destFileName);
dropMimeData->setData(tMimeText, mimeText.toLatin1());
dropMimeData->setData(tMimeText, mimeText.toAscii());
event->setMimeData(dropMimeData);
}
@ -588,7 +588,7 @@ void UBWidgetUniboardAPI::onDownloadFinished(bool pSuccess, sDownloadFileDesc de
}
}
QString destFileName = objDir + QUuid::createUuid().toString() + "." + extention;
QString destFileName = objDir + QUuid::createUuid() + "." + extention;
QFile destFile(destFileName);
if (!destFile.open(QIODevice::WriteOnly)) {
@ -606,7 +606,7 @@ void UBWidgetUniboardAPI::onDownloadFinished(bool pSuccess, sDownloadFileDesc de
QMimeData dropMimeData;
QString mimeText = createMimeText(true, contentType, destFileName);
dropMimeData.setData(tMimeText, mimeText.toLatin1());
dropMimeData.setData(tMimeText, mimeText.toAscii());
destFile.close();

@ -86,7 +86,7 @@
#include "core/memcheck.h"
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
#include <QProcess>
bool onboardIsAlreadyRunning = true;
#endif
@ -165,7 +165,7 @@ void UBBoardController::init()
UBBoardController::~UBBoardController()
{
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
if(!onboardIsAlreadyRunning){
QProcess newProcess;
newProcess.startDetached("killall onboard");
@ -828,7 +828,7 @@ void UBBoardController::showKeyboard(bool show)
if(show)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
static bool isFirstTime = true;
if(isFirstTime){
QProcess isAlreadyRunningProcess;
@ -2411,7 +2411,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
}
}
else{
#ifdef Q_OS_OSX
#ifdef Q_WS_MACX
// With Safari, in 95% of the drops, the mime datas are hidden in Apple Web Archive pasteboard type.
// This is due to the way Safari is working so we have to dig into the pasteboard in order to retrieve
// the data.

@ -31,9 +31,6 @@
#include <QtGui>
#include <QObject>
#include <QHBoxLayout>
#include <QUndoCommand>
#include "document/UBDocumentContainer.h"
#include "core/UBApplicationController.h"

@ -225,7 +225,7 @@ void UBBoardPaletteManager::setupPalettes()
if (UBPlatformUtils::hasVirtualKeyboard())
{
mKeyboardPalette = new UBKeyboardPalette(0);
#ifndef Q_OS_WIN
#ifndef Q_WS_WIN
connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated()));
#endif
}
@ -677,7 +677,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
mLeftPalette->setVisible(leftPaletteVisible);
mRightPalette->setVisible(rightPaletteVisible);
#ifdef Q_OS_WIN
#ifdef Q_WS_WIN
if (rightPaletteVisible)
mRightPalette->setAdditionalVOffset(0);
#endif
@ -702,24 +702,24 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
if(mKeyboardPalette->m_isVisible)
{
mKeyboardPalette->hide();
#ifndef Q_OS_LINUX
#ifndef Q_WS_X11
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
#else
mKeyboardPalette->setParent(0);
#endif
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
mKeyboardPalette->setWindowFlags(Qt::Dialog | Qt::Popup | Qt::FramelessWindowHint);
#endif
mKeyboardPalette->show();
}
else
// In linux keyboard in desktop mode have to allways be with null parent
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
mKeyboardPalette->setParent(0);
#else
mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
#endif //Q_OS_LINUX
#ifdef Q_OS_OSX
#endif //Q_WS_X11
#ifdef Q_WS_MAC
mKeyboardPalette->setWindowFlags(Qt::Dialog | Qt::Popup | Qt::FramelessWindowHint);
#endif
@ -727,7 +727,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
mLeftPalette->setVisible(leftPaletteVisible);
mRightPalette->setVisible(rightPaletteVisible);
#ifdef Q_OS_WIN
#ifdef Q_WS_WIN
if (rightPaletteVisible && UBSettings::settings()->appToolBarPositionedAtTop->get().toBool())
mRightPalette->setAdditionalVOffset(30);
#endif

@ -55,7 +55,7 @@
#include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
#include "core/UBApplicationController.h"
#include "desktop/UBDesktopAnnotationController.h"
#endif
@ -366,7 +366,7 @@ void UBBoardView::tabletEvent (QTabletEvent * event)
}
bool acceptEvent = true;
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
//Work around #1388. After selecting annotation tool in desktop mode, annotation view appears on top when
//using Mac OS X. In this case tablet event should send mouse event so as to let user interact with
//stylus palette.
@ -750,13 +750,13 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
if (itemShouldReceiveMousePressEvent(movingItem)){
QGraphicsView::mousePressEvent (event);
QGraphicsItem* item = determineItemToPress(scene()->itemAt(this->mapToScene(event->localPos().toPoint()), transform()));
QGraphicsItem* item = determineItemToPress(scene()->itemAt(this->mapToScene(event->posF().toPoint()), transform()));
//use QGraphicsView::transform() to use not deprecated QGraphicsScene::itemAt() method
if (item && (item->type() == QGraphicsProxyWidget::Type) && item->parentObject() && item->parentObject()->type() != QGraphicsProxyWidget::Type)
{
//Clean up children
QList<QGraphicsItem*> children = item->childItems();
QList<QGraphicsItem*> children = item->children();
for( QList<QGraphicsItem*>::iterator it = children.begin(); it != children.end(); ++it )
if ((*it)->pos().x() < 0 || (*it)->pos().y() < 0)
@ -865,7 +865,7 @@ void UBBoardView::setMultiselection(bool enable)
}
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_OS_OSX)
#if defined(Q_WS_MACX)
bool UBBoardView::directTabletEvent(QEvent *event)
{
QTabletEvent *tEvent = static_cast<QTabletEvent *>(event);
@ -905,7 +905,7 @@ QWidget *UBBoardView::widgetForTabletEvent(QWidget *w, const QPoint &pos)
QWidget *childAtPos = NULL;
QList<QObject *> childs = w->childItems();
QList<QObject *> childs = w->children();
foreach(QObject *child, childs)
{
QWidget *childWidget = qobject_cast<QWidget *>(child);
@ -972,7 +972,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
}
mMouseDownPos = event->pos ();
movingItem = scene()->itemAt(this->mapToScene(event->localPos().toPoint()), QTransform());
movingItem = scene()->itemAt(this->mapToScene(event->posF().toPoint()));
if (event->button () == Qt::LeftButton && isInteractive())
{
@ -993,7 +993,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
case UBStylusTool::Hand :
viewport()->setCursor(QCursor (Qt::ClosedHandCursor));
mPreviousPoint = event->localPos();
mPreviousPoint = event->posF();
event->accept();
break;
@ -1107,7 +1107,7 @@ void UBBoardView::mouseMoveEvent (QMouseEvent *event)
if (!mMouseButtonIsPressed && !mTabletStylusIsPressed) {
break;
}
QPointF eventPosition = event->localPos();
QPointF eventPosition = event->posF ();
qreal dx = eventPosition.x () - mPreviousPoint.x ();
qreal dy = eventPosition.y () - mPreviousPoint.y ();
mController->handScroll (dx, dy);
@ -1230,7 +1230,7 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
graphicsItem->Delegate()->commitUndoStep();
bool bReleaseIsNeed = true;
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->localPos().toPoint()), QTransform())))
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->posF().toPoint()))))
{
movingItem = NULL;
bReleaseIsNeed = false;
@ -1299,7 +1299,7 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
graphicsItem->Delegate()->commitUndoStep();
bool bReleaseIsNeed = true;
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->localPos().toPoint()), QTransform())))
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->posF().toPoint()))))
{
movingItem = NULL;
bReleaseIsNeed = false;
@ -1475,7 +1475,7 @@ void UBBoardView::wheelEvent (QWheelEvent *wheelEvent)
QPointF scenePos = mapToScene(wheelEvent->pos());
QList<QGraphicsItem *> itemsList = scene()->items(scenePos);
bool isSelectedAndMouseHower = itemsList.contains(selItem);
QBool isSelectedAndMouseHower = itemsList.contains(selItem);
if(isSelectedAndMouseHower)
{
QGraphicsView::wheelEvent(wheelEvent);

@ -30,9 +30,6 @@
#define CONTROLVIEW_OBJ_NAME "ControlView"
#include <QtGui>
#include <QGraphicsView>
#include <QRubberBand>
#include "core/UB.h"
#include "domain/UBGraphicsDelegateFrame.h"
@ -63,7 +60,7 @@ public:
void setMultiselection(bool enable);
bool isMultipleSelectionEnabled() { return mMultipleSelectionIsEnabled; }
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_OS_OSX)
#if defined(Q_WS_MACX)
bool directTabletEvent(QEvent *event);
QWidget *widgetForTabletEvent(QWidget *w, const QPoint &pos);
#endif

@ -346,6 +346,7 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
scanFS();
featuresModel = new UBFeaturesModel(featuresList, this);
featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);
featuresProxyModel = new UBFeaturesProxyModel(this);
featuresProxyModel->setFilterFixedString(rootPath);

@ -43,7 +43,6 @@
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include <QListView>
class UBFeaturesModel;
class UBFeaturesItemDelegate;

@ -29,7 +29,6 @@
#define UB_H_
#include <QtGui>
#include <QGraphicsItem>
#define UB_MAX_ZOOM 9

@ -31,9 +31,8 @@
#include <QtWebKit>
#include <QtXml>
#include <QFontDatabase>
#include <QStyleFactory>
#if defined(Q_OS_OSX)
#if defined(Q_WS_MACX)
#include <Carbon/Carbon.h>
#endif
@ -85,13 +84,13 @@ const QString UBApplication::mimeTypeUniboardPage = QString("application/vnd.mne
const QString UBApplication::mimeTypeUniboardPageItem = QString("application/vnd.mnemis-uniboard-page-item");
const QString UBApplication::mimeTypeUniboardPageThumbnail = QString("application/vnd.mnemis-uniboard-thumbnail");
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
bool bIsMinimized = false;
#endif
QObject* UBApplication::staticMemoryCleaner = 0;
#if defined(Q_OS_OSX)
#if defined(Q_WS_MAC)
static OSStatus ub_appleEventProcessor(const AppleEvent *ae, AppleEvent *event, long handlerRefCon)
{
Q_UNUSED(event);
@ -154,11 +153,11 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
connect(settings->appToolBarDisplayText, SIGNAL(changed(QVariant)), this, SLOT(toolBarDisplayTextChanged(QVariant)));
updateProtoActionsState();
#ifndef Q_OS_OSX
#ifndef Q_WS_MAC
setWindowIcon(QIcon(":/images/OpenBoard.png"));
#endif
setStyle("fusion");
setStyle(new UBStyle()); // Style is owned and deleted by the application
QString css = UBFileSystemUtils::readTextFile(UBPlatformUtils::applicationResourcesDirectory() + "/etc/"+ qApp->applicationName()+".css");
if (css.length() > 0)
@ -338,7 +337,7 @@ int UBApplication::exec(const QString& pFileToImport)
connect(mainWindow->actionDesktop, SIGNAL(triggered(bool)), applicationController, SLOT(showDesktop(bool)));
connect(mainWindow->actionDesktop, SIGNAL(triggered(bool)), this, SLOT(stopScript()));
#ifndef Q_OS_OSX
#ifndef Q_WS_MAC
connect(mainWindow->actionHideApplication, SIGNAL(triggered()), mainWindow, SLOT(showMinimized()));
#else
connect(mainWindow->actionHideApplication, SIGNAL(triggered()), this, SLOT(showMinimized()));
@ -368,7 +367,7 @@ int UBApplication::exec(const QString& pFileToImport)
if (pFileToImport.length() > 0)
UBApplication::applicationController->importFile(pFileToImport);
#if defined(Q_OS_OSX)
#if defined(Q_WS_MAC)
static AEEventHandlerUPP ub_proc_ae_handlerUPP = AEEventHandlerUPP(ub_appleEventProcessor);
AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, ub_proc_ae_handlerUPP, SRefCon(UBApplication::applicationController), true);
#endif
@ -390,7 +389,7 @@ void UBApplication::onScreenCountChanged(int newCount)
mainWindow->actionMultiScreen->setEnabled(displayManager.numScreens() > 1);
}
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
void UBApplication::showMinimized()
{
mainWindow->hide();
@ -539,7 +538,7 @@ void UBApplication::decorateActionMenu(QAction* action)
menu->addSeparator();
#ifndef Q_OS_LINUX // No Podcast on Linux yet
#ifndef Q_WS_X11 // No Podcast on Linux yet
menu->addAction(mainWindow->actionPodcast);
mainWindow->actionPodcast->setText(tr("Podcast"));
#endif
@ -590,7 +589,7 @@ bool UBApplication::eventFilter(QObject *obj, QEvent *event)
{
QFileOpenEvent *fileToOpenEvent = static_cast<QFileOpenEvent *>(event);
#if defined(Q_OS_OSX)
#if defined(Q_WS_MACX)
ProcessSerialNumber psn;
GetCurrentProcess(&psn);
SetFrontProcess(&psn);
@ -611,7 +610,7 @@ bool UBApplication::eventFilter(QObject *obj, QEvent *event)
boardController->controlView()->setMultiselection(false);
}
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
if (bIsMinimized && event->type() == QEvent::ApplicationActivate){
if (mainWindow->isHidden()) mainWindow->show();
bIsMinimized = false;
@ -651,6 +650,39 @@ void UBApplication::cleanup()
documentController = NULL;
}
void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
bool enabled, const QString& text, QPalette::ColorRole textRole) const
{
if (text.isEmpty())
return;
QPen savedPen;
if (textRole != QPalette::NoRole)
{
savedPen = painter->pen();
painter->setPen(QPen(pal.brush(textRole), savedPen.widthF()));
}
if (!enabled)
{
QPen pen = painter->pen();
QColor half = pen.color();
half.setRed(half.red() / 2);
half.setGreen(half.green() / 2);
half.setBlue(half.blue() / 2);
painter->setPen(half);
painter->drawText(rect, alignment, text);
painter->setPen(pen);
}
painter->drawText(rect, alignment, text);
if (textRole != QPalette::NoRole)
painter->setPen(savedPen);
}
QString UBApplication::urlFromHtml(QString html)
{
QString _html;

@ -29,9 +29,6 @@
#define UBAPPLICATION_H_
#include <QtGui>
#include <QUndoStack>
#include <QToolBar>
#include <QMenu>
#include "qtsingleapplication.h"
@ -124,7 +121,7 @@ class UBApplication : public QtSingleApplication
private slots:
void closing();
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
void showMinimized();
#endif
void onScreenCountChanged(int newCount);
@ -137,7 +134,7 @@ class UBApplication : public QtSingleApplication
QString checkLanguageAvailabilityForSankore(QString& language);
protected:
#if defined(Q_OS_OSX) && !defined(QT_MAC_USE_COCOA)
#if defined(Q_WS_MACX) && !defined(QT_MAC_USE_COCOA)
bool macEventFilter(EventHandlerCallRef caller, EventRef event);
#endif
@ -147,4 +144,29 @@ class UBApplication : public QtSingleApplication
};
class UBStyle : public QPlastiqueStyle
{
public:
UBStyle()
: QPlastiqueStyle()
{
// NOOP
}
virtual ~UBStyle()
{
// NOOP
}
/*
* redefined to be more cocoa like on texts
*/
virtual void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
bool enabled, const QString& text, QPalette::ColorRole textRole) const;
};
#endif /* UBAPPLICATION_H_ */

@ -22,9 +22,7 @@
* along with OpenBoard. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QScriptValue>
#include <QScriptEngine>
#include <QUrl>
#include "UBApplicationController.h"
@ -67,7 +65,7 @@
#include "ui_mainWindow.h"
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
#include <Carbon/Carbon.h>
#endif
@ -88,6 +86,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView,
, mAutomaticCheckForUpdates(false)
, mCheckingForUpdates(false)
, mIsShowingDesktop(false)
, mHttp(0)
{
mDisplayManager = new UBDisplayManager(this);
@ -122,7 +121,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView,
QTimer::singleShot (1000, this, SLOT (checkAtLaunch()));
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
mMainWindow->setStyleSheet("QToolButton { font-size: 11px}");
#endif
@ -138,6 +137,7 @@ UBApplicationController::~UBApplicationController()
delete mBlackScene;
delete mMirror;
if (mHttp) delete mHttp;
delete(mOpenSankoreImporter);
mOpenSankoreImporter = NULL;
@ -478,53 +478,45 @@ void UBApplicationController::showDesktop(bool dontSwitchFrontProcess)
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
}
void UBApplicationController::checkUpdate(QString urlString)
{
//connect(networkAccessManager, &QNetworkAccessManager::finished,
// this, &UBApplicationController::updateRequestFinished);
connect(networkAccessManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(updateRequestFinished(QNetworkReply*)));
networkAccessManager->get(QNetworkRequest(QUrl(urlString)));
if(mHttp)
mHttp->deleteLater();
QUrl url(urlString);
mHttp = new QHttp(url.host());
connect(mHttp, SIGNAL(requestFinished(int,bool)), this, SLOT(updateRequestFinished(int,bool)));
connect(mHttp, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), this, SLOT(updateHeaderReceived(QHttpResponseHeader)));
mHttp->get(url.path());
}
void UBApplicationController::updateRequestFinished(QNetworkReply * reply)
void UBApplicationController::updateHeaderReceived(QHttpResponseHeader header)
{
if (reply->error()) {
qWarning() << "HTTP Error";
return;
if(header.statusCode() == 302 && header.hasKey("Location")){
mHttp->close();
checkUpdate(header.value("Location"));
}
// Check if we are being redirected. If so, call checkUpdate again
QVariant redirect_target = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (!redirect_target.isNull()) {
// The returned URL might be relative. resolved() creates an absolute url from it
QUrl redirect_url(reply->url().resolved(redirect_target.toUrl()));
checkUpdate(redirect_url.toString());
return;
}
// No error and no redirect => we read the whole response
QString responseString = QString(reply->readAll());
void UBApplicationController::updateRequestFinished(int id, bool error)
{
if (error){
qWarning() << "http command id" << id << "return an error";
}
else{
QString responseString = QString(mHttp->readAll());
qDebug() << responseString;
if (!responseString.isEmpty() &&
responseString.contains("version") &&
responseString.contains("url")) {
reply->close();
reply->deleteLater();
if (!responseString.isEmpty() && responseString.contains("version") && responseString.contains("url")){
mHttp->close();
mHttp->deleteLater();
mHttp = 0;
downloadJsonFinished(responseString);
}
}
}
void UBApplicationController::downloadJsonFinished(QString currentJson)

@ -29,6 +29,8 @@
#define UBAPPLICATIONCONTROLLER_H_
#include <QtGui>
#include <QFtp>
#include <QHttpResponseHeader>
class UBBoardView;
@ -144,7 +146,8 @@ class UBApplicationController : public QObject
void checkAtLaunch();
private slots:
void updateRequestFinished(QNetworkReply * reply);
void updateRequestFinished(int id, bool error);
void updateHeaderReceived(QHttpResponseHeader header);
protected:
@ -183,6 +186,7 @@ class UBApplicationController : public QObject
QNetworkAccessManager *networkAccessManager;
void downloadJsonFinished(QString updateString);
QHttp* mHttp;
};
#endif /* UBAPPLICATIONCONTROLLER_H_ */

@ -41,8 +41,6 @@
#include "core/memcheck.h"
#include "qdesktopwidget.h"
UBDisplayManager::UBDisplayManager(QObject *parent)
: QObject(parent)
, mControlScreenIndex(-1)
@ -57,8 +55,8 @@ UBDisplayManager::UBDisplayManager(QObject *parent)
initScreenIndexes();
connect(mDesktop, &QDesktopWidget::resized, this, &UBDisplayManager::adjustScreens);
connect(mDesktop, &QDesktopWidget::workAreaResized, this, &UBDisplayManager::adjustScreens);
connect(mDesktop, SIGNAL(resized(int)), this, SLOT(adjustScreens(int)));
connect(mDesktop, SIGNAL(workAreaResized(int)), this, SLOT(adjustScreens(int)));
}

@ -32,7 +32,6 @@
class UBBlackoutWidget;
class UBBoardView;
class QDesktopWidget;
class UBDisplayManager : public QObject
{

@ -168,7 +168,7 @@ UBDocumentProxy* UBDocumentManager::importFile(const QFile& pFile, const QString
foreach(UBGraphicsItem* page, pages)
{
UBApplication::showMessage(tr("Inserting page %1 of %2").arg(++nPage).arg(pages.size()), true);
#ifdef Q_OS_OSX
#ifdef Q_WS_MACX
//Workaround for issue 912
QApplication::processEvents();
#endif

@ -77,7 +77,7 @@ void UBAsyncLocalFileDownloader::run()
if (mDesc.originalSrcUrl.isEmpty())
mDesc.originalSrcUrl = mDesc.srcUrl;
QString uuid = QUuid::createUuid().toString();
QString uuid = QUuid::createUuid();
UBPersistenceManager::persistenceManager()->addFileToDocument(UBApplication::boardController->selectedDocument(),
mDesc.srcUrl,
destDirectory,
@ -399,7 +399,8 @@ void UBDownloadManager::startFileDownload(sDownloadFileDesc desc)
connect(http, SIGNAL(downloadFinished(int, bool, QUrl, QUrl, QString, QByteArray, QPointF, QSize, bool)), this, SLOT(onDownloadFinished(int, bool, QUrl, QUrl, QString, QByteArray, QPointF, QSize, bool)));
//the desc.srcUrl is encoded. So we have to decode it before.
QUrl url = QUrl::fromEncoded(desc.srcUrl.toUtf8());
QUrl url;
url.setEncodedUrl(desc.srcUrl.toUtf8());
// We send here the request and store its reply in order to be able to cancel it if needed
mDownloads[desc.id] = dynamic_cast<QObject *>(http->get(url, desc.pos, desc.size, desc.isBackground));
}

@ -50,9 +50,9 @@ UBOpenSankoreImporter::UBOpenSankoreImporter(QWidget* mainWidget, QObject *paren
void UBOpenSankoreImporter::onProceedClicked()
{
QProcess newProcess;
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
newProcess.startDetached(qApp->applicationDirPath()+"/Importer/OpenBoardImporter");
#elif defined Q_OS_OSX
#elif defined Q_WS_MACX
newProcess.startDetached(qApp->applicationDirPath()+"/../Resources/OpenBoardImporter.app/Contents/MacOS/OpenBoardImporter");
#else
// Windows does not allows to run easily an exe located in a subdirectory when the main

@ -596,7 +596,7 @@ void UBPersistenceManager::duplicateDocumentScene(UBDocumentProxy* proxy, int in
UBGraphicsPixmapItem* pixmapItem = qgraphicsitem_cast<UBGraphicsPixmapItem*>(item);
if(pixmapItem){
QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + pixmapItem->uuid().toString() + ".png";
QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + pixmapItem->uuid() + ".png";
QString destination = source;
QUuid newUuid = QUuid::createUuid();
QString fileName = QFileInfo(source).completeBaseName();
@ -608,7 +608,7 @@ void UBPersistenceManager::duplicateDocumentScene(UBDocumentProxy* proxy, int in
UBGraphicsSvgItem* svgItem = qgraphicsitem_cast<UBGraphicsSvgItem*>(item);
if(svgItem){
QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + svgItem->uuid().toString() + ".svg";
QString source = proxy->persistencePath() + "/" + UBPersistenceManager::imageDirectory + "/" + svgItem->uuid() + ".svg";
QString destination = source;
QUuid newUuid = QUuid::createUuid();
QString fileName = QFileInfo(source).completeBaseName();

@ -44,8 +44,6 @@
#include "core/memcheck.h"
#include "qdesktopwidget.h"
qreal UBPreferencesController::sSliderRatio = 10.0;
qreal UBPreferencesController::sMinPenWidth = 0.5;
qreal UBPreferencesController::sMaxPenWidth = 50.0;
@ -80,7 +78,7 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
mPreferencesUI = new Ui::preferencesDialog(); // deleted in
mPreferencesUI->setupUi(mPreferencesWindow);
adjustScreens(1);
connect(mDesktop, &QDesktopWidget::screenCountChanged, this, &UBPreferencesController::adjustScreens);
connect(mDesktop, SIGNAL(screenCountChanged(int)), this, SLOT(adjustScreens(int)));
wire();
}

@ -29,7 +29,6 @@
#define UBPREFERENCESCONTROLLER_H_
#include <QtGui>
#include <QDialog>
class UBColorPicker;
class UBApplication;

@ -306,7 +306,7 @@ void UBSettings::init()
bool defaultShowPageImmediatelyOnMirroredScreen = true;
#if defined(Q_OS_LINUX)
#if defined(Q_WS_X11)
// screen duplication is very slow on X11
defaultShowPageImmediatelyOnMirroredScreen = false;
#endif
@ -334,22 +334,22 @@ void UBSettings::init()
int defaultRefreshRateInFramePerSecond = 8;
#if defined(Q_OS_LINUX)
#if defined(Q_WS_X11)
// screen duplication is very slow on X11
defaultRefreshRateInFramePerSecond = 2;
#endif
mirroringRefreshRateInFps = new UBSetting(this, "Mirroring", "RefreshRateInFramePerSecond", QVariant(defaultRefreshRateInFramePerSecond));
lastImportFilePath = new UBSetting(this, "Import", "LastImportFilePath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastImportFolderPath = new UBSetting(this, "Import", "LastImportFolderPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastExportFilePath = new UBSetting(this, "Export", "LastExportFilePath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastExportDirPath = new UBSetting(this, "Export", "LastExportDirPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastImportToLibraryPath = new UBSetting(this, "Library", "LastImportToLibraryPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastImportFilePath = new UBSetting(this, "Import", "LastImportFilePath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastImportFolderPath = new UBSetting(this, "Import", "LastImportFolderPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastExportFilePath = new UBSetting(this, "Export", "LastExportFilePath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastExportDirPath = new UBSetting(this, "Export", "LastExportDirPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastImportToLibraryPath = new UBSetting(this, "Library", "LastImportToLibraryPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastPicturePath = new UBSetting(this, "Library", "LastPicturePath", QVariant(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)));
lastWidgetPath = new UBSetting(this, "Library", "LastWidgetPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)));
lastVideoPath = new UBSetting(this, "Library", "LastVideoPath", QVariant(QStandardPaths::writableLocation(QStandardPaths::MoviesLocation)));
lastPicturePath = new UBSetting(this, "Library", "LastPicturePath", QVariant(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation)));
lastWidgetPath = new UBSetting(this, "Library", "LastWidgetPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)));
lastVideoPath = new UBSetting(this, "Library", "LastVideoPath", QVariant(QDesktopServices::storageLocation(QDesktopServices::MoviesLocation)));
appOnlineUserName = new UBSetting(this, "App", "OnlineUserName", "");
@ -790,7 +790,7 @@ QString UBSettings::userDataDirectory()
qCritical() << "Impossible to create datadirpath " << dataDirPath;
}
dataDirPath = UBFileSystemUtils::normalizeFilePath(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
dataDirPath = UBFileSystemUtils::normalizeFilePath(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
dataDirPath.replace(qApp->organizationName() + "/", "");
}
return dataDirPath;
@ -811,7 +811,7 @@ QString UBSettings::userImageDirectory()
qCritical() << "failed to create image directory " << imageDirectory;
}
imageDirectory = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation) + "/" + qApp->applicationName();
imageDirectory = QDesktopServices::storageLocation(QDesktopServices::PicturesLocation) + "/" + qApp->applicationName();
checkDirectory(imageDirectory);
}
return imageDirectory;
@ -832,10 +832,10 @@ QString UBSettings::userVideoDirectory()
}
videoDirectory = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
videoDirectory = QDesktopServices::storageLocation(QDesktopServices::MoviesLocation);
if(videoDirectory.isEmpty())
videoDirectory = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/" + tr("My Movies");
videoDirectory = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation) + "/" + tr("My Movies");
else
videoDirectory = videoDirectory + "/" + qApp->applicationName();
@ -858,7 +858,7 @@ QString UBSettings::userAudioDirectory()
qCritical() << "failed to create image directory " << audioDirectory;
}
audioDirectory = QStandardPaths::writableLocation(QStandardPaths::MusicLocation) + "/" + qApp->applicationName();
audioDirectory = QDesktopServices::storageLocation(QDesktopServices::MusicLocation) + "/" + qApp->applicationName();
checkDirectory(audioDirectory);
}
return audioDirectory;
@ -879,7 +879,7 @@ QString UBSettings::userPodcastRecordingDirectory()
qCritical() << "failed to create dir " << dirPath;
}
dirPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
dirPath = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
checkDirectory(dirPath);
}
return dirPath;
@ -1246,13 +1246,13 @@ QString UBSettings::replaceWildcard(QString& path)
QString result(path);
if (result.startsWith("{Documents}")) {
result = result.replace("{Documents}", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation));
result = result.replace("{Documents}", QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation));
}
else if(result.startsWith("{Home}")) {
result = result.replace("{Home}", QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
result = result.replace("{Home}", QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
}
else if(result.startsWith("{Desktop}")) {
result = result.replace("{Desktop}", QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
result = result.replace("{Desktop}", QDesktopServices::storageLocation(QDesktopServices::DesktopLocation));
}
if(result.contains("{UserLoginName}") && UBPlatformUtils::osUserLoginName().length() > 0) {

@ -45,21 +45,21 @@
#endif
*/
void ub_message_output(QtMsgType type, const QMessageLogContext& context, const QString& msg) {
void ub_message_output(QtMsgType type, const char *msg) {
// We must temporarily remove the handler to avoid the infinite recursion of
// ub_message_output -> qt_message_output -> ub_message_output -> qt_message_output ...
QtMessageHandler previousHandler = qInstallMessageHandler(0);
QtMsgHandler previousHandler = qInstallMsgHandler(0);
#if defined(QT_NO_DEBUG)
// Suppress qDebug output in release builds
if (type != QtDebugMsg)
{
qt_message_output(type, context, msg);
qt_message_output(type, msg);
}
#else
// Default output in debug builds
qt_message_output(type, context, msg);
qt_message_output(type, msg);
#endif
if (UBApplication::app() && UBApplication::app()->isVerbose()) {
@ -77,7 +77,7 @@ void ub_message_output(QtMsgType type, const QMessageLogContext& context, const
}
}
qInstallMessageHandler(previousHandler);
qInstallMsgHandler(previousHandler);
}
int main(int argc, char *argv[])
@ -93,19 +93,25 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(OpenBoard);
qInstallMessageHandler(ub_message_output);
qInstallMsgHandler(ub_message_output);
/*
* setGraphicsSystem is obsolete in Qt5, made redundant by the QPA framework.
* TODO: check if this works ok, if not, explore how to use QPA framework
#if defined(Q_OS_LINUX)
#if defined(Q_WS_X11)
qDebug() << "Setting GraphicsSystem to raster";
QApplication::setGraphicsSystem("raster");
#endif
*/
UBApplication app("OpenBoard", argc, argv);
//BUGFIX:
//when importing a OpenBoard file that contains a non standard character
//the codecForLocale or the codecForCString is used to convert the file path
//into a const char*. This is why in french windows setup the codec name shouldn't be
//set to UTF-8. For example, setting UTF-8, will convert "Haïti" into "HaÂ-ti.
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QStringList args = app.arguments();
QString dumpPath = UBSettings::userDataDirectory() + "/log";
@ -132,7 +138,7 @@ int main(int argc, char *argv[])
}
}
//app.initialize(false); // should not be needed anymore
app.initialize(false);
QObject::connect(&app, SIGNAL(messageReceived(const QString&)), &app, SLOT(handleOpenMessage(const QString&)));

@ -24,9 +24,6 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QStyle>
#include "UBCustomCaptureWindow.h"

@ -29,9 +29,6 @@
#define UBCUSTOMCAPTUREWINDOW_H_
#include <QtGui>
#include <QDialog>
#include <QRubberBand>
/**
* This class is used to do the custom capture of Uninotes
**/

@ -80,7 +80,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
mTransparentDrawingView = new UBBoardView(UBApplication::boardController, static_cast<QWidget*>(0), false, true); // deleted in UBDesktopAnnotationController::destructor
mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true);
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true);
#endif
mTransparentDrawingView->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Window);
@ -109,7 +109,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)),
mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(refreshMask()));
connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask()));
@ -162,7 +162,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB
connect(&mHoldTimerMarker, SIGNAL(timeout()), this, SLOT(markerActionReleased()));
connect(&mHoldTimerEraser, SIGNAL(timeout()), this, SLOT(eraserActionReleased()));
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
connect(mDesktopPalette, SIGNAL(moving()), this, SLOT(refreshMask()));
connect(UBApplication::boardController->paletteManager()->rightPalette(), SIGNAL(resized()), this, SLOT(refreshMask()));
connect(UBApplication::boardController->paletteManager()->addItemPalette(), SIGNAL(closed()), this, SLOT(refreshMask()));
@ -331,7 +331,7 @@ void UBDesktopAnnotationController::showWindow()
UBDrawingController::drawingController()->setStylusTool(mDesktopStylusTool);
#ifndef Q_OS_LINUX
#ifndef Q_WS_X11
mTransparentDrawingView->showFullScreen();
#else
// this is necessary to avoid unity to hide the panels
@ -341,7 +341,7 @@ void UBDesktopAnnotationController::showWindow()
mDesktopPalette->appear();
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
updateMask(true);
#endif
}
@ -375,18 +375,18 @@ void UBDesktopAnnotationController::updateBackground()
|| UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Selector)
{
newBrush = QBrush(Qt::transparent);
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
updateMask(true);
#endif
}
else
{
#if defined(Q_OS_OSX)
#if defined(Q_WS_MAC)
newBrush = QBrush(QColor(127, 127, 127, 15));
#else
newBrush = QBrush(QColor(127, 127, 127, 1));
#endif
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
updateMask(false);
#endif
}
@ -430,7 +430,7 @@ void UBDesktopAnnotationController::customCapture()
UBCustomCaptureWindow customCaptureWindow(mDesktopPalette);
// need to show the window before execute it to avoid some glitch on windows.
#ifndef Q_OS_WIN // Working only without this call on win32 desktop mode
#ifndef Q_WS_WIN // Working only without this call on win32 desktop mode
customCaptureWindow.show();
#endif
@ -901,7 +901,7 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
p.drawRect(tabsPalette);
}
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
//Rquiered only for compiz wm
//TODO. Window manager detection screen

@ -171,7 +171,7 @@ void UBDesktopPalette::minimizeMe(eMinimizedLocation location)
adjustSizeAndPosition();
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
emit refreshMask();
#endif
}
@ -201,7 +201,7 @@ void UBDesktopPalette::maximizeMe()
// Notify that the maximization has been done
emit maximized();
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
emit refreshMask();
#endif
}

@ -55,9 +55,9 @@ class UBDesktopPalette : public UBActionPalette
void windowClick();
void screenClick();
//#ifdef Q_OS_LINUX //TODO: check why this produces an error on linux if uncommented
#ifdef Q_WS_X11
void refreshMask();
//#endif
#endif
public slots:

@ -24,7 +24,6 @@
#include <QDialog>
#include "UBWindowCapture.h"
#include "UBDesktopAnnotationController.h"

@ -355,7 +355,7 @@ void UBDocumentController::setupViews()
}
}
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
mMainWindow->actionDelete->setShortcut(QKeySequence(Qt::Key_Backspace));
#endif
@ -394,7 +394,7 @@ void UBDocumentController::setupViews()
mDocumentUI->thumbnailWidget->setBackgroundBrush(UBSettings::documentViewLightColor);
#ifdef Q_OS_OSX
#ifdef Q_WS_MACX
mMessageWindow = new UBMessageWindow(NULL);
#else
mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget);
@ -1452,7 +1452,7 @@ void UBDocumentController::showMessage(const QString& message, bool showSpinning
QRect newSize = mDocumentUI->thumbnailWidget->geometry();
#ifdef Q_OS_OSX
#ifdef Q_WS_MACX
QPoint point(newSize.left() + margin, newSize.bottom() - mMessageWindow->height() - margin);
mMessageWindow->move(mDocumentUI->thumbnailWidget->mapToGlobal(point));
#else

@ -29,7 +29,6 @@
#define UBDOCUMENTCONTROLLER_H_
#include <QtGui>
#include <QTreeWidgetItem>
#include "document/UBDocumentContainer.h"
namespace Ui

@ -832,10 +832,9 @@ void UBGraphicsDelegateFrame::positionHandles()
}
resetTransform();
setTransform(QTransform::fromTranslate(center.x(), center.y()), true);
setTransform(QTransform().rotate(-angle), true);
setTransform(QTransform::fromTranslate(-center.x(), -center.y()), true);
//TODO: combine these transforms into one
translate(center.x(), center.y());
rotate(-angle);
translate(-center.x(), -center.y());
mBottomRightResizeGripSvgItem->setParentItem(this);
mBottomResizeGripSvgItem->setParentItem(this);

@ -297,7 +297,7 @@ QVariant UBGraphicsGroupContainerItem::itemChange(GraphicsItemChange change, con
{
QVariant newValue = Delegate()->itemChange(change, value);
foreach(QGraphicsItem *child, childItems())
foreach(QGraphicsItem *child, children())
{
UBGraphicsItem *item = dynamic_cast<UBGraphicsItem*>(child);
if (item)

@ -771,7 +771,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
qreal topXTitleBar = topX + (1.6 * mFrameWidth * mAntiScaleRatio);
qreal topYTitleBar = topY + frameButtonHeight *mAntiScaleRatio;
#ifndef Q_OS_LINUX
#ifndef Q_WS_X11
topYTitleBar += 5;
#endif
@ -792,7 +792,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
button->setParentItem(mFrame);
button->setPos(topXTitleBar + (k++ * (frameButtonHeight + 5)), topYTitleBar);
button->setTransform(tr);
button->setTransform(QTransform::fromScale(0.8, 0.8), true);
button->scale(0.8,0.8);
}
else if(button->getSection() == Qt::NoSection){
++l;
@ -1442,7 +1442,7 @@ void DelegateMediaControl::seekToMousePos(QPointF mousePos)
&& mDelegate->mediaObject() && mDelegate->mediaObject()->isSeekable())
{
qint64 tickPos = (mTotalTimeInMs/length)* (mouseX - minX);
mDelegate->mediaObject()->setPosition(tickPos);
mDelegate->mediaObject()->seek(tickPos);
//OSX is a bit lazy
updateTicker(tickPos);

@ -49,13 +49,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
{
update();
//mMediaObject = new Phonon::MediaObject(this);
mMediaObject = new QMediaPlayer(this);
//playlist = new QMediaPlaylist;
//mMediaObject->setPlaylist(playlist);
mMediaObject = new Phonon::MediaObject(this);
QString mediaPath = pMediaFileUrl.toString();
if ("" == mediaPath)
@ -65,23 +59,10 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
{
mMediaType = mediaType_Video;
//mAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
QAudioFormat format; // to define
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
//mAudioOutput = new QAudioOutput(format, this);
mAudioOutput = new QMediaPlayer;
//mMediaObject->setTickInterval(50);
mMediaObject->setPosition(50);
//mVideoWidget = new Phonon::VideoWidget(); // owned and destructed by the scene ...
mVideoWidget = new QVideoWidget(); // owned and destructed by the scene ...
//Phonon::createPath(mMediaObject, mVideoWidget);
mMediaObject->setVideoOutput(mVideoWidget);
mAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
mMediaObject->setTickInterval(50);
mVideoWidget = new Phonon::VideoWidget(); // owned and destructed by the scene ...
Phonon::createPath(mMediaObject, mVideoWidget);
if(mVideoWidget->sizeHint() == QSize(1,1)){
mVideoWidget->resize(320,240);
@ -91,19 +72,11 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
haveLinkedImage = true;
}
else if (mediaPath.toLower().contains("audios"))
{
else if (mediaPath.toLower().contains("audios")){
mMediaType = mediaType_Audio;
mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
QAudioFormat format;
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
// mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
//mAudioOutput = new QMediaPlayer(format, this);
mAudioOutput = new QMediaPlayer;
//mMediaObject->setTickInterval(1000);
mMediaObject->setTickInterval(1000);
mAudioWidget = new QWidget();
mAudioWidget->resize(320,26);
mAudioWidget->setMinimumSize(150,26);
@ -111,17 +84,16 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
haveLinkedImage = false;
}
//Phonon::createPath(mMediaObject, mAudioOutput);
//mSource = Phonon::MediaSource(pMediaFileUrl);
//mMediaObject->setCurrentSource(mSource);
mMediaObject->setMedia(pMediaFileUrl);
Phonon::createPath(mMediaObject, mAudioOutput);
mSource = Phonon::MediaSource(pMediaFileUrl);
mMediaObject->setCurrentSource(mSource);
// we should create delegate after media objects because delegate uses his properties at creation.
setDelegate(new UBGraphicsMediaItemDelegate(this, mMediaObject));
// delegate should be created earler because we setWidget calls resize event for graphics proxy widgt.
// resize uses delegate.
if (mediaType_Video == mMediaType)
@ -187,11 +159,7 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
absoluteMediaFilename = mMediaFileUrl.toLocalFile();
if (absoluteMediaFilename.length() > 0)
//mMediaObject->setCurrentSource(QMediaSource(absoluteMediaFilename));
mMediaObject->setMedia(QUrl::fromLocalFile(absoluteMediaFilename));
mMediaObject->setCurrentSource(Phonon::MediaSource(absoluteMediaFilename));
}
}
@ -235,9 +203,7 @@ void UBGraphicsMediaItem::hasMediaChanged(bool hasMedia)
{
if(hasMedia && mMediaObject->isSeekable())
{
//mMediaObject->seek(mInitialPos);
mMediaObject->setPosition(mInitialPos);
mMediaObject->seek(mInitialPos);
UBGraphicsMediaItemDelegate *med = dynamic_cast<UBGraphicsMediaItemDelegate *>(Delegate());
if (med)
med->updateTicker(initialPos());
@ -352,8 +318,7 @@ void UBGraphicsMediaItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QPointF eventPos = mapFromScene( event->scenePos());
QPointF translation = eventPos - mouseMovePos;
//translate(translation.x(), translation.y());
setPos(translation.x(), translation.y());
translate(translation.x(), translation.y());
}
mMouseMovePos = event->scenePos();

@ -28,20 +28,10 @@
#ifndef UBGRAPHICSMEDIAITEM_H
#define UBGRAPHICSMEDIAITEM_H
#include <QtWidgets/QGraphicsView>
#include "UBGraphicsProxyWidget.h"
//#include <phonon/AudioOutput>
//#include <phonon/MediaObject>
//#include <phonon/VideoWidget>
#include <QAudioOutput>
#include <QMediaObject>
#include <QMediaPlayer>
#include <QMediaService>
#include <QtMultimediaWidgets/QVideoWidget>
#include <QtMultimedia/QVideoFrame>
#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#include <phonon/VideoWidget>
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "frameworks/UBFileSystemUtils.h"
@ -73,9 +63,7 @@ public:
virtual void mediaFileUrl(QUrl url){mMediaFileUrl=url;}
//Phonon::MediaObject* mediaObject() const
QMediaPlayer* mediaObject() const
Phonon::MediaObject* mediaObject() const
{
return mMediaObject;
}
@ -92,9 +80,7 @@ public:
return mMuted;
}
// Phonon::VideoWidget* videoWidget() const
QVideoWidget* videoWidget() const
Phonon::VideoWidget* videoWidget() const
{
return mVideoWidget;
}
@ -129,18 +115,10 @@ protected:
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void clearSource();
//Phonon::MediaObject *mMediaObject;
//Phonon::VideoWidget *mVideoWidget;
//Phonon::AudioOutput *mAudioOutput;
//Phonon::MediaSource mSource;
QMediaPlayer *mMediaObject;
QMediaPlaylist *playlist;
QVideoWidget *mVideoWidget;
// QAudioOutput *mAudioOutput;
QMediaPlayer *mAudioOutput;
QMediaService *mSource;
Phonon::MediaObject *mMediaObject;
Phonon::VideoWidget *mVideoWidget;
Phonon::AudioOutput *mAudioOutput;
Phonon::MediaSource mSource;
QWidget *mAudioWidget;
private:

@ -43,7 +43,7 @@
#include "core/memcheck.h"
UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, QMediaPlayer* pMedia, QObject * parent)
UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent)
: UBGraphicsItemDelegate(pDelegated, parent, GF_COMMON
| GF_RESPECT_RATIO
| GF_TOOLBAR_USED
@ -56,22 +56,11 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD
QPalette palette;
palette.setBrush ( QPalette::Light, Qt::darkGray );
mMedia->setNotifyInterval(50);
connect(mMedia, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
this, SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus)));
connect(mMedia, SIGNAL(stateChanged(QMediaPlayer::State)),
this, SLOT(mediaStateChanged(QMediaPlayer::State)));
connect(mMedia, static_cast<void(QMediaPlayer::*)(QMediaPlayer::Error)>(&QMediaPlayer::error),
this, &UBGraphicsMediaItemDelegate::mediaError);
connect(mMedia, SIGNAL(positionChanged(qint64)),
this, SLOT(updateTicker(qint64)));
connect(mMedia, SIGNAL(durationChanged(qint64)),
this, SLOT(totalTimeChanged(qint64)));
mMedia->setTickInterval(50);
connect(mMedia, SIGNAL(stateChanged (Phonon::State, Phonon::State)), this, SLOT(mediaStateChanged (Phonon::State, Phonon::State)));
connect(mMedia, SIGNAL(finished()), this, SLOT(updatePlayPauseState()));
connect(mMedia, SIGNAL(tick(qint64)), this, SLOT(updateTicker(qint64)));
connect(mMedia, SIGNAL(totalTimeChanged(qint64)), this, SLOT(totalTimeChanged(qint64)));
if (delegated()->hasLinkedImage())
{
@ -106,12 +95,10 @@ void UBGraphicsMediaItemDelegate::buildButtons()
{
if(!mPlayPauseButton){
mPlayPauseButton = new DelegateButton(":/images/play.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mPlayPauseButton, SIGNAL(clicked(bool)),
this, SLOT(togglePlayPause()));
connect(mPlayPauseButton, SIGNAL(clicked(bool)), this, SLOT(togglePlayPause()));
mStopButton = new DelegateButton(":/images/stop.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mStopButton, SIGNAL(clicked(bool)),
mMedia, SLOT(stop()));
connect(mStopButton, SIGNAL(clicked(bool)), mMedia, SLOT(stop()));
mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem);
mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true);
@ -122,10 +109,8 @@ void UBGraphicsMediaItemDelegate::buildButtons()
else
mMuteButton = new DelegateButton(":/images/soundOn.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mMuteButton, SIGNAL(clicked(bool)),
delegated(), SLOT(toggleMute()));
connect(mMuteButton, SIGNAL(clicked(bool)),
this, SLOT(toggleMute())); // for changing button image
connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute()));
connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image
mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton;
@ -135,17 +120,10 @@ void UBGraphicsMediaItemDelegate::buildButtons()
if (mToolBarShowTimer)
{
connect(mPlayPauseButton, SIGNAL(clicked(bool)),
mToolBarShowTimer, SLOT(start()));
connect(mStopButton, SIGNAL(clicked(bool)),
mToolBarShowTimer, SLOT(start()));
connect(mMediaControl, SIGNAL(used()),
mToolBarShowTimer, SLOT(start()));
connect(mMuteButton, SIGNAL(clicked(bool)),
mToolBarShowTimer, SLOT(start()));
connect(mPlayPauseButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
connect(mStopButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
connect(mMediaControl, SIGNAL(used()), mToolBarShowTimer, SLOT(start()));
connect(mMuteButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
}
@ -217,82 +195,55 @@ UBGraphicsMediaItem* UBGraphicsMediaItemDelegate::delegated()
return dynamic_cast<UBGraphicsMediaItem*>(mDelegated);
}
void UBGraphicsMediaItemDelegate::togglePlayPause()
{
if (delegated() && delegated()->mediaObject()) {
QMediaPlayer * media = delegated()->mediaObject();
if (media->state() == QMediaPlayer::StoppedState)
Phonon::MediaObject* media = delegated()->mediaObject();
if (media->state() == Phonon::StoppedState) {
media->play();
else if (media->state() == QMediaPlayer::PlayingState) {
if ((media->duration() - media->position()) <= 0) {
} else if (media->state() == Phonon::PlayingState) {
if (media->remainingTime() <= 0) {
media->stop();
media->play();
}
else {
} else {
media->pause();
if(delegated()->scene())
delegated()->scene()->setModified(true);
}
}
else if (media->state() == QMediaPlayer::PausedState) {
if ((media->duration() - media->position()) <= 0)
} else if (media->state() == Phonon::PausedState) {
if (media->remainingTime() <= 0) {
media->stop();
media->play();
}
else if ( media->mediaStatus() == QMediaPlayer::LoadingMedia) {
delegated()->mediaObject()->setMedia(delegated()->mediaFileUrl());
media->play();
}
else if (media->error())
} else if ( media->state() == Phonon::LoadingState ) {
delegated()->mediaObject()->setCurrentSource(delegated()->mediaFileUrl());
media->play();
} else if (media->state() == Phonon::ErrorState){
qDebug() << "Error appeared." << media->errorString();
}
}
void UBGraphicsMediaItemDelegate::mediaStatusChanged(QMediaPlayer::MediaStatus status)
{
// Possible statuses are: UnknownMediaStatus, NoMedia, LoadingMedia, LoadedMedia,
// StalledMedia, BufferingMedia, BufferedMedia, EndOfMedia, InvalidMedia
if (status == QMediaPlayer::LoadedMedia)
mMediaControl->totalTimeChanged(delegated()->mediaObject()->duration());
// in most cases, the only necessary action is to update the play/pause state
updatePlayPauseState();
}
void UBGraphicsMediaItemDelegate::mediaStateChanged(QMediaPlayer::State state)
void UBGraphicsMediaItemDelegate::mediaStateChanged ( Phonon::State newstate, Phonon::State oldstate )
{
// Possible states are StoppedState, PlayingState and PausedState
// updatePlayPauseState handles this functionality
updatePlayPauseState();
}
Q_UNUSED(newstate);
Q_UNUSED(oldstate);
void UBGraphicsMediaItemDelegate::mediaError(QMediaPlayer::Error error)
if (oldstate == Phonon::LoadingState)
{
// Possible errors are NoError, ResourceError, FormatError, NetworkError, AccessDeniedError,
// ServiceMissingError
Q_UNUSED(error);
qDebug() << "Error appeared." << mMedia->errorString();
mMediaControl->totalTimeChanged(delegated()->mediaObject()->totalTime());
}
updatePlayPauseState();
}
void UBGraphicsMediaItemDelegate::updatePlayPauseState()
{
QMediaPlayer * media = delegated()->mediaObject();
Phonon::MediaObject* media = delegated()->mediaObject();
if (media->state() == QMediaPlayer::PlayingState)
if (media->state() == Phonon::PlayingState)
mPlayPauseButton->setFileName(":/images/pause.svg");
else
mPlayPauseButton->setFileName(":/images/play.svg");
@ -301,8 +252,8 @@ void UBGraphicsMediaItemDelegate::updatePlayPauseState()
void UBGraphicsMediaItemDelegate::updateTicker(qint64 time)
{
QMediaPlayer* media = delegated()->mediaObject();
mMediaControl->totalTimeChanged(media->duration());
Phonon::MediaObject* media = delegated()->mediaObject();
mMediaControl->totalTimeChanged(media->totalTime());
mMediaControl->updateTicker(time);
}

@ -29,8 +29,8 @@
#define UBGRAPHICSMEDIAITEMDELEGATE_H_
#include <QtGui>
#include <phonon/MediaObject>
#include <QTimer>
#include <QtMultimedia>
#include "core/UB.h"
#include "UBGraphicsItemDelegate.h"
@ -43,7 +43,7 @@ class UBGraphicsMediaItemDelegate : public UBGraphicsItemDelegate
Q_OBJECT
public:
UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, QMediaPlayer* pMedia, QObject * parent = 0);
UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent = 0);
virtual ~UBGraphicsMediaItemDelegate();
virtual void positionHandles();
@ -61,18 +61,14 @@ class UBGraphicsMediaItemDelegate : public UBGraphicsItemDelegate
void togglePlayPause();
void mediaStateChanged ( Phonon::State newstate, Phonon::State oldstate );
void updatePlayPauseState();
void totalTimeChanged(qint64 newTotalTime);
void hideToolBar();
void mediaStatusChanged(QMediaPlayer::MediaStatus status);
void mediaStateChanged(QMediaPlayer::State state);
void mediaError(QMediaPlayer::Error error);
protected:
virtual void buildButtons();
@ -83,7 +79,7 @@ class UBGraphicsMediaItemDelegate : public UBGraphicsItemDelegate
DelegateButton* mMuteButton;
DelegateMediaControl *mMediaControl;
QMediaPlayer* mMedia; // mMedia belongs to the associated UBGraphicsMediaItem (mDelegated)
Phonon::MediaObject* mMedia;
QTimer *mToolBarShowTimer;
int m_iToolBarShowingInterval;

@ -1264,7 +1264,7 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, QGraphi
UBApplication::undoStack->push(uc);
}
pixmapItem->setTransform(QTransform::fromScale(pScaleFactor, pScaleFactor), true);
pixmapItem->scale(pScaleFactor, pScaleFactor);
if (pUseAnimation)
{
@ -1340,7 +1340,7 @@ UBGraphicsMediaItem* UBGraphicsScene::addMedia(const QUrl& pMediaFileUrl, bool s
if (!shouldPlayAsap)
{
mediaItem->mediaObject()->pause();
mediaItem->mediaObject()->setPosition(0);
mediaItem->mediaObject()->seek(0);
}
setDocumentUpdated();
@ -1403,7 +1403,7 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
qreal ssf = 1 / UBApplication::boardController->systemScaleFactor();
graphicsWidget->setTransform(QTransform::fromScale(ssf, ssf), true);
graphicsWidget->scale(ssf, ssf);
graphicsWidget->setPos(QPointF(pPos.x() - graphicsWidget->boundingRect().width() / 2,
pPos.y() - graphicsWidget->boundingRect().height() / 2));
@ -1530,7 +1530,7 @@ UBGraphicsSvgItem* UBGraphicsScene::addSvg(const QUrl& pSvgFileUrl, const QPoint
svgItem->setFlag(QGraphicsItem::ItemIsSelectable, true);
qreal sscale = 1 / UBApplication::boardController->systemScaleFactor();
svgItem->setTransform(QTransform::fromScale(sscale, sscale), true);
svgItem->scale(sscale, sscale);
QPointF half(svgItem->boundingRect().width() / 2, svgItem->boundingRect().height() / 2);
svgItem->setPos(pPos - half);
@ -1860,7 +1860,7 @@ QGraphicsItem* UBGraphicsScene::scaleToFitDocumentSize(QGraphicsItem* item, bool
{
qreal ratio = qMin(maxWidth / size.width(), maxHeight / size.height());
item->setTransform(QTransform::fromScale(ratio, ratio), true);
item->scale(ratio, ratio);
if(center)
{

@ -27,7 +27,6 @@
#include <QtNetwork>
#include <QtXml>
#include <QWebFrame>
#include "UBGraphicsWidgetItem.h"
#include "UBGraphicsScene.h"
@ -122,8 +121,7 @@ void UBGraphicsWidgetItem::initialize()
page()->setPalette(palette);
page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
connect(page()->mainFrame(), &QWebFrame::javaScriptWindowObjectCleared,
this, &UBGraphicsWidgetItem::javaScriptWindowObjectCleared);
connect(page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared()));
connect(page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SLOT(geometryChangeRequested(const QRect&)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool)));
connect(page()->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayoutCompleted()));

@ -31,7 +31,6 @@
#include <QtGui>
#include <QtWebKit>
#include <QDomElement>
#include <QGraphicsWebView>
#include "core/UB.h"

@ -157,7 +157,7 @@ void UBSelectionFrame::mousePressEvent(QGraphicsSceneMouseEvent *event)
mLastTranslateOffset = QPointF();
mRotationAngle = 0;
if (scene()->itemAt(event->scenePos(), transform()) == mRotateButton) {
if (scene()->itemAt(event->scenePos()) == mRotateButton) {
mOperationMode = om_rotating;
} else {
mOperationMode = om_moving;

@ -29,7 +29,6 @@
#define UBABSTRACTUNDOCOMMAND_H_
#include <QtGui>
#include <QUndoCommand>
#include <core/UB.h>
class UBUndoCommand : public QUndoCommand

@ -53,7 +53,7 @@ QByteArray UBBase32::decode(const QString& base32String)
for (i = 0, index = 0, offset = 0; i < base32String.length(); i++)
{
QChar ch = base32String.at(i);
char lookup = ch.toLatin1() - '0';
char lookup = ch.toAscii() - '0';
/* Skip chars outside the lookup table */
if (lookup < 0 || lookup >= 80)

@ -29,8 +29,6 @@
#define UBCOREGRAPHICSSCENE_H_
#include <QtGui>
#include <QGraphicsScene>
#include <QGraphicsItem>
class UBCoreGraphicsScene : public QGraphicsScene
{

@ -92,13 +92,13 @@ QString UBCryptoUtils::symetricEncrypt(const QString& clear)
free(ciphertext);
return QString::fromLatin1(cipheredData.toBase64());
return QString::fromAscii(cipheredData.toBase64());
}
QString UBCryptoUtils::symetricDecrypt(const QString& encrypted)
{
QByteArray encryptedData = QByteArray::fromBase64(encrypted.toLatin1());
QByteArray encryptedData = QByteArray::fromBase64(encrypted.toAscii());
int encryptedLength = encryptedData.length();
int paddingLength = 0;
@ -132,10 +132,10 @@ void UBCryptoUtils::aesInit()
{
int i, nrounds = 5;
unsigned char key[32], iv[32];
unsigned char *key_data = (unsigned char *)sAESKey.toLatin1().data();
unsigned char *key_data = (unsigned char *)sAESKey.toAscii().data();
int key_data_len = sAESKey.length();
i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), (unsigned char *)sAESSalt.toLatin1().data(), key_data,
i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), (unsigned char *)sAESSalt.toAscii().data(), key_data,
key_data_len, nrounds, key, iv);
if (i != 32)

@ -57,7 +57,7 @@ UBFileSystemUtils::~UBFileSystemUtils()
QString UBFileSystemUtils::removeLocalFilePrefix(QString input)
{
#ifdef Q_OS_WIN
#ifdef Q_WS_WIN
if(input.startsWith("file:///"))
return input.mid(8);
else
@ -130,12 +130,12 @@ bool UBFileSystemUtils::deleteFile(const QString &path)
QString UBFileSystemUtils::defaultTempDirPath()
{
return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/" + defaultTempDirName();
return QDesktopServices::storageLocation(QDesktopServices::TempLocation) + "/" + defaultTempDirName();
}
QString UBFileSystemUtils::createTempDir(const QString& templateString, bool autoDeleteOnExit)
{
QString appTempDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation)
QString appTempDir = QDesktopServices::storageLocation(QDesktopServices::TempLocation)
+ "/" + templateString;
int index = 0;
@ -200,7 +200,7 @@ void UBFileSystemUtils::deleteAllTempDirCreatedDuringSession()
void UBFileSystemUtils::cleanupGhostTempFolders(const QString& templateString)
{
QDir dir(QStandardPaths::writableLocation(QStandardPaths::TempLocation));
QDir dir(QDesktopServices::storageLocation(QDesktopServices::TempLocation));
foreach (QFileInfo dirContent, dir.entryInfoList(QDir::Dirs
| QDir::NoDotAndDotDot | QDir::Hidden , QDir::Name))
{

@ -204,7 +204,7 @@ public:
static QString urlFromClipboard();
static QStringList availableTranslations();
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
static void SetMacLocaleByIdentifier(const QString& id);
#endif
};

@ -28,7 +28,6 @@
#include "UBPlatformUtils.h"
#include <QtGui>
#include <QApplication>
#include <unistd.h>
#include <X11/Xlib.h>
@ -99,7 +98,7 @@ void UBPlatformUtils::bringPreviousProcessToFront()
QString UBPlatformUtils::osUserLoginName()
{
char *user = getenv("USER");
return QString::fromLatin1(user);
return QString::fromAscii(user);
}
QString UBPlatformUtils::computerName()
@ -109,7 +108,7 @@ QString UBPlatformUtils::computerName()
// if the name is longer than 255 the name is truncated but os doesn't ensure
// that the last character returned is a null character
if(!gethostname(hostname,255))
return QString::fromLatin1(hostname);
return QString::fromAscii(hostname);
else
return "NOT FOUND";
}

@ -45,7 +45,7 @@
setStyleSheet(style);\
}
#ifdef Q_OS_WIN
#ifdef Q_WS_WIN
#define WARNINGS_DISABLE __pragma(warning(push, 0));
#define WARNINGS_ENABLE __pragma(warning(pop));
@ -58,7 +58,7 @@
#define THIRD_PARTY_WARNINGS_DISABLE __pragma(warning(push));
#endif //#ifdef NO_THIRD_PARTY_WARNINGS
#else //#ifdef Q_OS_WIN
#else //#ifdef Q_WS_WIN
#define WARNINGS_DISABLE _Pragma("GCC diagnostic push"); \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\""); \
@ -76,7 +76,7 @@ _Pragma("GCC diagnostic ignored \"-Wsign-compare\"");
#endif //#ifdef NO_THIRD_PARTY_WARNINGS
#endif //#ifdef Q_OS_WIN
#endif //#ifdef Q_WS_WIN
// anyway on any OS
#define THIRD_PARTY_WARNINGS_ENABLE WARNINGS_ENABLE

@ -23,8 +23,7 @@
*/
#include <QLayout>
#include <QAction>
#include "UBActionPalette.h"
@ -104,10 +103,8 @@ UBActionPaletteButton* UBActionPalette::createPaletteButton(QAction* action, QWi
mMapActionToButton[action] = button;
connect(button, &UBActionPaletteButton::clicked,
this, &UBActionPalette::buttonClicked);
connect(action, &QAction::changed,
this, &UBActionPalette::actionChanged);
connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()));
connect(action, SIGNAL(changed()), this, SLOT(actionChanged()));
return button;
}

@ -31,8 +31,6 @@
#include <QtGui>
#include <QPoint>
#include <QButtonGroup>
#include <QToolButton>
#include "UBFloatingPalette.h"
class UBActionPaletteButton;

@ -29,7 +29,6 @@
#define UBCIRCLEFRAME_H_
#include <QtGui>
#include <QFrame>
class UBCircleFrame : public QFrame
{

@ -29,7 +29,6 @@
#define UBCOLORPICKER_H_
#include <QtGui>
#include <QFrame>
class UBColorPicker : public QFrame
{

@ -654,9 +654,9 @@ void UBTabDockPalette::paintEvent(QPaintEvent *)
}
painter.save();
//QPixmap transparencyPix(":/images/tab_mask.png");
QPixmap transparencyPix(":/images/tab_mask.png");
if (dock->mCurrentTab != i) {
//iconPixmap.setAlphaChannel(transparencyPix); // deprecated; removed for now, to be re-implemented
iconPixmap.setAlphaChannel(transparencyPix);
QColor color(0x7F, 0x7F, 0x7F, 0x3F);
painter.setBrush(QBrush(color));
}

@ -190,8 +190,7 @@ void UBDocumentThumbnailWidget::dragMoveEvent(QDragMoveEvent *event)
if (!mDropCaretRectItem && selectedItems().count() < mGraphicItems.count())
{
mDropCaretRectItem = new QGraphicsRectItem(0);
scene()->addItem(mDropCaretRectItem);
mDropCaretRectItem = new QGraphicsRectItem(0, scene());
mDropCaretRectItem->setPen(QPen(Qt::darkGray));
mDropCaretRectItem->setBrush(QBrush(Qt::lightGray));
}

@ -29,7 +29,6 @@
#define UBDOCUMENTTREEWIDGET_H_
#include <QtGui>
#include <QTreeWidget>
class UBDocumentProxy;
class UBDocumentProxyTreeItem;

@ -61,8 +61,8 @@ UBDownloadWidget::UBDownloadWidget(QWidget *parent, const char *name):QWidget(pa
mpTree->setRootIsDecorated(false);
mpTree->setColumnCount(2);
mpTree->header()->setStretchLastSection(false);
mpTree->header()->setSectionResizeMode(eItemColumn_Desc, QHeaderView::Stretch);
mpTree->header()->setSectionResizeMode(eItemColumn_Close, QHeaderView::Custom);
mpTree->header()->setResizeMode(eItemColumn_Desc, QHeaderView::Stretch);
mpTree->header()->setResizeMode(eItemColumn_Close, QHeaderView::Custom);
mpTree->resizeColumnToContents(eItemColumn_Close);
mpTree->header()->close();
mpLayout->addWidget(mpTree, 1);

@ -23,8 +23,7 @@
*/
#include <QButtonGroup>
#include <QAction>
#include "UBFeaturesActionBar.h"
#include "core/memcheck.h"

@ -31,9 +31,6 @@
#include <QWidget>
#include <QToolButton>
#include <QDropEvent>
#include <QLineEdit>
#include <QLayout>
#include "board/UBFeaturesController.h"
#define BUTTON_SIZE 24

@ -27,8 +27,6 @@
#include <QDomDocument>
#include <QWebView>
#include <QWebFrame>
#include <QWidget>
#include "UBFeaturesWidget.h"
#include "gui/UBThumbnailWidget.h"
@ -269,8 +267,8 @@ void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata )
{
QString previewImageUrl = ":images/libpalette/notFound.png";
QString widgetsUrl = QUrl::fromEncoded(metadata["Url"].toLatin1()).toString()/*metadata.value("Url", QString())*/;
QString widgetsThumbsUrl = QUrl::fromEncoded(metadata["thumbnailUrl"].toLatin1()).toString();
QString widgetsUrl = QUrl::fromEncoded(metadata["Url"].toAscii()).toString()/*metadata.value("Url", QString())*/;
QString widgetsThumbsUrl = QUrl::fromEncoded(metadata["thumbnailUrl"].toAscii()).toString();
QString strType = UBFileSystemUtils::mimeTypeFromFileName(widgetsUrl);
UBMimeType::Enum thumbType = UBFileSystemUtils::mimeTypeFromString(strType);
@ -442,7 +440,7 @@ void UBFeaturesListView::dragMoveEvent( QDragMoveEvent *event )
void UBFeaturesListView::dropEvent( QDropEvent *event )
{
QObject *eventSource = event->source();
QWidget *eventSource = event->source();
if (eventSource && eventSource->objectName() == UBFeaturesWidget::objNameFeatureList) {
event->setDropAction( Qt::MoveAction );
}
@ -1174,7 +1172,7 @@ QMimeData* UBFeaturesModel::mimeData(const QModelIndexList &indexes) const
if (!typeData.isNull()) {
typeData += UBFeaturesController::featureTypeSplitter();
}
typeData += QString::number(element.getType()).toLatin1();
typeData += QString::number(element.getType()).toAscii();
}
}

@ -41,10 +41,6 @@
#include <QGraphicsLinearLayout>
#include <QStackedWidget>
#include <QDropEvent>
#include <QPushButton>
#include <QProgressBar>
#include <QLabel>
#include <QTreeWidget>
#include "UBDockPaletteWidget.h"
#include "core/UBSettings.h"
@ -397,8 +393,6 @@ public:
void moveData(const UBFeature &source, const UBFeature &destination, Qt::DropAction action, bool deleteManualy = false);
Qt::DropActions supportedDropActions() const { return Qt::MoveAction | Qt::CopyAction; }
Qt::DropActions supportedDragActions() const { return Qt::MoveAction | Qt::CopyAction; }
// void setFeaturesList(QList <UBFeature> *flist ) { featuresList = flist; }
public slots:

@ -54,11 +54,11 @@ UBFloatingPalette::UBFloatingPalette(Qt::Corner position, QWidget *parent)
{
// standalone window
// !!!! Should be included into Windows after QT recompilation
#ifndef Q_OS_WIN
#ifndef Q_WS_WIN
setAttribute(Qt::WA_TranslucentBackground);
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
#endif
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
setAttribute(Qt::WA_MacNonActivatingToolWindow);
setAttribute(Qt::WA_MacNoShadow);

@ -79,11 +79,11 @@ UBMagnifier::UBMagnifier(QWidget *parent, bool isInteractive)
{
// standalone window
// !!!! Should be included into Windows after QT recompilation
#ifndef Q_OS_WIN
#ifndef Q_WS_WIN
// setAttribute(Qt::WA_TranslucentBackground);
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
#endif
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
setAttribute(Qt::WA_MacAlwaysShowToolWindow);
setAttribute(Qt::WA_MacNonActivatingToolWindow);
setAttribute(Qt::WA_MacNoShadow);

@ -29,7 +29,6 @@
#define UBMAGNIFIER_H
#include <QtGui>
#include <QWidget>
class UBMagnifierParams
{

@ -26,8 +26,6 @@
#include <QtGui>
#include <QToolTip>
#include <QStackedLayout>
#include "UBMainWindow.h"
#include "core/UBApplication.h"
@ -36,7 +34,7 @@
#include "core/UBDisplayManager.h"
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_OS_OSX)
#if defined(Q_WS_MACX)
#include "board/UBBoardView.h"
#endif
@ -64,10 +62,10 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags)
mStackedLayout = new QStackedLayout(centralWidget);
setCentralWidget(centralWidget);
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
actionPreferences->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Comma));
actionQuit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));
#elif defined(Q_OS_WIN)
#elif defined(Q_WS_WIN)
actionPreferences->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Return));
// this code, because it unusable, system key combination can`t be triggered, even we add it manually
actionQuit->setShortcut(QKeySequence(Qt::ALT + Qt::Key_F4));
@ -150,7 +148,7 @@ void UBMainWindow::closeEvent(QCloseEvent *event)
}
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_OS_OSX)
#if defined(Q_WS_MACX)
bool UBMainWindow::event(QEvent *event)
{
bool bRes = QMainWindow::event(event);
@ -201,7 +199,7 @@ bool UBMainWindow::yesNoQuestion(QString windowTitle, QString text)
messageBox.addButton(tr("No"),QMessageBox::NoRole);
messageBox.setIcon(QMessageBox::Question);
#ifdef Q_OS_LINUX
#ifdef Q_WS_X11
// to avoid to be handled by x11. This allows us to keep to the back all the windows manager stuff like palette, toolbar ...
messageBox.setWindowFlags(Qt::Dialog | Qt::X11BypassWindowManagerHint);
#else

@ -30,7 +30,7 @@
#include <QMainWindow>
#include <QWidget>
#include <QtWebKitWidgets/QWebView>
#include <QWebView>
#include <QMessageBox>
#include "UBDownloadWidget.h"
@ -88,7 +88,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
private:
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_OS_OSX)
#if defined(Q_WS_MACX)
bool event(QEvent *event);
#endif
UBDownloadWidget* mpDownloadWidget;

@ -44,7 +44,7 @@ UBMessageWindow::UBMessageWindow(QWidget *parent)
mLayout->setContentsMargins(radius() + 15, 4, radius() + 15, 4);
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
mLayout->setContentsMargins(radius() + 15, 8, radius() + 15, 10);
#endif

@ -29,8 +29,6 @@
#define UBMESSAGEWINDOW_H_
#include <QtGui>
#include <QHBoxLayout>
#include <QLabel>
#include "UBFloatingPalette.h"

@ -23,9 +23,7 @@
*/
#include <QLayout>
#include <QTextEdit>
#include <QPushButton>
#include "UBMessagesDialog.h"

@ -29,7 +29,6 @@
#define UB_MESSAGES_DIALOG_H_
#include <QtGui>
#include <QWidget>
class UBMessagesDialog : public QWidget
{

@ -23,7 +23,7 @@
*/
#include <QApplication>
#include "UBMousePressFilter.h"

@ -28,10 +28,10 @@
#include "UBRubberBand.h"
#include <QtGui>
#include <QtGui/QPlastiqueStyle>
#include <QStyleFactory>
#include <QStyle>
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
#include <QtGui/QMacStyle>
#endif
@ -50,11 +50,11 @@ UBRubberBand::UBRubberBand(Shape s, QWidget * p)
{
customStyle = NULL;
#ifdef Q_OS_WIN
#ifdef Q_WS_WIN
customStyle = new QWindowsXPStyle();
#elif defined(Q_OS_OSX)
#elif defined(Q_WS_MAC)
customStyle = new QMacStyle();
#elif defined(Q_OS_LINUX)
#elif defined(Q_WS_X11)
customStyle = QStyleFactory::create("oxygen");
#endif

@ -24,7 +24,6 @@
#include <QDesktopWidget>
#include "UBScreenMirror.h"
@ -33,7 +32,7 @@
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#if defined(Q_OS_OSX)
#if defined(Q_WS_MAC)
#include <ApplicationServices/ApplicationServices.h>
#endif

@ -29,7 +29,6 @@
#define UBSCREENMIRROR_H_
#include <QtGui>
#include <QWidget>
class UBScreenMirror : public QWidget
{

@ -64,7 +64,7 @@ void UBSpinningWheel::paintEvent(QPaintEvent *event)
pen.setCapStyle(Qt::RoundCap);
painter.setPen(pen);
painter.rotate(30 * (mPosition.loadAcquire() % 12));
painter.rotate(30 * (mPosition % 12));
for(int i = 0; i < 12; i++)
{

@ -26,7 +26,6 @@
#include <QString>
#include <QCursor>
#include <QGraphicsRectItem>
#include "UBThumbnailWidget.h"
#include "UBRubberBand.h"
@ -243,10 +242,9 @@ void UBThumbnailWidget::mousePressEvent(QMouseEvent *event)
option.initFrom(&rubberBand);
mPrevLassoRect = QRect();
mLassoRectItem = new QGraphicsRectItem(0);
scene()->addItem(mLassoRectItem);
mLassoRectItem = new QGraphicsRectItem(0, scene());
#ifdef Q_OS_OSX
#ifdef Q_WS_MAC
// The following code must stay in synch with <Qt installation folder>\src\gui\styles\qmacstyle_mac.mm
QColor strokeColor;
strokeColor.setHsvF(0, 0, 0.86, 1.0);
@ -774,7 +772,7 @@ UBSceneThumbnailNavigPixmap::UBSceneThumbnailNavigPixmap(const QPixmap& pix, UBD
, bCanMoveDown(false)
{
if(0 <= UBDocumentContainer::pageFromSceneIndex(pSceneIndex)){
setAcceptHoverEvents(true);
setAcceptsHoverEvents(true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
}
}

@ -26,9 +26,6 @@
#include <QtGui>
#include <QWebView>
#include <QWebFrame>
#include "UBToolWidget.h"
#include "api/UBWidgetUniboardAPI.h"
#include "api/UBW3CWidgetAPI.h"
@ -118,8 +115,7 @@ void UBToolWidget::initialize()
setFixedSize(mToolWidget->boundingRect().width() + mContentMargin * 2, mToolWidget->boundingRect().height() + mContentMargin * 2);
connect(mWebView->page()->mainFrame(), &QWebFrame::javaScriptWindowObjectCleared,
this, &UBToolWidget::javaScriptWindowObjectCleared);
connect(mWebView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared()));
mWebView->load(mToolWidget->mainHtml());

@ -29,7 +29,6 @@
#define UBTOOLWIDGET_H_
#include <QtGui>
#include <QWidget>
class UBGraphicsWidgetItem;
class QWidget;

@ -28,8 +28,6 @@
#include "UBToolbarButtonGroup.h"
#include <QtGui>
#include <QLayout>
#include <QStyleOption>
#include "core/UBApplication.h"
#include "core/UBSettings.h"

@ -30,10 +30,6 @@
#include <QtGui>
#include <QWidget>
#include <QToolBar>
#include <QToolButton>
#include <QActionGroup>
class UBToolbarButtonGroup : public QWidget
{

@ -29,7 +29,6 @@
#define UBWIDGETMIRROR_H_
#include <QtGui>
#include <QWidget>
class UBWidgetMirror : public QWidget
{

@ -28,7 +28,6 @@
#include "UBZoomPalette.h"
#include <QtGui>
#include <QPushButton>
#include <math.h>
#include "core/UBApplication.h"

@ -29,8 +29,6 @@
#include <QtGui>
#include <QtNetwork>
#include <QMessageBox>
#include <QPushButton>
#include "core/UBApplication.h"
#include "core/UBApplicationController.h"
@ -117,7 +115,7 @@ void UBNetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthe
passwordDialog.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32));
QString introMessage = tr("<qt>Enter username and password for \"%1\" at %2</qt>");
introMessage = introMessage.arg((reply->url().toString()).toHtmlEscaped()).arg((reply->url().toString()).toHtmlEscaped());
introMessage = introMessage.arg(Qt::escape(reply->url().toString())).arg(Qt::escape(reply->url().toString()));
passwordDialog.introLabel->setText(introMessage);
passwordDialog.introLabel->setWordWrap(true);

@ -78,12 +78,12 @@ double Utils::stringToDouble(const std::string & s )
std::string Utils::uIntToStr(unsigned int integer)
{
return std::string(QString::number(integer).toLatin1());
return std::string(QString::number(integer).toAscii());
}
std::string Utils::doubleToStr(double doubleValue)
{
return std::string(QString::number(doubleValue).toLatin1());
return std::string(QString::number(doubleValue).toAscii());
}
int Utils::_stringToInt(const std::string & str) //throw ConvertException

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save