Permalink
Browse files

fix menu/combobox positioning for Qt 5.7

  • Loading branch information...
ypnos committed Aug 21, 2016
1 parent 0c4288b commit a2be69b62fb1de4e682c5dc8979b9fd0ca16a74a
Showing with 5 additions and 5 deletions.
  1. +1 −1 cmake/VoleFindPackages.cmake
  2. +2 −2 gui/dist_view/distviewgui.cpp
  3. +2 −2 gui/widgets/ahcombobox.cpp
@@ -69,7 +69,7 @@ if(Qt5Widgets_FOUND)
"${Qt5Widgets_VERSION} (minimum required: ${VOLE_MINIMUM_QT_VERSION})")
# cmake configure will fail after SEND_ERROR
endif()
if(${Qt5Widgets_VERSION} VERSION_EQUAL "5.5.1")
if(${Qt5Widgets_VERSION} VERSION_EQUAL "5.6")
# see https://codereview.qt-project.org/#/c/114591/
# and https://codereview.qt-project.org/#/c/144603/
add_definitions(-DQT_BROKEN_MAPTOGLOBAL)
@@ -306,7 +306,7 @@ void DistViewGUI::showLimiterMenu()
auto screenpoint = QCursor::pos();
#else
auto screenpoint = uivc->limiterMenuButton->mapToGlobal(QPoint(0, 0));
#ifndef QT_BROKEN_MAPTOGLOBAL
#ifdef QT_BROKEN_MAPTOGLOBAL
screenpoint = ui->gv->mapToGlobal(screenpoint);
#endif
#endif
@@ -353,7 +353,7 @@ void DistViewGUI::showFrameBufferMenu()
auto screenpoint = QCursor::pos();
#else
auto screenpoint = uivc->formatButton->mapToGlobal(QPoint(0, 0));
#ifndef QT_BROKEN_MAPTOGLOBAL
#ifdef QT_BROKEN_MAPTOGLOBAL
screenpoint = ui->gv->mapToGlobal(screenpoint);
#endif
#endif
@@ -18,11 +18,11 @@ void AHComboBox::showPopup()
menu.setDefaultAction(actions[currentIndex()]);
// map to scene coordinates
#ifdef _WIN32 // mapToGlobal() doesn't work correctly
#ifdef _WIN32 // mapToGlobal() doesn't work correctly (TODO: test qt 5.7)
auto screenpoint = QCursor::pos();
#else
auto screenpoint = mapToGlobal(QPoint(0, 0));
#ifndef QT_BROKEN_MAPTOGLOBAL
#ifdef QT_BROKEN_MAPTOGLOBAL
screenpoint = view->mapToGlobal(screenpoint);
#endif
#endif

0 comments on commit a2be69b

Please sign in to comment.