QWidget *DatatypeCombobox::createEditor(QWidget *oParent, const QStyleOptionViewItem &oOption, QModelIndex const &oIndex) const { if(hasEditor(oIndex)) { QComboBox *cb = new QComboBox(oParent); cb->setAutoFillBackground(true); // Required to show the comboboxes in the view correctly. for(std::pair<DataType, spt::string::string_t> const &p : mTypeStrings) cb->addItem(p.second); return cb; } return QStyledItemDelegate::createEditor(oParent, oOption, oIndex); }
AudioProcessorEditor* AudioProcessor::createEditorIfNeeded() { if (activeEditor != nullptr) return activeEditor; AudioProcessorEditor* const ed = createEditor(); // You must make your hasEditor() method return a consistent result! jassert (hasEditor() == (ed != nullptr)); if (ed != nullptr) { // you must give your editor comp a size before returning it.. jassert (ed->getWidth() > 0 && ed->getHeight() > 0); const ScopedLock sl (callbackLock); activeEditor = ed; } return ed; }
// File unloader. void qtractor_vst_scan::close (void) { if (m_pLibrary == NULL) return; #ifdef CONFIG_DEBUG_0 qDebug("qtractor_vst_scan[%p]::close()", this); #endif const bool bAutoUnload = !hasEditor(); vst_dispatch(effClose, 0, 0, 0, 0.0f); if (m_pLibrary->isLoaded() && bAutoUnload) m_pLibrary->unload(); delete m_pLibrary; m_pLibrary = NULL; m_pEffect = NULL; m_iFlagsEx = 0; m_sName.clear(); }