mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 10:00:23 +08:00
Qt6 compatibility (#968)
* Qt6 Compilation success * Fixed qt5 backward compatibility * Fixed build for qt<=5.9 (bionic) * Added docker file for easy testing with latest Qt/VTK/PCL/OpenCV * Fixed cmake for qt
This commit is contained in:
9
guilib/src/3rdParty/QMultiComboBox.cpp
vendored
9
guilib/src/3rdParty/QMultiComboBox.cpp
vendored
@@ -11,7 +11,8 @@
|
||||
#include "QMultiComboBox.h"
|
||||
#include <QApplication>
|
||||
#include <QCoreApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QWindow>
|
||||
#include <QScreen>
|
||||
|
||||
#include "rtabmap/utilite/ULogger.h"
|
||||
|
||||
@@ -46,7 +47,11 @@ QMultiComboBox::~QMultiComboBox()
|
||||
void QMultiComboBox::SetDisplayText(QString text)
|
||||
{
|
||||
m_DisplayText_ = text;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
const int textWidth = fontMetrics().horizontalAdvance(text);
|
||||
#else
|
||||
const int textWidth = fontMetrics().width(text);
|
||||
#endif
|
||||
setMinimumWidth(textWidth + 30);
|
||||
updateGeometry();
|
||||
repaint();
|
||||
@@ -88,7 +93,7 @@ void QMultiComboBox::showPopup()
|
||||
//QRect rec2(p , p + QPoint(rec.width(), rec.height()));
|
||||
|
||||
// get the two possible list points and height
|
||||
QRect screen = QApplication::desktop()->screenGeometry(this);
|
||||
QRect screen = this->window()->windowHandle()->screen()->availableGeometry();
|
||||
QPoint above = this->mapToGlobal(QPoint(0,0));
|
||||
int aboveHeight = above.y() - screen.y();
|
||||
QPoint below = this->mapToGlobal(QPoint(0,rec.height()));
|
||||
|
||||
Reference in New Issue
Block a user