Commit 0978a74dc966758277843ef99dc616970543d683
1 parent
367ec95d
Fixed GUI bug
Showing
4 changed files
with
20 additions
and
14 deletions
openbr/gui/imageviewer.cpp
| ... | ... | @@ -24,7 +24,8 @@ |
| 24 | 24 | |
| 25 | 25 | /*** PUBLIC ***/ |
| 26 | 26 | br::ImageViewer::ImageViewer(QWidget *parent) |
| 27 | - : QLabel(parent) | |
| 27 | + : QLabel(parent), | |
| 28 | + mutex(QMutex::Recursive) | |
| 28 | 29 | { |
| 29 | 30 | setAlignment(Qt::AlignCenter); |
| 30 | 31 | setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); |
| ... | ... | @@ -40,38 +41,39 @@ void br::ImageViewer::setImage(const QString &file, bool async) |
| 40 | 41 | QMutexLocker locker(&mutex); |
| 41 | 42 | if(file.isNull()) src = QImage(); // Gets rid of runtime FileEngine::open warning |
| 42 | 43 | else src = QImage(file); |
| 43 | - updatePixmap(async); | |
| 44 | + updatePixmap(src, async); | |
| 44 | 45 | } |
| 45 | 46 | |
| 46 | 47 | void br::ImageViewer::setImage(const QImage &image, bool async) |
| 47 | 48 | { |
| 48 | 49 | QMutexLocker locker(&mutex); |
| 49 | 50 | src = image.copy(); |
| 50 | - updatePixmap(async); | |
| 51 | + updatePixmap(src, async); | |
| 51 | 52 | } |
| 52 | 53 | |
| 53 | 54 | void br::ImageViewer::setImage(const QPixmap &pixmap, bool async) |
| 54 | 55 | { |
| 55 | 56 | QMutexLocker locker(&mutex); |
| 56 | 57 | src = pixmap.toImage(); |
| 57 | - updatePixmap(async); | |
| 58 | + updatePixmap(src, async); | |
| 58 | 59 | } |
| 59 | 60 | |
| 60 | 61 | /*** PRIVATE ***/ |
| 61 | -void br::ImageViewer::updatePixmap(bool async) | |
| 62 | +void br::ImageViewer::updatePixmap(QImage image, bool async) | |
| 62 | 63 | { |
| 64 | + // For the time being, disabling this is sufficient | |
| 63 | 65 | if (async) { |
| 64 | - QTimer::singleShot(0, this, SLOT(updatePixmap())); | |
| 65 | - return; | |
| 66 | + //QTimer::singleShot(0, this, SLOT(updatePixmap(image))); | |
| 67 | + //return; | |
| 66 | 68 | } |
| 67 | 69 | |
| 68 | - QMutexLocker locker(&mutex); | |
| 69 | - if (src.isNull() || size().isNull()) { | |
| 70 | + QMutexLocker locker(&mutex); | |
| 71 | + if (image.isNull() || size().isNull()) { | |
| 70 | 72 | QLabel::setPixmap(QPixmap()); |
| 71 | 73 | QLabel::setText(defaultText); |
| 72 | 74 | } else { |
| 73 | 75 | QLabel::clear(); |
| 74 | - QLabel::setPixmap(QPixmap::fromImage(src.scaled(size(), Qt::KeepAspectRatio))); | |
| 76 | + QLabel::setPixmap(QPixmap::fromImage(image.scaled(size(), Qt::KeepAspectRatio))); | |
| 75 | 77 | } |
| 76 | 78 | } |
| 77 | 79 | |
| ... | ... | @@ -98,5 +100,5 @@ void br::ImageViewer::resizeEvent(QResizeEvent *event) |
| 98 | 100 | { |
| 99 | 101 | QLabel::resizeEvent(event); |
| 100 | 102 | event->accept(); |
| 101 | - updatePixmap(); | |
| 103 | + updatePixmap(src); | |
| 102 | 104 | } | ... | ... |
openbr/gui/imageviewer.h
openbr/plugins/format.cpp
| ... | ... | @@ -654,7 +654,7 @@ class xmlFormat : public Format |
| 654 | 654 | Template t; |
| 655 | 655 | |
| 656 | 656 | #ifndef BR_EMBEDDED |
| 657 | - QString fileName = file.get<QString>("path") + "/" + file.name; | |
| 657 | + QString fileName = file.get<QString>("path") + file.name; | |
| 658 | 658 | |
| 659 | 659 | QDomDocument doc(fileName); |
| 660 | 660 | QFile f(fileName); | ... | ... |
share/openbr/cmake/InstallDependencies.cmake
| ... | ... | @@ -72,7 +72,11 @@ function(install_qt_misc) |
| 72 | 72 | endif() |
| 73 | 73 | install(FILES ${_qt5Core_install_prefix}/bin/libGLESv2${BR_INSTALL_DEPENDENCIES_SUFFIX}.dll DESTINATION bin) |
| 74 | 74 | install(FILES ${_qt5Core_install_prefix}/bin/libEGL${BR_INSTALL_DEPENDENCIES_SUFFIX}.dll DESTINATION bin) |
| 75 | - # install(FILES ${_qt5Core_install_prefix}/bin/icuin49${BR_INSTALL_DEPENDENCIES_SUFFIX}.dll DESTINATION bin) | |
| 75 | + install(FILES ${_qt5Core_install_prefix}/bin/icuin49${BR_INSTALL_DEPENDENCIES_SUFFIX}.dll DESTINATION bin) | |
| 76 | + install(FILES ${_qt5Core_install_prefix}/bin/icuuc49${BR_INSTALL_DEPENDENCIES_SUFFIX}.dll DESTINATION bin) | |
| 77 | + install(FILES ${_qt5Core_install_prefix}/bin/icudt49.dll DESTINATION bin) | |
| 78 | + install(FILES ${_qt5Core_install_prefix}/bin/d3dcompiler_46.dll DESTINATION bin) | |
| 79 | + install(FILES ${_qt5Core_install_prefix}/plugins/platforms/qwindows${BR_INSTALL_DEPENDENCIES_SUFFIX}.dll DESTINATION bin/platforms) | |
| 76 | 80 | endif() |
| 77 | 81 | endfunction() |
| 78 | 82 | ... | ... |