void PrefsDialog::initLayout(QFileInfoList & list) { m_tabWidget = new QTabWidget(); m_general = new QWidget(); m_breadboard = new QWidget(); //m_schematic = new QWidget(); //m_pcb = new QWidget(); m_tabWidget->addTab(m_general, tr("General")); m_tabWidget->addTab(m_breadboard, m_viewInfoThings[0].viewName); //m_tabWidget->addTab(m_schematic, m_viewInfoThings[1].viewName); //m_tabWidget->addTab(m_pcb, m_viewInfoThings[2].viewName); QVBoxLayout * vLayout = new QVBoxLayout(); vLayout->addWidget(m_tabWidget); initGeneral(m_general, list); initBreadboard(m_breadboard, &m_viewInfoThings[0]); //initSchematic(m_schematic, &m_viewInfoThings[1]); //initPCB(m_pcb, &m_viewInfoThings[2]); QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel")); buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK")); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); vLayout->addWidget(buttonBox); this->setLayout(vLayout); }
void PrefsDialog::initLayout(QFileInfoList & languages, QList<Platform *> platforms) { m_tabWidget = new QTabWidget(); m_general = new QWidget(); m_breadboard = new QWidget(); m_schematic = new QWidget(); m_pcb = new QWidget(); m_code = new QWidget(); m_tabWidget->setObjectName("preDia_tabs"); m_tabWidget->addTab(m_general, tr("General")); m_tabWidget->addTab(m_breadboard, m_viewInfoThings[0].viewName); m_tabWidget->addTab(m_schematic, m_viewInfoThings[1].viewName); m_tabWidget->addTab(m_pcb, m_viewInfoThings[2].viewName); m_tabWidget->addTab(m_code, tr("Code View")); QVBoxLayout * vLayout = new QVBoxLayout(); vLayout->addWidget(m_tabWidget); initGeneral(m_general, languages); initBreadboard(m_breadboard, &m_viewInfoThings[0]); initSchematic(m_schematic, &m_viewInfoThings[1]); initPCB(m_pcb, &m_viewInfoThings[2]); initCode(m_code, platforms); m_platforms = platforms; QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel")); buttonBox->button(QDialogButtonBox::Ok)->setText(tr("OK")); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); vLayout->addWidget(buttonBox); this->setLayout(vLayout); }