当前位置: 首页>>代码示例>>C++>>正文


C++ DiveTextItem::setBrush方法代码示例

本文整理汇总了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);
}
开发者ID:torvalds,项目名称:subsurface,代码行数:9,代码来源:diveprofileitem.cpp

示例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);
}
开发者ID:codesong,项目名称:subsurface,代码行数:10,代码来源:diveprofileitem.cpp

示例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);
}
开发者ID:codesong,项目名称:subsurface,代码行数:10,代码来源:diveprofileitem.cpp

示例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);
}
开发者ID:ngot,项目名称:subsurface,代码行数:10,代码来源:diveprofileitem.cpp

示例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);
}
开发者ID:codesong,项目名称:subsurface,代码行数:11,代码来源:diveprofileitem.cpp

示例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);
}
开发者ID:codesong,项目名称:subsurface,代码行数:11,代码来源:diveprofileitem.cpp

示例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);
}
开发者ID:danilocesar,项目名称:subsurface,代码行数:12,代码来源:diveprofileitem.cpp

示例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);
}
开发者ID:torvalds,项目名称:subsurface,代码行数:13,代码来源:diveprofileitem.cpp

示例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);
}
开发者ID:ngot,项目名称:subsurface,代码行数:16,代码来源:diveprofileitem.cpp

示例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);
}
开发者ID:AddictXQ,项目名称:subsurface,代码行数:21,代码来源:tankitem.cpp


注:本文中的DiveTextItem::setBrush方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。