void DArrowRectangle::setContent(QWidget *content) { if (!content) return; m_content = content; m_content->setParent(this); m_content->show(); qreal delta = shadowBlurRadius() + shadowDistance() + margin(); resizeWithContent(); switch(m_arrowDirection) { case ArrowLeft: m_content->move(m_arrowHeight + delta, delta); break; case ArrowRight: m_content->move(delta, delta); break; case ArrowTop: m_content->move(delta, delta + m_arrowHeight); break; case ArrowBottom: m_content->move(delta, delta); break; } update(); }
void ErrorTip::setText(QString text) { m_label->setText(text); m_label->setAccessibleDescription(text); m_label->adjustSize(); resizeWithContent(); }
void DArrowRectangle::show(int x, int y) { m_lastPos = QPoint(x, y); move(x, y);//Overload function if (isHidden()) QWidget::show(); resizeWithContent(); update(); }