211
211
setZValue(((double)1 / (area == 0? 1 : area)) + newZ);
214
void Slope::load(KConfig *cfg)
214
void Slope::load(KConfigGroup *cfgGroup)
216
stuckOnGround = cfg->readEntry("stuckOnGround", stuckOnGround);
217
grade = cfg->readEntry("grade", grade);
218
reversed = cfg->readEntry("reversed", reversed);
216
stuckOnGround = cfgGroup->readEntry("stuckOnGround", stuckOnGround);
217
grade = cfgGroup->readEntry("grade", grade);
218
reversed = cfgGroup->readEntry("reversed", reversed);
220
220
// bypass updatePixmap which newSize normally does
221
QGraphicsRectItem::setRect(rect().x(), rect().y(), cfg->readEntry("width", width()), cfg->readEntry("height", height()));
221
QGraphicsRectItem::setRect(rect().x(), rect().y(), cfgGroup->readEntry("width", width()), cfgGroup->readEntry("height", height()));
222
222
baseWidth = rect().width();
223
223
baseHeight = rect().height();
226
QString gradientType = cfg->readEntry("gradient", "Vertical");
226
QString gradientType = cfgGroup->readEntry("gradient", "Vertical");
227
227
setGradient(gradientType);
230
void Slope::save(KConfig *cfg)
230
void Slope::save(KConfigGroup *cfgGroup)
232
cfg->writeEntry("reversed", reversed);
233
cfg->writeEntry("width", width());
234
cfg->writeEntry("height", height());
235
cfg->writeEntry("gradient", type);;
236
cfg->writeEntry("grade", grade);
237
cfg->writeEntry("stuckOnGround", stuckOnGround);
232
cfgGroup->writeEntry("reversed", reversed);
233
cfgGroup->writeEntry("width", width());
234
cfgGroup->writeEntry("height", height());
235
cfgGroup->writeEntry("gradient", type);;
236
cfgGroup->writeEntry("grade", grade);
237
cfgGroup->writeEntry("stuckOnGround", stuckOnGround);
240
240
void Slope::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/ )