MCPcopy Create free account
hub / github.com/KDE/kdevelop / createEditor

Method createEditor

kdevplatform/shell/launchconfigurationdialog.cpp:943–968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

941
942
943QWidget* LaunchConfigurationModelDelegate::createEditor ( QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index ) const
944{
945 const auto* model = static_cast<const LaunchConfigurationsModel*>(index.model());
946 ILaunchMode* mode = model->modeForIndex( index );
947 LaunchConfiguration* config = model->configForIndex( index );
948 if( index.column() == 1 && mode && config )
949 {
950 auto* box = new KComboBox( parent );
951 const QList<ILauncher*> launchers = config->type()->launchers();
952 for (auto* launcher : launchers) {
953 if (launcher->supportedModes().contains(mode->id())) {
954 box->addItem(launcher->name(), launcher->id());
955 }
956 }
957 return box;
958 } else if( !mode && config && index.column() == 1 )
959 {
960 auto* box = new KComboBox( parent );
961 const QList<LaunchConfigurationType*> types = Core::self()->runController()->launchConfigurationTypes();
962 for (auto* type : types) {
963 box->addItem(type->name(), type->id());
964 }
965 return box;
966 }
967 return QStyledItemDelegate::createEditor ( parent, option, index );
968}
969
970void LaunchConfigurationModelDelegate::setEditorData ( QWidget* editor, const QModelIndex& index ) const
971{

Callers

nothing calls this directly

Calls 13

modeForIndexMethod · 0.80
configForIndexMethod · 0.80
launchersMethod · 0.80
runControllerMethod · 0.80
modelMethod · 0.45
columnMethod · 0.45
typeMethod · 0.45
containsMethod · 0.45
supportedModesMethod · 0.45
idMethod · 0.45
addItemMethod · 0.45

Tested by

no test coverage detected