1 Star 0 Fork 9

zhangxingrong/rviz

forked from src-openEuler/rviz 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-Replace-obsolete-QPixmap-grabWindow-with-QScreen-grabWindow.patch 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
zhangxingrong 提交于 2024-07-25 14:34 . add some upstream patchs
From 10cb16ea4c6f4582aa9abe861b1c1734399687fe Mon Sep 17 00:00:00 2001
From: vineet131 <vineet131@users.noreply.github.com>
Date: Wed, 10 May 2023 19:46:46 +0900
Subject: [PATCH] Replace obsolete QPixmap::grabWindow() with
QScreen::grabWindow() (#1794)
Co-authored-by: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
---
src/rviz/screenshot_dialog.cpp | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/rviz/screenshot_dialog.cpp b/src/rviz/screenshot_dialog.cpp
index 947142e0fc..7ef8ef1641 100644
--- a/src/rviz/screenshot_dialog.cpp
+++ b/src/rviz/screenshot_dialog.cpp
@@ -38,6 +38,8 @@
#include <QFileDialog>
#include <QCheckBox>
#include <QTimer>
+#include <QScreen>
+#include <QWindow>
#include "scaled_image_widget.h"
#include "screenshot_dialog.h"
@@ -111,14 +113,8 @@ void ScreenshotDialog::onTimeout()
void ScreenshotDialog::takeScreenshotNow()
{
- if (save_full_window_)
- {
- screenshot_ = QPixmap::grabWindow(main_window_->winId());
- }
- else
- {
- screenshot_ = QPixmap::grabWindow(render_window_->winId());
- }
+ const QWidget* w = save_full_window_ ? main_window_ : render_window_;
+ screenshot_ = w->windowHandle()->screen()->grabWindow(w->winId());
image_widget_->setImage(screenshot_);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangxingrong/rviz.git
git@gitee.com:zhangxingrong/rviz.git
zhangxingrong
rviz
rviz
master

搜索帮助