本文整理汇总了C++中BasicBox::update方法的典型用法代码示例。如果您正苦于以下问题:C++ BasicBox::update方法的具体用法?C++ BasicBox::update怎么用?C++ BasicBox::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasicBox
的用法示例。
在下文中一共展示了BasicBox::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: boundingRect
void
TriggerPoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option);
Q_UNUSED(widget);
QRectF rect = boundingRect();
painter->save();
BasicBox *box = NULL;
if (_abstract->boxID() != NO_ID) {
if ((box = _scene->getBox(_abstract->boxID())) != NULL) {
QPen pen = painter->pen();
QBrush brush = painter->brush();
pen.setColor(box->color().darker());
pen.setWidth(isSelected() ? 1.5 * BasicBox::LINE_WIDTH : BasicBox::LINE_WIDTH / 2);
painter->setPen(pen);
if (_scene->playing()) {
if (!isWaiting()) {
drawFlag(painter, QColor("red"));
}
else {
if(!_scene->triggersQueueList()->isEmpty())
if (_scene->triggersQueueList()->first() == this) {
drawFlag(painter, QColor("green"));
this->setFocus();
}
else {
// brush.setColor(QColor("orange"));
// painter->setBrush(brush);
drawFlag(painter, QColor("orange"));
}
}
if (_abstract->waiting()) {
BasicBox *box = _scene->getBox(_abstract->boxID());
box->update();
switch (_abstract->boxExtremity()) {
case BOX_START:
painter->drawText(rect.topRight() + QPointF(0, rect.height() / 2), QString::fromStdString(_abstract->message()));
break;
case BOX_END:
painter->drawText(rect.topLeft() + QPointF(-QString::fromStdString(_abstract->message()).length() * 7, rect.height() / 2), QString::fromStdString(_abstract->message()));
break;
default:
break;
}
}
}
else {
drawFlag(painter, QColor(Qt::darkGray));
}
}
}
painter->restore();
}
示例2: update
void
AttributesEditor::updateWidgets(bool boxModified)
{
Q_UNUSED(boxModified);
BasicBox * box = _scene->getBox(_boxEdited);
if (box != NULL) {
box->update();
box->centerWidget();
_boxStartValue->setValue(box->beginPos() * MaquetteScene::MS_PER_PIXEL / S_TO_MS);
_boxLengthValue->setValue(box->width() * MaquetteScene::MS_PER_PIXEL / S_TO_MS);
_boxName->setText(box->name());
_colorButtonPixmap->fill(box->currentColor());
_generalColorButton->setIcon(QIcon(*_colorButtonPixmap));
}
update();
}