|
发表于 2024-3-26 11:02:33
只看该作者
沙发
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);
复制代码 |
|