void TexWidget::clone(TexWidget* t) { d_frame = t->frameStyle(); setFramePen(t->framePen()); d_formula = t->formula(); d_pix = t->pixmap(); setSize(t->size()); setOriginCoord(t->xValue(), t->yValue()); }
void LegendWidget::clone(LegendWidget* t) { d_frame = t->frameStyle(); d_angle = t->angle(); setFramePen(t->framePen()); d_auto_update = t->isAutoUpdateEnabled(); setTextColor(t->textColor()); setBackgroundColor(t->backgroundColor()); setFont(t->font()); setText(t->text()); setOriginCoord(t->xValue(), t->yValue()); }
void LegendWidget::paintEvent(QPaintEvent *e) { if (d_fixed_coordinates){ setOriginCoord(d_x, d_y); d_fixed_coordinates = false; } const int symbolLineLength = line_length + symbolsMaxWidth(); int width, height; QwtArray<int> heights = itemsHeight(0, symbolLineLength, width, height); if (d_frame == Shadow) resize(width + 5, height + 5); else resize(width, height); QRect rect = QRect(0, 0, width - 1, height - 1); QPainter p(this); drawFrame(&p, rect); drawText(&p, rect, heights, symbolLineLength); e->accept(); }