diff --git a/ci-scripts/osx/travis-install.sh b/ci-scripts/osx/travis-install.sh old mode 100644 new mode 100755 index 38456ad..489a906 --- a/ci-scripts/osx/travis-install.sh +++ b/ci-scripts/osx/travis-install.sh @@ -1,5 +1,5 @@ #!/bin/bash brew update -brew install qt55 glew lz4 lzo libusb libmypaint +brew install qt56 glew lz4 lzo libusb libmypaint brew tap tcr/tcr brew install clang-format diff --git a/toonz/sources/CMakeLists.txt b/toonz/sources/CMakeLists.txt index 14f7fd7..82fe6c0 100644 --- a/toonz/sources/CMakeLists.txt +++ b/toonz/sources/CMakeLists.txt @@ -245,6 +245,7 @@ find_package(Qt5 REQUIRED PrintSupport LinguistTools Multimedia + MultimediaWidgets ) set(QT_MINIMUM_VERSION 5.5.0) diff --git a/toonz/sources/toonz/CMakeLists.txt b/toonz/sources/toonz/CMakeLists.txt index b55a9dd..8818d87 100644 --- a/toonz/sources/toonz/CMakeLists.txt +++ b/toonz/sources/toonz/CMakeLists.txt @@ -409,7 +409,7 @@ elseif(BUILD_ENV_APPLE) target_link_libraries(OpenToonz_${VERSION} Qt5::Core Qt5::Gui Qt5::Network Qt5::OpenGL Qt5::Svg Qt5::Xml - Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia + Qt5::Script Qt5::Widgets Qt5::PrintSupport Qt5::Multimedia Qt5::MultimediaWidgets ${GL_LIB} ${GLUT_LIB} ${COCOA_LIB} ${EXTRA_LIBS} mousedragfilter ) diff --git a/toonz/sources/toonz/penciltestpopup.cpp b/toonz/sources/toonz/penciltestpopup.cpp index b8b51de..c7dfd95 100644 --- a/toonz/sources/toonz/penciltestpopup.cpp +++ b/toonz/sources/toonz/penciltestpopup.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -944,6 +945,10 @@ PencilTestPopup::PencilTestPopup() QPushButton* subfolderButton = new QPushButton(tr("Subfolder"), this); +#ifdef MACOSX + m_dummyViewFinder = new QCameraViewfinder(this); + m_dummyViewFinder->hide(); +#endif //---- m_resolutionCombo->setMaximumWidth(fontMetrics().width("0000 x 0000") + 25); @@ -1297,6 +1302,12 @@ void PencilTestPopup::onCameraListComboActivated(int comboIndex) { this, SLOT(onImageCaptured(int, const QImage&))); delete m_cameraImageCapture; } + +#ifdef MACOSX + // this line is needed only in macosx + m_currentCamera->setViewfinder(m_dummyViewFinder); +#endif + m_cameraImageCapture = new QCameraImageCapture(m_currentCamera, this); /* Capturing to buffer currently seems not to be supported on Windows */ // if @@ -1368,6 +1379,10 @@ void PencilTestPopup::onResolutionComboActivated(const QString& itemText) { m_cameraImageCapture->setEncodingSettings(imageEncoderSettings); m_cameraViewfinder->updateSize(); +#ifdef MACOSX + m_dummyViewFinder->resize(newResolution); +#endif + // reset white bg m_whiteBGImg = QImage(); m_bgReductionFld->setDisabled(true); diff --git a/toonz/sources/toonz/penciltestpopup.h b/toonz/sources/toonz/penciltestpopup.h index 76e063c..6009317 100644 --- a/toonz/sources/toonz/penciltestpopup.h +++ b/toonz/sources/toonz/penciltestpopup.h @@ -22,6 +22,9 @@ class QTimer; class QIntValidator; class QRegExpValidator; class QPushButton; +#ifdef MACOSX +class QCameraViewfinder; +#endif namespace DVGui { class FileField; @@ -183,6 +186,10 @@ class PencilTestPopup : public DVGui::Dialog { CameraCaptureLevelControl* m_camCapLevelControl; +#ifdef MACOSX + QCameraViewfinder* m_dummyViewFinder; +#endif + int m_timerId; QString m_cacheImagePath; bool m_captureWhiteBGCue;