コード例 #1
0
ファイル: wangcolorview.cpp プロジェクト: bjorn/tiled
void WangColorView::pickColor()
{
    QColorDialog *colorPicker = new QColorDialog(this);
    colorPicker->setAttribute(Qt::WA_DeleteOnClose);
    colorPicker->setCurrentColor(mClickedWangColor->color());
    connect(colorPicker, &QColorDialog::colorSelected,
            this, &WangColorView::colorPicked);

    colorPicker->open();
}
コード例 #2
0
ファイル: settings.cpp プロジェクト: OpenInkpot-archive/cr3
void SettingsDlg::colorDialog( const char * optionName, QString title )
{
    QColorDialog dlg;
    dlg.setWindowTitle(title);
    dlg.setCurrentColor( getColor( optionName, 0x000000 ) );
    if ( dlg.exec() == QDialog::Accepted ) {
        setColor( optionName, dlg.currentColor() );
        updateStyleSample();
    }
}
コード例 #3
0
ファイル: lrcoloreditor.cpp プロジェクト: DrGluck/LimeReport
void ColorEditor::slotClicked()
{
    m_buttonPressed = true;
    QColorDialog* dialog = new QColorDialog(this);
    dialog->setCurrentColor(m_color);
    if (dialog->exec()) m_color=dialog->currentColor();
    delete dialog;
    setFocusToParent();
    emit(editingFinished());
}
コード例 #4
0
void CWizPreferenceWindow::on_pushButtonBackgroundColor_clicked()
{
    QColorDialog dlg;
    dlg.setCurrentColor(m_app.userSettings().editorBackgroundColor());
    if (dlg.exec() == QDialog::Accepted)
    {
        QString strColor = dlg.currentColor().name();
        updateEditorBackgroundColor(strColor);
    }
}
コード例 #5
0
void MainWindow::on_actionSet_background_color_2_triggered()
{
    QColorDialog dialog;
    dialog.setCurrentColor(mBackgroundColor);
    int result = dialog.exec();

    if (result)
    {
        mBackgroundColor = dialog.currentColor();
    }
}
コード例 #6
0
void ChatBrowser::backGroundChanged()
{
    QColorDialog dialog;
    dialog.setCurrentColor(m_bgColor);

    if(dialog.exec()==QDialog::Accepted)
    {
        m_bgColor=dialog.currentColor();
        setStyleSheet(QString("QTextBrowser { background:%1;}").arg(m_bgColor.name()));
    }
}
コード例 #7
0
void PeopleEditionDialog::on_pbColor_clicked()
{
	QColorDialog dlg;
	// Setting the selected color to the character's one
	dlg.setCurrentColor(QColor(_people->color()));

	// Connecting slot
	connect(&dlg, SIGNAL(currentColorChanged(QColor)), this, SLOT(OnColorSelected(QColor)));

	dlg.exec();
}
コード例 #8
0
void QColorPushButton::mousePressEvent(QMouseEvent* pEvent)
{
	QColorDialog ColorDialog;

	connect(&ColorDialog, SIGNAL(currentColorChanged(const QColor&)), this, SLOT(OnCurrentColorChanged(const QColor&)));

	ColorDialog.setWindowIcon(GetIcon("color--pencil"));
	ColorDialog.setCurrentColor(m_Color);
	ColorDialog.exec();

	disconnect(&ColorDialog, SIGNAL(currentColorChanged(const QColor&)), this, SLOT(OnCurrentColorChanged(const QColor&)));
}
コード例 #9
0
ファイル: SettingsWidget.cpp プロジェクト: alecs1/home
void SettingsWidget::showColourDialog() {
    QColorDialog colorDialog;
    colorDialog.setCurrentColor(settings.tableColour);

    if (colorDialog.exec() == QDialog::Accepted) {
        QColor colour = colorDialog.selectedColor();
        settings.tableColour = colour.name();
        QString colourStyleSheet = "background-color: " + colour.name() + ";";
        ui->colourButton->setStyleSheet(colourStyleSheet);
        applySettings();
    }

}
コード例 #10
0
void EnvironmentSettingsDialog::on_highlightBarColor_clicked()
{
   QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
   QColorDialog dlg;

   dlg.setCurrentColor(m_highlightBarColor);

   if (dlg.exec() == QColorDialog::Accepted)
   {
      m_highlightBarColor = dlg.selectedColor();
      m_scintilla->setMarkerBackgroundColor(m_highlightBarColor,Marker_Highlight);
   }
}
コード例 #11
0
void PropertiesEditorItem::slotOpenColorEditor()
{
    QColorDialog *dialog = new QColorDialog(parent());
    dialog->setCurrentColor(mProperty.read(mObject.data()).value<QColor>());
    if (dialog->exec() == QDialog::Accepted) {
        mProperty.write(mObject.data(), QVariant::fromValue(dialog->currentColor()));

        QPushButton *button = qobject_cast<QPushButton*>(mWidget.data());
        button->setText(dialog->currentColor().name());
    }

    delete dialog;
}
コード例 #12
0
void CustomGoalWidgetTest::ColorTest()
{
    QFETCH(QTestEventList, events);
    QFETCH(QColor, color);

    QColorDialog * dialog;

    events.simulate(m_ui->btn_Color);
    dialog = m_widget->d_ptr->colorDialog;
    QVERIFY(dialog != NULL);

    if( dialog == NULL )
        return;

    QVERIFY(QTest::qWaitForWindowActive(dialog));

    dialog->setCurrentColor(color);
    QTest::keyClick(dialog, Qt::Key_Return);

    // test cancel and button background color

    QCOMPARE(m_widget->Color(), color);
    QCOMPARE(GetBackgroundColorName(m_ui->btn_Color), color.name());

    events.simulate(m_ui->btn_Color);
    dialog = m_widget->d_ptr->colorDialog;
    QVERIFY(dialog != NULL);

    if( dialog == NULL )
        return;

    QVERIFY(QTest::qWaitForWindowActive(dialog));

    dialog->setCurrentColor(QColor(1,1,1));
    QTest::keyClick(dialog, Qt::Key_Escape);

    QCOMPARE(m_widget->Color(), color);
    QCOMPARE(GetBackgroundColorName(m_ui->btn_Color), color.name());
}
コード例 #13
0
void EnvironmentSettingsDialog::on_styleColor_clicked()
{
   QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
   QColorDialog dlg;
   int style = ui->styleName->itemData(ui->styleName->currentIndex()).toInt();

   dlg.setCurrentColor(m_lexer->color(style));

   if (dlg.exec() == QColorDialog::Accepted)
   {
      QColor chosenColor = dlg.selectedColor();
      m_lexer->setColor(chosenColor,style);
   }
}
コード例 #14
0
void EnvironmentSettingsDialog::on_backgroundColor_clicked()
{
   QSettings settings(QSettings::IniFormat, QSettings::UserScope, "CSPSoftware", "NESICIDE");
   QColorDialog dlg;

   dlg.setCurrentColor(m_lexer->defaultPaper());

   if (dlg.exec() == QColorDialog::Accepted)
   {
      QColor chosenColor = dlg.selectedColor();
      m_lexer->setDefaultPaper(chosenColor);
      m_lexer->setPaper(chosenColor,-1);
   }
}
コード例 #15
0
void Control3DWidget::onLightColorPicker()
{
    QColorDialog* pDialog = new QColorDialog(this);
    pDialog->setCurrentColor(m_colCurrentLightColor);

    //Update all connected View3D's scene colors
    connect(pDialog, &QColorDialog::currentColorChanged,
            this, &Control3DWidget::onLightColorChanged);

    pDialog->exec();
    m_colCurrentLightColor = pDialog->currentColor();

    //Set color of button new new scene color
    ui->m_pushButton_lightColorPicker->setStyleSheet(QString("background-color: rgb(%1, %2, %3);").arg(m_colCurrentLightColor.red()).arg(m_colCurrentLightColor.green()).arg(m_colCurrentLightColor.blue()));
}
コード例 #16
0
void CDialogIrcSettings::on_toolButtonChangeColorLink_clicked()
{
	QColorDialog* dlgColor = new QColorDialog( this );
	dlgColor->setCurrentColor( m_ColorLink );

	int result = dlgColor->exec();

	if ( result == QDialog::Accepted )
	{
		m_ColorLink = dlgColor->currentColor();
		ui->labelColorLink->setStyleSheet( QString( "background-color: %1;" ).arg( m_ColorLink.name() ) );

		ui->pushButtonApply->setEnabled( true );
	}
}
コード例 #17
0
ファイル: ColorButton.cpp プロジェクト: Atarity/Lightpack
void ColorButton::click()
{
    QColorDialog * dialog = new QColorDialog(this);
    dialog->setWindowFlags(Qt::Window
                          | Qt::WindowStaysOnTopHint
                          | Qt::CustomizeWindowHint
                          | Qt::WindowCloseButtonHint);

    QColor savedColor = getColor();
    connect(dialog, SIGNAL(currentColorChanged(QColor)), this, SLOT(currentColorChanged(QColor)));
    dialog->setCurrentColor(getColor());
    if (dialog->exec() != QDialog::Accepted)
        setColor(savedColor);
    delete dialog;
}
コード例 #18
0
void cQSettingsDialog::OnColorClicked( bool iChecked )
/**********************************************************************/
{
    QPushButton *vSender = (QPushButton*)sender();
    Ogre::ColourValue *iColor = (Ogre::ColourValue*)(qvariant_cast<void*>(vSender->property("OgreColor")));
    QColorDialog vDialog;
    vDialog.setCurrentColor( QColor( iColor->r * 255, iColor->g * 255, iColor->b * 255 ) );
    if ( !vDialog.exec() ) return;

    QColor vColor = vDialog.currentColor();
    iColor->r = vColor.red()   / 255.0f;
    iColor->g = vColor.green() / 255.0f;
    iColor->b = vColor.blue()  / 255.0f;
    
    QPixmap vPixmap( 24, 16 );
    vPixmap.fill( vColor );
    vSender->setIcon( QIcon( vPixmap ) );
}
コード例 #19
0
ファイル: control3dwidget.cpp プロジェクト: GeorgyZar/mne-cpp
void Control3DWidget::onSceneColorPicker()
{
    QColorDialog* pDialog = new QColorDialog(this);
    pDialog->setCurrentColor(m_colCurrentSceneColor);

    //Update all connected View3D's scene colors
    for(int i = 0; i<m_lView3D.size(); i++) {
        connect(pDialog, &QColorDialog::currentColorChanged,
                m_lView3D.at(i).data(), &View3D::setSceneColor);
    }

    pDialog->exec();
    m_colCurrentSceneColor = pDialog->currentColor();

    ui->m_pushButton_sceneColorPicker->setStyleSheet(QString("background-color: rgb(%1, %2, %3);").arg(m_colCurrentSceneColor.red()).arg(m_colCurrentSceneColor.green()).arg(m_colCurrentSceneColor.blue()));


}
コード例 #20
0
ファイル: colorsicon.cpp プロジェクト: VojtechVitek/spaint
void ColorsIcon::pickColor(QPalette::ColorRole role)
{
   // TODO: QColorDialog is bugged. Corrupts alpha when no adjustment occurs.
   QColorDialog dlg;
   dlg.setOption(QColorDialog::DontUseNativeDialog);
   dlg.setOption(QColorDialog::ShowAlphaChannel);
   dlg.setCurrentColor(role == QPalette::Foreground ? mPen : mBrush);
   dlg.setWindowTitle(role == QPalette::Foreground ?
                      tr("Select pen color") :
                      tr("Select brush color"));

   // Execute dialog
   if(dlg.exec() == QDialog::Accepted) {

      // Emit color change
      emit colorPicked(role, dlg.currentColor());
   }
}
コード例 #21
0
void PreferencesDialog::on_waveView_doubleClicked(const QModelIndex &index)
{
    if (index.column() == 1) {
        QColorDialog a;

        if (!(index.flags() & Qt::ItemIsEnabled)) return;
        quint32 color = index.data(Qt::UserRole).toUInt();

        a.setCurrentColor(QColor((QRgb)color));

        if (a.exec() == QColorDialog::Accepted) {
            quint32 cv = a.currentColor().rgba();

            waveFilterModel->setData(index, cv, Qt::UserRole);
            waveFilterModel->setData(index, a.currentColor(), Qt::BackgroundRole);

        }

    }
}
コード例 #22
0
void PreferencesDialog::on_eventTable_doubleClicked(const QModelIndex &index)
{
    int row=index.row();
    int col=index.column();
    bool ok;
    int id=ui->eventTable->item(row,3)->text().toInt(&ok);
    if (col==1) {
        QWidget *w=ui->eventTable->cellWidget(row,col);
        QColorDialog a;
        QColor color=w->palette().background().color();
        a.setCurrentColor(color);
        if (a.exec()==QColorDialog::Accepted) {
            QColor c=a.currentColor();
            QPalette p(c,c,c,c,c,c,c);
            w->setPalette(p);
            m_new_colors[id]=c;
            //qDebug() << "Color accepted" << col << id;
        }
    }
}
コード例 #23
0
//--------------------------------------------------------------------------------------
void RMapObjectTableViewDelegate::setEditorData(QWidget *editor,
                                                const QModelIndex &index) const
{

    switch (index.data(Qt::UserRole).toInt()) {
    case RMapObjectModel::ET_COLOR_SELECTOR: {
        QColorDialog *colorbox = static_cast<QColorDialog *>(editor);
        QColor color = index.model()->data(index, Qt::EditRole).value<QColor>();
        colorbox->setCurrentColor(color);
        break;
    }

    case RMapObjectModel::ET_FONT_SELECTOR: {
        RFontSelectorDialog *fontSelector = static_cast<RFontSelectorDialog *>(editor);
        const RFontDescriptor *fd = index.model()->data(index, Qt::EditRole).value<const RFontDescriptor *>();
        fontSelector->setCurrentFontDescriptor(fd);
        break;
    }

    case RMapObjectModel::ET_PICTURE_SELECTOR: {
        RPictureSelectorDialog *pictureSelector = static_cast<RPictureSelectorDialog *>(editor);
        const RImageDescriptor *id = index.model()->data(index, Qt::EditRole).value<const RImageDescriptor *>();
        pictureSelector->setCurrentImageDescriptor(id);
        break;
    }

    case RMapObjectModel::ET_REFS_SELECTOR: {
        QComboBox *refsSelector = static_cast<QComboBox *>(editor);
        const RRefsDescriptor *rd = index.model()->data(index, Qt::EditRole).value<const RRefsDescriptor *>();
        int pos = refsSelector->findData(rd->id());
        refsSelector->setCurrentIndex(pos);
        break;
    }

    default:
        QItemDelegate::setEditorData(editor, index);
        break;
    }
}
コード例 #24
0
ファイル: alertas_ui.cpp プロジェクト: rodety/Clinica
void alertas_ui::on_pushButton_Alert_changeColor_clicked()
{
    if(!ui->tableWidget_AlertList->currentItem())
        return;
    else
        if(ui->tableWidget_AlertList->currentItem()->text()=="")
            return;

    QString ALERTA_CODE;
    QSqlQuery query;


    ALERTA_CODE = ui->lineEdit_code->text();


    QColor dfault = ui->tableWidget_AlertList->currentItem()->backgroundColor();
    QColorDialog *palette = new QColorDialog();
    palette->setCurrentColor(dfault);
    palette->exec();


    QColor color(palette->currentColor());
    QString COLOR_VALUE = color.name();

    int FILA = ui->tableWidget_AlertList->currentItem()->row();

    setColorRow(ui->tableWidget_AlertList,FILA,COLOR_VALUE);


    query.prepare("UPDATE e_alerta SET color=? WHERE alerta_pk="+ALERTA_CODE);
    query.bindValue(0,COLOR_VALUE);
    query.exec();



    qDebug()<<color.rgb()<<" "<<COLOR_VALUE<<endl;
}
コード例 #25
0
 virtual void accept()
 {
     KColorDialog::accept();
     original->setCurrentColor(color());
     QMetaObject::invokeMethod(original, "accept"); //workaround protected
 }
コード例 #26
0
void Data3DTreeDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const
{
    const Data3DTreeModel* pData3DTreeModel = static_cast<const Data3DTreeModel*>(index.model());
    const AbstractTreeItem* pAbstractItem = static_cast<const AbstractTreeItem*>(pData3DTreeModel->itemFromIndex(index));

    switch(pAbstractItem->type()) {
        case MetaTreeItemTypes::SurfaceColorGyri: {
            QColor color = index.model()->data(index, MetaTreeItemRoles::SurfaceColorGyri).value<QColor>();
            QColorDialog* pColorDialog = static_cast<QColorDialog*>(editor);
            pColorDialog->setCurrentColor(color);
            break;
        }

        case MetaTreeItemTypes::SurfaceColorSulci: {
            QColor color = index.model()->data(index, MetaTreeItemRoles::SurfaceColorSulci).value<QColor>();
            QColorDialog* pColorDialog = static_cast<QColorDialog*>(editor);
            pColorDialog->setCurrentColor(color);
            break;
        }

        case MetaTreeItemTypes::RTDataColormapType: {
            QString colormap = index.model()->data(index, MetaTreeItemRoles::RTDataColormapType).toString();
            QComboBox* pComboBox = static_cast<QComboBox*>(editor);
            pComboBox->setCurrentText(colormap);
            break;
        }

        case MetaTreeItemTypes::RTDataNormalizationValue: {
            Spline* pSpline = static_cast<Spline*>(editor);
            int width = pSpline->size().width();
            int height = pSpline->size().height();
            if (pSpline->size().width() < 200 && pSpline->size().height() < 200)
            {
                pSpline->resize(600,400);   //resize histogram to be readable with default size
            }
            else
            {
                width = pSpline->size().width();   //keeps the size of the histogram
                height = pSpline->size().height();
                pSpline->resize(width,height);
            }
            return;
        }

        case MetaTreeItemTypes::RTDataTimeInterval: {
            int value = index.model()->data(index, MetaTreeItemRoles::RTDataTimeInterval).toInt();
            QSpinBox* pSpinBox = static_cast<QSpinBox*>(editor);
            pSpinBox->setValue(value);
            break;
        }

        case MetaTreeItemTypes::RTDataVisualizationType: {
            QString visType = index.model()->data(index, MetaTreeItemRoles::RTDataVisualizationType).toString();
            QComboBox* pComboBox = static_cast<QComboBox*>(editor);
            pComboBox->setCurrentText(visType);
            break;
        }

        case MetaTreeItemTypes::SurfaceColor: {
            QColor color = index.model()->data(index, MetaTreeItemRoles::SurfaceColor).value<QColor>();
            QColorDialog* pColorDialog = static_cast<QColorDialog*>(editor);
            pColorDialog->setCurrentColor(color);
            break;
        }

        case MetaTreeItemTypes::PointColor: {
            QColor color = index.model()->data(index, MetaTreeItemRoles::PointColor).value<QColor>();
            QColorDialog* pColorDialog = static_cast<QColorDialog*>(editor);
            pColorDialog->setCurrentColor(color);
            break;
        }

        case MetaTreeItemTypes::RTDataNumberAverages: {
            int value = index.model()->data(index, MetaTreeItemRoles::RTDataNumberAverages).toInt();
            QSpinBox* pSpinBox = static_cast<QSpinBox*>(editor);
            pSpinBox->setValue(value);
            break;
        }

        case MetaTreeItemTypes::SurfaceAlpha: {
            int value = index.model()->data(index, MetaTreeItemRoles::SurfaceAlpha).toDouble();
            QSpinBox* pSpinBox = static_cast<QSpinBox*>(editor);
            pSpinBox->setValue(value);
            break;
        }

        case MetaTreeItemTypes::SurfaceTranslateX: {
            double value = index.model()->data(index, MetaTreeItemRoles::SurfaceTranslateX).toDouble();
            QDoubleSpinBox* pDoubleSpinBox = static_cast<QDoubleSpinBox*>(editor);
            pDoubleSpinBox->setValue(value);
            break;
        }

        case MetaTreeItemTypes::SurfaceTranslateY: {
            double value = index.model()->data(index, MetaTreeItemRoles::SurfaceTranslateY).toDouble();
            QDoubleSpinBox* pDoubleSpinBox = static_cast<QDoubleSpinBox*>(editor);
            pDoubleSpinBox->setValue(value);
            break;
        }

        case MetaTreeItemTypes::SurfaceTranslateZ: {
            double value = index.model()->data(index, MetaTreeItemRoles::SurfaceTranslateZ).toDouble();
            QDoubleSpinBox* pDoubleSpinBox = static_cast<QDoubleSpinBox*>(editor);
            pDoubleSpinBox->setValue(value);
            break;
        }        

        case MetaTreeItemTypes::NetworkThreshold: {
            Spline* pSpline = static_cast<Spline*>(editor);
            int width = pSpline->size().width();
            int height = pSpline->size().height();
            if (pSpline->size().width() < 200 && pSpline->size().height() < 200)   //pSpline initializes with size (137,15)
            {
                pSpline->resize(800,600);   //resize histogram to be readable with default size
            }
            else
            {
                width = pSpline->size().width();   //keeps the size of the histogram
                height = pSpline->size().height();
                pSpline->resize(width,height);
            }
            return;
        }

        default: // do nothing;
            break;
    }

    QItemDelegate::setEditorData(editor, index);
}
コード例 #27
0
ファイル: data3Dtreedelegate.cpp プロジェクト: chdinh/mne-cpp
void Data3DTreeDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const
{    
    const Data3DTreeModel* pData3DTreeModel = static_cast<const Data3DTreeModel*>(index.model());
    const AbstractTreeItem* pAbstractItem = static_cast<const AbstractTreeItem*>(pData3DTreeModel->itemFromIndex(index));

    // Only catch non-standard Qt types such as QColorDialog or items which need special handling for display role (e.g. Thresholding) etc.
    switch(pAbstractItem->type()) {
        case MetaTreeItemTypes::SurfaceColorGyri: {
            QColor color = index.model()->data(index, MetaTreeItemRoles::SurfaceColorGyri).value<QColor>();
            QColorDialog* pColorDialog = static_cast<QColorDialog*>(editor);
            pColorDialog->setCurrentColor(color);
            break;
        }

        case MetaTreeItemTypes::SurfaceColorSulci: {
            QColor color = index.model()->data(index, MetaTreeItemRoles::SurfaceColorSulci).value<QColor>();
            QColorDialog* pColorDialog = static_cast<QColorDialog*>(editor);
            pColorDialog->setCurrentColor(color);
            break;
        }

        case MetaTreeItemTypes::Color: {
            QColor color = index.model()->data(index, MetaTreeItemRoles::Color).value<QColor>();
            QColorDialog* pColorDialog = static_cast<QColorDialog*>(editor);
            pColorDialog->setCurrentColor(color);
            break;
        }

        case MetaTreeItemTypes::DataThreshold: {              
            if(Spline* pSpline = static_cast<Spline*>(editor)) {
                //Find the parent and retreive real-time data to calcualte the histogram
                if(AbstractTreeItem* pParentItem = static_cast<AbstractTreeItem*>(pAbstractItem->QStandardItem::parent())) {
                    QModelIndex indexParent = pData3DTreeModel->indexFromItem(pParentItem);

                    //Get data
                    MatrixXd matRTData;
                    QVariant data;

                    data = index.model()->data(indexParent, Data3DTreeModelItemRoles::Data);

                    if(data.canConvert<MatrixXd>()) {
                        matRTData = data.value<MatrixXd>();
                        matRTData = matRTData.cwiseAbs();

                        //Calcualte histogram
                        Eigen::VectorXd resultClassLimit;
                        Eigen::VectorXi resultFrequency;
                        MNEMath::histcounts(matRTData, false, 50, resultClassLimit, resultFrequency, 0.0, 0.0);

                        //Create histogram plot
                        pSpline->setData(resultClassLimit, resultFrequency);
                        QVector3D vecThresholdValues = index.model()->data(index, MetaTreeItemRoles::DataThreshold).value<QVector3D>();
                        pSpline->setThreshold(vecThresholdValues);

                        QList<QStandardItem*> pColormapItem = pParentItem->findChildren(MetaTreeItemTypes::ColormapType);
                        for(int i = 0; i < pColormapItem.size(); ++i) {
                            if(pColormapItem.at(i)) {
                                QModelIndex indexColormapItem = pData3DTreeModel->indexFromItem(pColormapItem.at(i));
                                QString colorMap = index.model()->data(indexColormapItem, MetaTreeItemRoles::ColormapType).value<QString>();
                                pSpline->setColorMap(colorMap);
                            }
                        }
                    }
                }

                pSpline->resize(600,400);
            }

            break;
        }

        // Handle basic types (QString, int, double, etc.) by default via QItemDelegate::setEditorData
        default: {
            QItemDelegate::setEditorData(editor, index);
        }
    }
}