MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / AddViewers

Method AddViewers

Plugins/FreeRDP/Client/DlgSetFreeRDP.cpp:690–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688}
689
690void CDlgSetFreeRDP::AddViewers(const QList<QWidget *> &wViewer)
691{
692 int nWidth = 0;
693 int nHeigth = 0;
694 foreach(auto p, wViewer) {
695 if(!p) continue;
696 nWidth = qMax(nWidth, p->frameSize().width());
697 nHeigth = qMax(nHeigth, p->frameSize().height());
698 }
699 bool bScroll = false;
700 QScreen* pScreen = QApplication::primaryScreen();
701 QSize size = this->size();
702 if(nWidth > size.width() || nHeigth > size.height())
703 bScroll = true;
704 // [connect accepted to slotAccept of widget]
705 foreach(auto p, wViewer)
706 {
707 QString szMsg;
708 QWidget* pView = p;
709 if(bScroll)
710 {
711 QScrollArea* pScroll = new QScrollArea(ui->tabWidget);
712 if(!pScroll) continue;
713 pScroll->setWidget(p);
714 pView = pScroll;
715 }
716 ui->tabWidget->addTab(pView, p->windowIcon(), p->windowTitle());
717 bool check = false;
718 check = connect(this, SIGNAL(accepted()), p, SLOT(slotAccept()));
719 if(!check)
720 {
721 szMsg = "Class '" + QString(p->metaObject()->className())
722 + "' must has slot slotAccept(), please add it. "
723 + "Or the class derived from CParameterUI";
724 qCritical(log) << szMsg;
725 }
726 Q_ASSERT_X(check, "CParameterDlgSettings", szMsg.toStdString().c_str());
727 }
728 // [connect accepted to slotAccept of widget]
729}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected