void ListPropertyGridWidget::UpdateComboBoxWidgetWithPropertyValue(QComboBox* comboBoxWidget, const QMetaProperty& curProperty)
{
    if (!this->activeMetadata)
    {
        return;
    }

    bool isPropertyValueDiffers = false;
    const QString& propertyName = curProperty.name();
    int propertyValue = PropertiesHelper::GetPropertyValue<int>(this->activeMetadata, propertyName, isPropertyValueDiffers);

    // Firstly check the custom comboboxes.
    if (comboBoxWidget == ui->aggregatorsComboBox)
    {
        UpdateWidgetPalette(comboBoxWidget, propertyName);
		int index = nodeIDList.indexOf(propertyValue);
		
        SetComboboxSelectedItem(comboBoxWidget, ui->aggregatorsComboBox->itemText(index));
		return;
    }
	else if (comboBoxWidget == ui->orientationComboBox)
	{
	    UpdateWidgetPalette(comboBoxWidget, propertyName);
		
        SetComboboxSelectedItem(comboBoxWidget,  ListPropertyGridWidgetHelper::GetOrientationDescByType(
																		(UIList::eListOrientation)propertyValue));
		return;
	}

    // Not related to the custom combobox - call the generic one.
    BasePropertyGridWidget::UpdateComboBoxWidgetWithPropertyValue(comboBoxWidget, curProperty);
}
void BackGroundPropertyGridWidget::UpdateComboBoxWidgetWithPropertyValue(QComboBox* comboBoxWidget, const QMetaProperty& curProperty)
{
    if (!this->activeMetadata)
    {
        return;
    }

    bool isPropertyValueDiffers = false;
    const QString& propertyName = curProperty.name();
    int propertyValue = PropertiesHelper::GetPropertyValue<int>(this->activeMetadata, propertyName, isPropertyValueDiffers);

    // Firstly check the custom comboboxes.
    if (comboBoxWidget == ui->drawTypeComboBox)
    {
        UpdateWidgetPalette(comboBoxWidget, propertyName);
        return SetComboboxSelectedItem(comboBoxWidget,
                                       BackgroundGridWidgetHelper::GetDrawTypeDescByType((UIControlBackground::eDrawType)propertyValue));
    }
    else if (comboBoxWidget == ui->colorInheritComboBox)
    {
        UpdateWidgetPalette(comboBoxWidget, propertyName);
        return SetComboboxSelectedItem(comboBoxWidget,
                                       BackgroundGridWidgetHelper::GetColorInheritTypeDescByType((UIControlBackground::eColorInheritType)
                                       propertyValue));
    }
    else if (comboBoxWidget == ui->alignComboBox)
    {
        UpdateWidgetPalette(comboBoxWidget, propertyName);
        return SetComboboxSelectedItem(comboBoxWidget,
                                       BackgroundGridWidgetHelper::GetAlignTypeDescByType(propertyValue));
    }

    // Not related to the custom combobox - call the generic one.
    BasePropertyGridWidget::UpdateComboBoxWidgetWithPropertyValue(comboBoxWidget, curProperty);
}
void UITextFieldPropertyGridWidget::UpdateComboBoxWidgetWithPropertyValue(QComboBox* comboBoxWidget, const QMetaProperty& curProperty)
{
	if (!this->activeMetadata)
    {
        return;
    }

    bool isPropertyValueDiffers = false;
    const QString& propertyName = curProperty.name();
    int propertyValue = PropertiesHelper::GetPropertyValue<int>(this->activeMetadata, propertyName, isPropertyValueDiffers);

    // Firstly check the custom comboboxes.
    if (comboBoxWidget == ui->alignComboBox)
    {
        UpdateWidgetPalette(comboBoxWidget, propertyName);
        return SetComboboxSelectedItem(comboBoxWidget,
                                       BackgroundGridWidgetHelper::GetAlignTypeDescByType(propertyValue));
    }
	else if (comboBoxWidget == ui->autoCapitalizationTypeComboBox)
	{
		UpdateWidgetPalette(comboBoxWidget, propertyName);
		return SetComboboxSelectedItem(comboBoxWidget,
									BackgroundGridWidgetHelper::GetAutoCapitalizationTypeDescByType(propertyValue));
	}
	else if (comboBoxWidget == ui->autoCorrectionTypeComboBox)
	{
		UpdateWidgetPalette(comboBoxWidget, propertyName);
		return SetComboboxSelectedItem(comboBoxWidget,
									   BackgroundGridWidgetHelper::GetAutoCorrectionTypeDescByType(propertyValue));
	}
	else if (comboBoxWidget == ui->spellCheckingTypeComboBox)
	{
		UpdateWidgetPalette(comboBoxWidget, propertyName);
		return SetComboboxSelectedItem(comboBoxWidget,
									   BackgroundGridWidgetHelper::GetSpellCheckingTypeDescByType(propertyValue));
	}
	else if (comboBoxWidget == ui->keyboardAppearanceTypeComboBox)
	{
		UpdateWidgetPalette(comboBoxWidget, propertyName);
		return SetComboboxSelectedItem(comboBoxWidget,
									   BackgroundGridWidgetHelper::GetKeyboardAppearanceTypeDescByType(propertyValue));
	}
	else if (comboBoxWidget == ui->keyboardTypeComboBox)
	{
		UpdateWidgetPalette(comboBoxWidget, propertyName);
		return SetComboboxSelectedItem(comboBoxWidget,
									   BackgroundGridWidgetHelper::GetKeyboardTypeDescByType(propertyValue));
	}
	else if (comboBoxWidget == ui->returnKeyTypeComboBox)
	{
		UpdateWidgetPalette(comboBoxWidget, propertyName);
		return SetComboboxSelectedItem(comboBoxWidget,
									   BackgroundGridWidgetHelper::GetReturnKeyTypeDescByType(propertyValue));
	}

    // Not related to the custom combobox - call the generic one.
    BasePropertyGridWidget::UpdateComboBoxWidgetWithPropertyValue(comboBoxWidget, curProperty);
}
void TextPropertyGridWidget::UpdateComboBoxWidgetWithPropertyValue(QComboBox* comboBoxWidget, const QMetaProperty& curProperty)
{
	if (!this->activeMetadata)
    {
        return;
    }
    
    bool isPropertyValueDiffers = false;
    const QString& propertyName = curProperty.name();
    
    // Firstly check the custom comboboxes.
    if (comboBoxWidget == ui->alignComboBox)
    {
        int propertyValue = PropertiesHelper::GetPropertyValue<int>(this->activeMetadata, propertyName, isPropertyValueDiffers);
        
        UpdateWidgetPalette(comboBoxWidget, propertyName);
        return SetComboboxSelectedItem(comboBoxWidget,
                                       BackgroundGridWidgetHelper::GetAlignTypeDescByType(propertyValue));
    }
	else if(comboBoxWidget == ui->fontPresetComboBox)
    {
        Font* propertyValue = PropertiesHelper::GetPropertyValue<Font*>(this->activeMetadata, propertyName, isPropertyValueDiffers);
        
        QString fontPresetName = QString::fromStdString(EditorFontManager::Instance()->GetLocalizedFontName(propertyValue));
        
        UpdateWidgetPalette(comboBoxWidget, propertyName); // what is it for? - needed for controls like UIButton
        
//        int index = comboBoxWidget->findText(fontPresetName); //TODO: remove debug log
//        Logger::Debug("TextPropertyGridWidget::UpdateComboBoxWidgetWithPropertyValue %s index=%d", fontPresetName.toStdString().c_str(), index);
        
        return SetComboboxSelectedItem(ui->fontPresetComboBox, fontPresetName );
    }
    
    // Not related to the custom combobox - call the generic one.
    BasePropertyGridWidget::UpdateComboBoxWidgetWithPropertyValue(comboBoxWidget, curProperty);
}
void RectPropertyGridWidget::UpdateDoubleSpinBoxWidgetWithPropertyValue(QDoubleSpinBox *spinBox, const QMetaProperty& curProperty)
{
    bool isPropertyValueDiffers = false;
    double value =
    PropertiesHelper::GetAllPropertyValues<double>(this->activeMetadata,
                                                   curProperty.name(),
                                                   isPropertyValueDiffers);

    {
        WidgetSignalsBlocker blocker(spinBox);
        AdjustablePointDoubleSpinBox* customSpinBox = dynamic_cast<AdjustablePointDoubleSpinBox*>(spinBox);
        if (customSpinBox)
        {
            customSpinBox->SetValueAndAdjustPoint(value);
        }
        else
        {
            spinBox->setValue(value);
        }
    }

    UpdateWidgetPalette(spinBox, curProperty.name());
}