本文整理汇总了C++中DiveTextItem::setScale方法的典型用法代码示例。如果您正苦于以下问题:C++ DiveTextItem::setScale方法的具体用法?C++ DiveTextItem::setScale怎么用?C++ DiveTextItem::setScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DiveTextItem
的用法示例。
在下文中一共展示了DiveTextItem::setScale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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);
}