109 col.setNamedColor(editValue->text()); |
109 col.setNamedColor(editValue->text()); |
110 if (col.isValid()) { |
110 if (col.isValid()) { |
111 value = qVariantFromValue(col); |
111 value = qVariantFromValue(col); |
112 } else { |
112 } else { |
113 QMessageBox::warning(this, tr("Can't parse input"), |
113 QMessageBox::warning(this, tr("Can't parse input"), |
114 QString(tr("Failed to create a color from %1\n" |
114 tr("Failed to create a color from %1\n" |
115 "The string has to be a valid color name (e.g. 'red')\n" |
115 "The string has to be a valid color name (e.g. 'red')\n" |
116 "or a RGB triple of format '#rrggbb'." |
116 "or a RGB triple of format '#rrggbb'." |
117 ).arg(editValue->text()))); |
117 ).arg(editValue->text())); |
118 } |
118 } |
119 } |
119 } |
120 break; |
120 break; |
121 case QVariant::Font: |
121 case QVariant::Font: |
122 { |
122 { |
123 QFont fnt; |
123 QFont fnt; |
124 if (fnt.fromString(editValue->text())) { |
124 if (fnt.fromString(editValue->text())) { |
125 value = qVariantFromValue(fnt); |
125 value = qVariantFromValue(fnt); |
126 } else { |
126 } else { |
127 QMessageBox::warning(this, tr("Can't parse input"), |
127 QMessageBox::warning(this, tr("Can't parse input"), |
128 (tr("Failed to create a font from %1\n" |
128 tr("Failed to create a font from %1\n" |
129 "The string has to have a format family,<point size> or\n" |
129 "The string has to have a format family,<point size> or\n" |
130 "family,pointsize,stylehint,weight,italic,underline,strikeout,fixedpitch,rawmode." |
130 "family,pointsize,stylehint,weight,italic,underline,strikeout,fixedpitch,rawmode." |
131 ).arg(editValue->text()))); |
131 ).arg(editValue->text())); |
132 } |
132 } |
133 } |
133 } |
134 break; |
134 break; |
135 case QVariant::Pixmap: |
135 case QVariant::Pixmap: |
136 { |
136 { |