mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Fixed a crash when closing the DatabaseViewer dialog on Mac OS X. Added "Close" button when it is in modal window mode for Mac OS X too
This commit is contained in:
@@ -83,7 +83,10 @@ CloudViewer::CloudViewer(QWidget *parent) :
|
||||
|
||||
this->SetRenderWindow(_visualizer->getRenderWindow());
|
||||
|
||||
_visualizer->setupInteractor(this->GetInteractor(), this->GetRenderWindow());
|
||||
// Replaced by the second line, to avoid a crash in Mac OS X on close, as well as
|
||||
// the "Invalid drawable" warning when the view is not visible.
|
||||
//_visualizer->setupInteractor(this->GetInteractor(), this->GetRenderWindow());
|
||||
this->GetInteractor()->SetInteractorStyle (_visualizer->getInteractorStyle());
|
||||
|
||||
_visualizer->registerMouseCallback (&CloudViewer::mouseEventOccurred, *this, (void*)_visualizer);
|
||||
_visualizer->setCameraPosition(
|
||||
|
||||
@@ -79,6 +79,8 @@ DatabaseViewer::DatabaseViewer(QWidget * parent) :
|
||||
|
||||
ui_ = new Ui_DatabaseViewer();
|
||||
ui_->setupUi(this);
|
||||
ui_->buttonBox->setVisible(false);
|
||||
connect(ui_->buttonBox->button(QDialogButtonBox::Close), SIGNAL(clicked()), this, SLOT(close()));
|
||||
|
||||
QString title("RTAB-Map Database Viewer[*]");
|
||||
this->setWindowTitle(title);
|
||||
@@ -275,6 +277,11 @@ DatabaseViewer::~DatabaseViewer()
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseViewer::showCloseButton(bool visible)
|
||||
{
|
||||
ui_->buttonBox->setVisible(visible);
|
||||
}
|
||||
|
||||
void DatabaseViewer::configModified()
|
||||
{
|
||||
this->setWindowModified(true);
|
||||
|
||||
@@ -2538,6 +2538,7 @@ void MainWindow::editDatabase()
|
||||
DatabaseViewer * viewer = new DatabaseViewer(this);
|
||||
viewer->setWindowModality(Qt::WindowModal);
|
||||
viewer->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
viewer->showCloseButton();
|
||||
if(viewer->openDatabase(path))
|
||||
{
|
||||
if(viewer->isSavedMaximized())
|
||||
|
||||
@@ -2114,6 +2114,7 @@ void PreferencesDialog::openDatabaseViewer()
|
||||
DatabaseViewer * viewer = new DatabaseViewer(this);
|
||||
viewer->setWindowModality(Qt::WindowModal);
|
||||
viewer->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
viewer->showCloseButton();
|
||||
if(viewer->openDatabase(_ui->source_database_lineEdit_path->text()))
|
||||
{
|
||||
viewer->show();
|
||||
|
||||
@@ -13,8 +13,17 @@
|
||||
<property name="windowTitle">
|
||||
<string>Database viewer</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7" stretch="2,0">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="1,1">
|
||||
<property name="rightMargin">
|
||||
@@ -41,7 +50,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>154</width>
|
||||
<width>159</width>
|
||||
<height>136</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -196,7 +205,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>152</width>
|
||||
<width>159</width>
|
||||
<height>136</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -332,6 +341,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Close</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
|
||||
Reference in New Issue
Block a user