Skip to content

Commit

Permalink
fix deprecation warnings with new Qt (#435)
Browse files Browse the repository at this point in the history
* fix deprecation warnings with new Qt

Signed-off-by: William Woodall <william@osrfoundation.org>

* Get QScreen from main window always

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
wjwwood authored Aug 1, 2019
1 parent d52e5c1 commit de5680b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion rviz_common/src/rviz_common/loading_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ void LoadingDialog::showMessage(const QString & message)
label_->setText(message);
QApplication::processEvents();
QWidget::repaint();
QApplication::flush();
}

} // namespace rviz_common
7 changes: 5 additions & 2 deletions rviz_common/src/rviz_common/screenshot_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
#include <QMessageBox> // NOLINT: cpplint is unable to handle the include order here
// Included so we know that QPushButton inherits QAbstractButton
#include <QPushButton> // NOLINT: cpplint is unable to handle the include order here
#include <QScreen> // NOLINT: cpplint is unable to handle the include order here
#include <QTimer> // NOLINT: cpplint is unable to handle the include order here
#include <QVBoxLayout> // NOLINT: cpplint is unable to handle the include order here
#include <QWindow> // NOLINT: cpplint is unable to handle the include order here

#include "./scaled_image_widget.hpp"

Expand Down Expand Up @@ -119,10 +121,11 @@ void ScreenshotDialog::onTimeout()

void ScreenshotDialog::takeScreenshotNow()
{
QScreen * screen = main_window_->windowHandle()->screen();
if (save_full_window_) {
screenshot_ = QPixmap::grabWindow(main_window_->winId());
screenshot_ = screen->grabWindow(main_window_->winId());
} else {
screenshot_ = QPixmap::grabWindow(render_window_->winId());
screenshot_ = screen->grabWindow(render_window_->winId());
}
image_widget_->setImage(screenshot_);
}
Expand Down

0 comments on commit de5680b

Please sign in to comment.