本文整理汇总了C++中DiveTextItem::setBrush方法的典型用法代码示例。如果您正苦于以下问题:C++ DiveTextItem::setBrush方法的具体用法?C++ DiveTextItem::setBrush怎么用?C++ DiveTextItem::setBrush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiveTextItem
的用法示例。
在下文中一共展示了DiveTextItem::setBrush方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: plot_depth_sample
void DiveProfileItem::plot_depth_sample(struct plot_data *entry, QFlags<Qt::AlignmentFlag> flags, const QColor &color)
{
DiveTextItem *item = new DiveTextItem(this);
item->setPos(hAxis->posAtValue(entry->sec), vAxis->posAtValue(entry->depth));
item->setText(get_depth_string(entry->depth, true));
item->setAlignment(flags);
item->setBrush(color);
texts.append(item);
}
示例2: plotGasValue
void DiveGasPressureItem::plotGasValue(int mbar, int sec, QFlags<Qt::AlignmentFlag> flags, struct gasmix gasmix)
{
QString gas = gasToStr(gasmix);
DiveTextItem *text = new DiveTextItem(this);
text->setPos(hAxis->posAtValue(sec), vAxis->posAtValue(mbar));
text->setText(gas);
text->setAlignment(flags);
text->setBrush(getColor(PRESSURE_TEXT));
texts.push_back(text);
}
示例3: createTextItem
void DiveHeartrateItem::createTextItem(int sec, int hr)
{
DiveTextItem *text = new DiveTextItem(this);
text->setAlignment(Qt::AlignRight | Qt::AlignBottom);
text->setBrush(getColor(HR_TEXT));
text->setPos(QPointF(hAxis->posAtValue(sec), vAxis->posAtValue(hr)));
text->setScale(0.7); // need to call this BEFORE setText()
text->setText(QString("%1").arg(hr));
texts.append(text);
}
示例4: plotGasValue
void DiveGasPressureItem::plotGasValue(int mbar, int sec, struct gasmix gasmix, QFlags<Qt::AlignmentFlag> align, double gasname_offset)
{
QString gas = get_gas_string(gasmix);
DiveTextItem *text = new DiveTextItem(this);
text->setPos(hAxis->posAtValue(sec), vAxis->posAtValue(mbar) + gasname_offset );
text->setText(gas);
text->setAlignment(align);
text->setBrush(getColor(PRESSURE_TEXT));
texts.push_back(text);
}
示例5: plotPressureValue
void DiveGasPressureItem::plotPressureValue(int mbar, int sec, QFlags<Qt::AlignmentFlag> flags)
{
const char *unit;
int pressure = get_pressure_units(mbar, &unit);
DiveTextItem *text = new DiveTextItem(this);
text->setPos(hAxis->posAtValue(sec), vAxis->posAtValue(mbar) - 0.5);
text->setText(QString("%1 %2").arg(pressure).arg(unit));
text->setAlignment(flags);
text->setBrush(getColor(PRESSURE_TEXT));
texts.push_back(text);
}
示例6: plot_depth_sample
void DiveProfileItem::plot_depth_sample(struct plot_data *entry, QFlags<Qt::AlignmentFlag> flags, const QColor &color)
{
int decimals;
double d = get_depth_units(entry->depth, &decimals, NULL);
DiveTextItem *item = new DiveTextItem(this);
item->setPos(hAxis->posAtValue(entry->sec), vAxis->posAtValue(entry->depth));
item->setText(QString("%1").arg(d, 0, 'f', 1));
item->setAlignment(flags);
item->setBrush(color);
texts.append(item);
}
示例7: plot_gas_value
void DiveGasPressureItem::plot_gas_value(int mbar, int sec, QFlags<Qt::AlignmentFlag> flags, int o2, int he)
{
QString gas = (is_air(o2, he)) ? tr("air") :
(he == 0) ? QString(tr("EAN%1")).arg((o2 + 5) / 10) :
QString("%1/%2").arg((o2 + 5) / 10).arg((he + 5) / 10);
DiveTextItem *text = new DiveTextItem(this);
text->setPos(hAxis->posAtValue(sec), vAxis->posAtValue(mbar));
text->setText(gas);
text->setAlignment(flags);
text->setBrush(getColor(PRESSURE_TEXT));
texts.push_back(text);
}
示例8: createTextItem
void DiveMeanDepthItem::createTextItem() {
plot_data *entry = dataModel->data().entry;
int sec = entry[dataModel->rowCount()-1].sec;
qDeleteAll(texts);
texts.clear();
DiveTextItem *text = new DiveTextItem(this);
text->setAlignment(Qt::AlignRight | Qt::AlignTop);
text->setBrush(getColor(TEMP_TEXT));
text->setPos(QPointF(hAxis->posAtValue(sec) + 1, vAxis->posAtValue(lastRunningSum)));
text->setScale(0.8); // need to call this BEFORE setText()
text->setText(get_depth_string(lrint(lastRunningSum), true));
texts.append(text);
}
示例9: createTextItem
void DiveMeanDepthItem::createTextItem() {
plot_data *entry = dataModel->data().entry;
int sec = entry[dataModel->rowCount()-1].sec;
qDeleteAll(texts);
texts.clear();
int decimals;
const char *unitText;
double d = get_depth_units(lastRunningSum, &decimals, &unitText);
DiveTextItem *text = new DiveTextItem(this);
text->setAlignment(Qt::AlignRight | Qt::AlignTop);
text->setBrush(getColor(TEMP_TEXT));
text->setPos(QPointF(hAxis->posAtValue(sec) + 1, vAxis->posAtValue(lastRunningSum)));
text->setScale(0.8); // need to call this BEFORE setText()
text->setText(QString("%1%2").arg(d, 0, 'f', 1).arg(unitText));
texts.append(text);
}
示例10: createBar
void TankItem::createBar(qreal x, qreal w, struct gasmix *gas)
{
// pick the right gradient, size, position and text
QGraphicsRectItem *rect = new QGraphicsRectItem(x, 0, w, height, this);
if (gasmix_is_air(gas))
rect->setBrush(air);
else if (gas->he.permille)
rect->setBrush(trimix);
else if (gas->o2.permille == 1000)
rect->setBrush(oxygen);
else
rect->setBrush(nitrox);
rect->setPen(QPen(QBrush(), 0.0)); // get rid of the thick line around the rectangle
rects.push_back(rect);
DiveTextItem *label = new DiveTextItem(rect);
label->setText(gasname(gas));
label->setBrush(Qt::black);
label->setPos(x + 1, 0);
label->setAlignment(Qt::AlignBottom | Qt::AlignRight);
label->setZValue(101);
}