MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / build_dynamic_panel

Method build_dynamic_panel

DSView/pv/dialogs/deviceoptions.cpp:823–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

821}
822
823void DeviceOptions::build_dynamic_panel()
824{
825 _isBuilding = true;
826
827 if (_dynamic_panel != NULL){
828 _dynamic_panel->deleteLater();
829 _dynamic_panel = NULL;
830 }
831
832 QFont font = this->font();
833 font.setPointSizeF(AppConfig::Instance().appOptions.fontSize);
834
835 if (_dynamic_panel == NULL)
836 {
837 _dynamic_panel = new QGroupBox("group", _dynamic_panel);
838 _dynamic_panel->setFont(font);
839 _container_lay->addWidget(_dynamic_panel);
840
841 if (_device_agent->get_work_mode() == LOGIC)
842 _dynamic_panel->setLayout(new QVBoxLayout());
843 else
844 _dynamic_panel->setLayout(new QGridLayout());
845 }
846
847 QString title = dynamic_widget(_dynamic_panel->layout());
848 QGroupBox *box = dynamic_cast<QGroupBox*>(_dynamic_panel);
849 box->setFont(font);
850 box->setTitle(title);
851
852 if (title == ""){
853 box->setVisible(false);
854 }
855
856 _dynamic_panel->layout()->setContentsMargins(5, 20, 5, 5);
857
858 _isBuilding = false;
859}
860
861void DeviceOptions::try_resize_scroll()
862{

Callers 1

DeviceOptionsMethod · 0.95

Calls 3

get_work_modeMethod · 0.80
layoutMethod · 0.80
setTitleMethod · 0.45

Tested by

no test coverage detected