linux下多屏异显如何设置
1. 按照官方文档修改了了/etc/profile.d/weston.sh中的export WESTON_DRM_MIRROR=1;2. 接入RK3588两个HDMI显示器后,使用QT获取了创建了2个widget,按照获取到的两个屏幕的坐标进行布局;但是2个widget同时布局到2个屏幕上
qt操作
QList<QScreen *> screenList = QGuiApplication::screens();
foreach (auto screen, screenList)
{
qDebug()<<screen->name();
if (screen->name() == P_HDMI_NAME_STR)
{
if (m_hdmiPanel == nullptr)
m_hdmiPanel = new HdmiPanel(nullptr);
m_hdmiPanel->setGeometry(screen->geometry());
m_hdmiPanel->setWindowState(Qt::WindowFullScreen);
m_hdmiPanel->setWindowTitle(P_HDMI_NAME_STR);
m_hdmiPanel->show();
}
else if (screen->name() == P_EDP_NAME_STR)
{
if (m_edpPanel == nullptr)
m_edpPanel = new EdpPanel(nullptr);
m_edpPanel->setGeometry(screen->geometry());
m_edpPanel->setWindowState(Qt::WindowFullScreen);
m_edpPanel->setWindowTitle(P_EDP_NAME_STR);
m_edpPanel->show();
}
}
QObject::connect(qGuiApp, &QGuiApplication::screenAdded, this, &AppManage::screenAddedSlot);
QObject::connect(qGuiApp, &QGuiApplication::screenRemoved, this, &AppManage::screenRemovedSlot); ok, 多谢了
页:
[1]