• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ setFontSize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setFontSize函数的典型用法代码示例。如果您正苦于以下问题:C++ setFontSize函数的具体用法?C++ setFontSize怎么用?C++ setFontSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setFontSize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: LLLineBuffer

LLConsole::LLConsole(const std::string& name, const LLRect &rect, 
					 S32 font_size_index, F32 persist_time ) 
  : LLLineBuffer(),
	LLView(name, rect, FALSE),
	mLinePersistTime(persist_time),
	mFadeTime(persist_time - FADE_DURATION),
	mFont(LLFontGL::getFontSansSerif()),
	mConsoleWidth(0),
	mConsoleHeight(0)
{
	mTimer.reset();

	setFontSize( font_size_index );
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:14,代码来源:llconsole.cpp


示例2: setWidth

// Constructor
Counter::Counter(int newWidth, int newHeight, int newX, int newY, int newFontSize, string newMessage, int newCountValue)
{
	setWidth(newWidth);
	setHeight(newHeight);
	setX(newX);
	setY(newY);
	
	setFontSize(newFontSize);
	setMessage(newMessage);

	renderBox();

	setCountValue(newCountValue);
}
开发者ID:nvahrenb,项目名称:CSE20212_final_project,代码行数:15,代码来源:counter.cpp


示例3: setFontName

void Text::copySpecialProperties(Widget *widget)
{
    Text* label = dynamic_cast<Text*>(widget);
    if (label)
    {
        setFontName(label->_fontName);
        setFontSize(label->getFontSize());
        setString(label->getString());
        setTouchScaleChangeEnabled(label->_touchScaleChangeEnabled);
        setTextHorizontalAlignment(label->_labelRenderer->getHorizontalAlignment());
        setTextVerticalAlignment(label->_labelRenderer->getVerticalAlignment());
        setTextAreaSize(label->_labelRenderer->getDimensions());
    }
}
开发者ID:ElvisQin,项目名称:genius-x,代码行数:14,代码来源:UIText.cpp


示例4: setFontSize

void RichTextLabel::setTextProps(TextField* t)
{
    if (t) {
        setFontSize(t->getFontSize());
        setFont(t->getFont());
        colorGrp.setColor(QPalette::Text, t->getColor());

        QTextCharFormat format;
        format.setForeground(QBrush(colorGrp.color(QPalette::Text)));
        QTextCursor cursor(text);
        cursor.select(QTextCursor::Document);
        cursor.mergeCharFormat(format);
    }
}
开发者ID:KDE,项目名称:superkaramba,代码行数:14,代码来源:richtextlabel.cpp


示例5: LLFixedBuffer

LLConsole::LLConsole(const std::string& name, const U32 max_lines, const LLRect &rect, 
					 S32 font_size_index, F32 persist_time ) 
	: 
	LLFixedBuffer(max_lines),
	LLView(name, rect, FALSE),
	mLastBoxHeight(0),
	mLastBoxWidth(0)
{
	mLinePersistTime = persist_time;		// seconds
	mFadeTime = persist_time - FADE_DURATION;

	setFontSize( font_size_index );
	setMaxLines(gSavedSettings.getS32("ConsoleMaxLines"));
}
开发者ID:xinyaojiejie,项目名称:Dale,代码行数:14,代码来源:llconsole.cpp


示例6: fontSize

LabelWidget::LabelWidget
			(
				const string &label,
				const vec2 &pos
			)
: fontSize(FONT_SIZE_NORMAL),
  font(0)
{
	setFont(g_Application.fontLarge);
	setFontSize(FONT_SIZE_NORMAL);
	setLabel(label);
	setColor(white);
	setRelativePos(pos);
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:14,代码来源:labelwidget.cpp


示例7: LLUICtrl

LLConsole::LLConsole(const LLConsole::Params& p) 
:	LLUICtrl(p),
	LLFixedBuffer(p.max_lines),
	mLinePersistTime(p.persist_time), // seconds
	mFont(p.font),
	mConsoleWidth(0),
	mConsoleHeight(0)
{
	if (p.font_size_index.isProvided())
	{
		setFontSize(p.font_size_index);
	}
	mFadeTime = mLinePersistTime - FADE_DURATION;
	setMaxLines(LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines"));
}
开发者ID:Xara,项目名称:Astra-Viewer-2,代码行数:15,代码来源:llconsole.cpp


示例8: _callback

MenuButton::MenuButton(const char* label, std::tr1::function<void ()> callback) : 
	osgWidget::Label("", ""), 
	_callback(callback)
{	
	// styling
	setFont("fonts/times.ttf");
	setFontSize(MENU_BUTTON_FONT_SIZE);
    setFontColor(MENU_BUTTON_FONT_COLOR);
    setLabel(label);
	setPadding(MENU_BUTTON_PADDING);
	setAlignHorizontal(osgWidget::Widget::HA_LEFT);
    
	// activate event handling for mouse clicks and moves
	setEventMask(osgWidget::EVENT_MOUSE_PUSH | osgWidget::EVENT_MASK_MOUSE_MOVE);
}
开发者ID:brownman,项目名称:Starjumper,代码行数:15,代码来源:MenuButton.cpp


示例9: open

    //////////////////////////////////////////////////////////////////////////////////////////
    // RtfWriter::open
    //! Initialises the writer
    //!
    //! \param[in] const* font - Font name
    //! \param[in] size - Font size in points
    //! \param[in] const& cols - List of colours
    //!
    //! \throw wtl::logic_error - [Debug only] Writer is already open
    //! \throw wtl::domain_error - I/O error occurred
    //////////////////////////////////////////////////////////////////////////////////////////
    void  open(const char* font, UINT size, const std::list<COLORREF>& cols)
    {
      // Check stream is closed
      if (!Closed)
        throw wtl::logic_error(HERE, "Writer is already open");
      Closed = false;

      // Copy colours
      for (COLORREF c : cols)
        Colours.push_back(c);

      // Write header
      writeHeader(font);
      setFontSize(size);
    }
开发者ID:nick-crowley,项目名称:Win32-Template-Library,代码行数:26,代码来源:RichTextWriter.hpp


示例10: setFlagEnableAtStartup

void PointerCoordinates::loadConfiguration(void)
{
	conf->beginGroup("PointerCoordinates");

	setFlagEnableAtStartup(conf->value("enable_at_startup", false).toBool());
	textColor = StelUtils::strToVec3f(conf->value("text_color", "1,0.5,0").toString());
	setFontSize(conf->value("font_size", 14).toInt());
	flagShowCoordinatesButton = conf->value("flag_show_button", true).toBool();
	setCurrentCoordinatesPlaceKey(conf->value("current_displaying_place", "TopRight").toString());
	setCurrentCoordinateSystemKey(conf->value("current_coordinate_system", "RaDecJ2000").toString());
	QStringList cc = conf->value("custom_coordinates", "1,1").toString().split(",");
	setCustomCoordinatesPlace(cc[0].toInt(), cc[1].toInt());

	conf->endGroup();
}
开发者ID:PhiTheta,项目名称:stellarium,代码行数:15,代码来源:PointerCoordinates.cpp


示例11: ColorLabel

    ColorLabel(const char* label):
        osgWidget::Label(label, "") {
        setFont("fonts/VeraMono.ttf");
        setFontSize(14);
        setFontColor(1.0f, 1.0f, 1.0f, 1.0f);

        setColor(0.3f, 0.3f, 0.3f, 1.0f);
        setPadding(2.0f);
        setCanFill(true);

        addSize(150.0f, 25.0f);

        setLabel(label);
        setEventMask(osgWidget::EVENT_MOUSE_PUSH | osgWidget::EVENT_MASK_MOUSE_MOVE);
    }
开发者ID:151706061,项目名称:OpenSceneGraph,代码行数:15,代码来源:osganimationeasemotion.cpp


示例12: clearScreen

void CTFTSerial::setLockoutInt()
{
	// Clear the screen
	clearScreen();

	setFontSize(FONT_LARGE);

	// Draw MMDVM logo
	displayBitmap(0U, 0U, "MMDVM_sm.bmp");

	gotoPosPixel(20U, 60U);
	displayText("LOCKOUT");

	m_mode = MODE_LOCKOUT;
}
开发者ID:Boromatic,项目名称:MMDVMHost,代码行数:15,代码来源:TFTSerial.cpp


示例13: OverlayWidget

InfoOverlay::InfoOverlay(QWidget *parent)
    : OverlayWidget(parent),
      fm(NULL)
{
    setPalette(Qt::transparent);
    setAttribute(Qt::WA_TransparentForMouseEvents);
    textMarginX = 8;
    textMarginY = 4;
    textColor.setRgb(255, 255, 255, 255);
    textShadowColor.setRgb(0, 0, 0, 200);
    bgColor.setRgb(0, 0, 0, 90);
    setFontSize(11);
    setText("No file opened.");
    hide();
}
开发者ID:sevoan,项目名称:qimgv,代码行数:15,代码来源:infooverlay.cpp


示例14: setFontSize

void TextOverlay::setProperties(const QScriptValue& properties) {
    Overlay2D::setProperties(properties);
    _qmlElement->setX(_bounds.left());
    _qmlElement->setY(_bounds.top());
    _qmlElement->setWidth(_bounds.width());
    _qmlElement->setHeight(_bounds.height());
    _qmlElement->settextColor(toQmlColor(vec4(toGlm(_color), _alpha)));
    QScriptValue font = properties.property("font");
    if (font.isObject()) {
        if (font.property("size").isValid()) {
            setFontSize(font.property("size").toInt32());
        }
        QFont font(_qmlElement->fontFamily());
        font.setPixelSize(_qmlElement->fontSize());
        QFontMetrics fm(font);
        _qmlElement->setlineHeight(fm.lineSpacing() * 1.2);
    }

    QScriptValue text = properties.property("text");
    if (text.isValid()) {
        setText(text.toVariant().toString());
    }

    QScriptValue backgroundColor = properties.property("backgroundColor");
    if (backgroundColor.isValid()) {
        QScriptValue red = backgroundColor.property("red");
        QScriptValue green = backgroundColor.property("green");
        QScriptValue blue = backgroundColor.property("blue");
        if (red.isValid() && green.isValid() && blue.isValid()) {
            _backgroundColor.red = red.toVariant().toInt();
            _backgroundColor.green = green.toVariant().toInt();
            _backgroundColor.blue = blue.toVariant().toInt();
        }
    }

    if (properties.property("backgroundAlpha").isValid()) {
        _backgroundAlpha = properties.property("backgroundAlpha").toVariant().toFloat();
    }
    _qmlElement->setbackgroundColor(toQmlColor(vec4(toGlm(_backgroundColor), _backgroundAlpha)));

    if (properties.property("leftMargin").isValid()) {
        setLeftMargin(properties.property("leftMargin").toVariant().toInt());
    }

    if (properties.property("topMargin").isValid()) {
        setTopMargin(properties.property("topMargin").toVariant().toInt());
    }
}
开发者ID:bwent,项目名称:hifi,代码行数:48,代码来源:TextOverlay.cpp


示例15: setFontSize

void TextLabel::setTextProps(TextField *field)
{
    if (field) {
        text = *field;
        //lineHeight = t->getLineHeight();
        shadow = field->getShadow();
        alignment = field->getAlignment();
        setFontSize(field->getFontSize());
        setFont(field->getFont());

        setColor(field->getColor());
        setBGColor(field->getBGColor());
    }

    calculateTextSize();
}
开发者ID:KDE,项目名称:superkaramba,代码行数:16,代码来源:textlabel.cpp


示例16: switch

int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setFontSize((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: setMonth((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: setYear((*reinterpret_cast< QDate(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 3;
    }
    return _id;
}
开发者ID:MarkLevin,项目名称:MarkLevin,代码行数:16,代码来源:moc_mainwindow.cpp


示例17: m_vtkAxisLength

GraphicalAxes3D::GraphicalAxes3D(vtkRendererPtr renderer) : m_vtkAxisLength(100)
{
    mViewportListener.reset(new ViewportListener);
    mViewportListener->setCallback(boost::bind(&GraphicalAxes3D::rescale, this));

    mActor = vtkAxesActorPtr::New();
	mActor->SetAxisLabels(false);
	mActor->SetTotalLength( m_vtkAxisLength, m_vtkAxisLength, m_vtkAxisLength );

    this->setAxisLength(0.2);

    this->setShowAxesLabels(true);
    setTransform(Transform3D::Identity());
    setFontSize(0.04);

    this->setRenderer(renderer);
}
开发者ID:c0ns0le,项目名称:CustusX,代码行数:17,代码来源:cxGraphicalAxes3D.cpp


示例18: setFontSize

Input::Input(tank::Vectorf pos,
             tank::Vectoru size,
             std::string label,
             std::function<void()> callback)
    : tank::Entity(pos)
    , callback_ {callback}
{
    box_ = makeGraphic<tank::RectangleShape>(size);
    text_ = makeGraphic<tank::Text>(StartWorld::font);
    label_ = makeGraphic<tank::Text>(StartWorld::titleFont);

    text_->setColor({});
    text_->setOrigin({-5, 2});
    box_->setOutlineColor({200,200,200});
    setFontSize(size.y - 2);
    setLabel(label);
}
开发者ID:qualiaa,项目名称:dango,代码行数:17,代码来源:Input.cpp


示例19: assert

void CTFTSerial::writeDMRInt(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type)
{
	assert(type != NULL);

	if (m_mode != MODE_DMR) {
		// Clear the screen
		clearScreen();

		setFontSize(FONT_MEDIUM);

		// Draw DMR insignia
		displayBitmap(0U, 0U, "DMR_sm.bmp");

		if (slotNo == 1U) {
			gotoPosPixel(5U, 90U);
			displayText("2 Listening");
		} else {
			gotoPosPixel(5U, 55U);
			displayText("1 Listening");
		}
	}

	if (slotNo == 1U) {
		char text[30U];

		::sprintf(text, "1 %s %s", type, src.c_str());
		gotoPosPixel(5U, 55U);
		displayText(text);

		::sprintf(text, "%s%s", group ? "TG" : "", dst.c_str());
		gotoPosPixel(65U, 72U);
		displayText(text);
	} else {
		char text[30U];

		::sprintf(text, "2 %s %s", type, src.c_str());
		gotoPosPixel(5U, 90U);
		displayText(text);

		::sprintf(text, "%s%s", group ? "TG" : "", dst.c_str());
		gotoPosPixel(65U, 107U);
		displayText(text);
	}

	m_mode = MODE_DMR;
}
开发者ID:Boromatic,项目名称:MMDVMHost,代码行数:46,代码来源:TFTSerial.cpp


示例20: getInnerSize

void Button::drawInternal(QPainter* p) {
    if (!pixmap.isNull()) {
        int centerX = (getInnerSize().width() - pixmap.width()) / 2;
        int centerY = (getInnerSize().height() - pixmap.height()) / 2;

        p->drawPixmap(centerX, centerY, pixmap, 0, 0, getInnerSize().width() - centerX,
                      getInnerSize().height() - centerY);
    }


    p->save();
    setFontSize(p);

    drawText(p, label, QPoint(0, 0), TEXTCOLOR_DEFAULT, Qt::AlignCenter);

    p->restore();
}
开发者ID:Blahord,项目名称:jippysnake8,代码行数:17,代码来源:button.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setFormControlValueMatchesRenderer函数代码示例发布时间:2022-05-30
下一篇:
C++ setFocusable函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap