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

C++ setFormat函数代码示例

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

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



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

示例1: QGLWidget

YabauseGL::YabauseGL( QWidget* p )
  : QGLWidget(p)
{
	setFocusPolicy( Qt::StrongFocus );

  QGLFormat fmt;
  fmt.setProfile(QGLFormat::CompatibilityProfile);
  setFormat(fmt);

	if ( p ) {
		p->setFocusPolicy( Qt::StrongFocus );
		setFocusProxy( p );
	}
  viewport_width_ = 0;
  viewport_height_ = 0;
  viewport_origin_x_ = 0;
  viewport_origin_y_ = 0;
}
开发者ID:devmiyax,项目名称:yabause,代码行数:18,代码来源:YabauseGL.cpp


示例2: m_document

OccView::OccView(Document* document):
    m_document(document),
    m_mode(Selection)
{
    QSurfaceFormat format;
    format.setDepthBufferSize(16);
    format.setStencilBufferSize(1);
    setFormat(format);

    m_view = m_document->viewer()->CreateView();

    m_widget = QWidget::createWindowContainer(this);
    m_map.insert(m_widget, m_document);

    initCursors();
    initViewActions();
    initRenderActions();
}
开发者ID:guervillep,项目名称:Kunie,代码行数:18,代码来源:OccView.cpp


示例3: foreach

void Highlighter::highlightBlock(const QString &text)
{
    QTextCharFormat errorFormat, format;
    errorFormat.setBackground(Qt::red);
    errorFormat.setForeground(Qt::white);
    format.setForeground(Qt::black);

    foreach(const HighlightingRule &rule, highlightingRules)
    {
        QRegExp expression(rule.pattern);
        int index = expression.indexIn(text);
        while(index >= 0)
        {
            int length = expression.matchedLength();
            setFormat(index, length, rule.format);
            index = expression.indexIn(text, index + length);
        }
    }
开发者ID:luyiming,项目名称:MatrixCalculator,代码行数:18,代码来源:Highlighter.cpp


示例4: stopRecording

void Engine::reset()
{
    stopRecording();
    stopPlayback();
    setState(QAudio::AudioInput, QAudio::StoppedState);
    setFormat(QAudioFormat());
    m_generateTone = false;
    delete m_file;
    m_file = 0;
    delete m_analysisFile;
    m_analysisFile = 0;
    m_buffer.clear();
    m_bufferPosition = 0;
    m_bufferLength = 0;
    m_dataLength = 0;
    emit dataLengthChanged(0);
    resetAudioDevices();
}
开发者ID:Andreas665,项目名称:qt,代码行数:18,代码来源:engine.cpp


示例5: highlightBlockUml

        /**
         * @brief UML syntax highlighting.
         * @param text
         */
        void highlightBlockUml(const QString &text) {

            if(highlightRestOfLine(text, REGEX_MLC_ON, format_comment) == true) {
                multiLineComment=true;
            }

            if(highlightRestOfLine(text, REGEX_MLC_OFF, format_comment) == true) {
                multiLineComment=false;
            }

            if(multiLineComment == true) {
                setFormat(0, text.length(), format_comment);
                return;
            }

            //------------------------------------------------------------

            highlightWords(text, REGEX_KEYWORD, format_keyword);
            highlightWords(text, REGEX_KEYWORD2, format_keyword);

            highlightWords(text, REGEX_NOTE1,   format_keyword);
            highlightWord( text, REGEX_NOTE2,   format_keyword);

            highlightWords(text, REGEX_HTML_TAG, format_html);

            highlightWords(text, REGEX_MASK, format_mask );

            highlightWords(text, REGEX_COLOR, format_color );

            highlightWord(text, REGEX_SEPARATOR, format_separator);

            //    highlightWords(text, REGEX_ARROWS1, format_arrow);
            //    highlightWords(text, REGEX_ARROWS2, format_arrow);
            // 	highlightArrorws(text);

            //------------------------------------------------------------

            highlightWord(text, REGEX_SKIN,      format_skin);
            highlightWord(text, REGEX_OPTION,    format_option);

            highlightWord(text, REGEX_DECORATION, format_decoration);

            highlightRestOfLine(text, REGEX_COMMENT, format_comment);
        }
开发者ID:Red54,项目名称:plantumlqeditor,代码行数:48,代码来源:highlighter.cpp


示例6: expression

void SpellHighlighter::highlightBlock(const QString& text)
{
	// Underline 
	QTextCharFormat tcf;
	tcf.setUnderlineColor(QBrush(QColor(255,0,0)));
	tcf.setUnderlineStyle(QTextCharFormat::SpellCheckUnderline);

	// Match words (minimally)
	QRegExp expression("\\b\\w+\\b");

	// Iterate through all words
	int index = text.indexOf(expression);
	while (index >= 0) {
		int length = expression.matchedLength();
		if (!SpellChecker::instance()->isCorrect(expression.cap()))
			setFormat(index, length, tcf);
		index = text.indexOf(expression, index + length);
	}
}
开发者ID:AlekSi,项目名称:Jabbin,代码行数:19,代码来源:spellhighlighter.cpp


示例7: setFormat

void SyntaxHighlighter::highlightBlockInSymbol(ScLexer & lexer)
{
    int originalOffset = lexer.offset();
    int tokenLength;
    Token::Type tokenType = lexer.nextToken(tokenLength);
    int range = lexer.offset() - originalOffset;
    setFormat(originalOffset, range, mGlobals->format(SymbolFormat));

    if (tokenType == Token::Unknown)
        return;

    Q_ASSERT(tokenType == Token::SymbolMark);
    Token token(tokenType, lexer.offset() - 1, 1);
    token.character = '\'';

    TextBlockData *blockData = static_cast<TextBlockData*>(currentBlockUserData());
    Q_ASSERT(blockData);
    blockData->tokens.push_back( token );
}
开发者ID:8c6794b6,项目名称:supercollider,代码行数:19,代码来源:highlighter.cpp


示例8: elements

/*!
	\overload
	\param elem Source element to scan
	\param ignoreNewIds whether unknown format identifiers should be ignored
	
	The given dom element must contain a proper version attribute and format
	data as child elements (&lt;format&gt; tags)
	
	\note Previous content is not discarded
*/
void QFormatScheme::load(const QDomElement& elem, bool ignoreNewIds)
{
	if (!elem.hasAttributes() && !elem.hasChildNodes()) return;

	if ( elem.attribute("version") < QFORMAT_VERSION )
	{
		qWarning("Format encoding version mismatch : [found]%s != [expected]%s",
				qPrintable(elem.attribute("version")),
				QFORMAT_VERSION);
		
		return;
	}
	
	QDomElement e, c;
	QDomNodeList l, f = elem.elementsByTagName("format");
	
	for ( int i = 0; i < f.count(); i++ )
	{
		e = f.at(i).toElement();
		
		if ( ignoreNewIds && !m_formatKeys.contains(e.attribute("id")) )
			continue;
		
		l = e.childNodes();
		
		QFormat fmt;
		
		for ( int i = 0; i < l.count(); i++ )
		{
			c = l.at(i).toElement();
			
			if ( c.isNull() )
				continue;
			
			QString field = c.tagName(),
					value = c.firstChild().toText().data();
			setFormatOption(fmt,field,value);
		}
		fmt.setPriority(fmt.priority); //update priority if other values changed

		setFormat(e.attribute("id"), fmt);
	}
}
开发者ID:Axure,项目名称:TeXstudio,代码行数:53,代码来源:qformatscheme.cpp


示例9: QWindow

Window::Window(QScreen *screen)
    : QWindow(screen)

{
    setSurfaceType(QSurface::OpenGLSurface);

    resize(1024, 768);

    QSurfaceFormat format;
    if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL)
    {
        //format.setVersion(4,3);
        format.setProfile(QSurfaceFormat::CoreProfile);
    }
    format.setDepthBufferSize( 24 );
    format.setSamples( 4 );
    setFormat(format);
    create();
}
开发者ID:privet56,项目名称:BunnyAndQloud,代码行数:19,代码来源:window.cpp


示例10: QGLWidget

LedsSimulator::LedsSimulator(QWidget *parent /*= 0*/, int cubeX, int cubeY, int cubeZ, int spacing /*= 1*/)
    : QGLWidget(parent),  m_spacing(spacing), m_monoChromeLeds(false)
{
    setFormat(QGLFormat(QGL::DoubleBuffer | QGL::DepthBuffer));

    rotationX = 0.0;
    rotationY = 0.0;
    rotationZ = 0.0;

    m_cubeMatrix[0] = cubeX;
    m_cubeMatrix[1] = cubeY;
    m_cubeMatrix[2] = cubeZ;

    m_spacing+=2;
    m_backColor = Qt::darkGray;
    m_offColor = QColor(220,220,220,40);
   setCubeValues();

}
开发者ID:Bntdumas,项目名称:LED-matrixes-controller-programmer,代码行数:19,代码来源:LedsSimulator.cpp


示例11: setOptions

static  void    setOptions(HWND hwndDlg)
{
    UCHAR   title[256] ;

    sprintf(title, "Session Options for <%s>", SessServerName) ;
    WinSetWindowText(hwndDlg, title) ;

    setFormat(hwndDlg) ;
    setEncode(hwndDlg) ;

    setButton(hwndDlg, IDD_OPT_SHARED, SessOptShared)    ;
    setButton(hwndDlg, IDD_OPT_VONLY,  SessOptViewonly)  ;
    setButton(hwndDlg, IDD_OPT_DEICON, SessOptDeiconify) ;

    if (! initialSetup) {
        WinEnableWindow(WinWindowFromID(hwndDlg, IDD_OPT_FORMAT), FALSE) ;
        WinEnableWindow(WinWindowFromID(hwndDlg, IDD_OPT_SHARED), FALSE) ;
    }
}
开发者ID:OS2World,项目名称:APP-INTERNET-PMVNC-Client,代码行数:19,代码来源:sess.c


示例12: QGLWidget

VCanvas::VCanvas(QWidget *parent)
	: QGLWidget(parent)
{
	setFormat(QGLFormat(QGL::DoubleBuffer | QGL::DepthBuffer));

	rotationX = 30.0; defaultRotationX = 30.0;
	rotationY = 45.0; defaultRotationY = 45.0;
	rotationZ = 0.0; defaultRotationZ = 0.0;
	scaling = 1;
	defaultScaling = 1;

	drawingData = 0;

	translX = 0.0; translY = 0.0; translZ = 0.0;

	areParticlesNumbersVisible = true;
	areAxesVisible = true;

}
开发者ID:GhostVIRUS,项目名称:VV3D,代码行数:19,代码来源:VCanvas.cpp


示例13: qMax

void DiskSpaceBar::refresh()
{
	if (!isVisible())
		return;

	uint total, free;
	if (!getDiskSpace(m_path, total, free))
		return;

	uint usedmb = total-free;
	m_diskSpace = qMax(m_diskSpace, usedmb);
	qreal gbyte = usedmb/1024.0;
	uint percnt = usedmb*100/total;
	QString gbt = PLCHD.arg(gbyte,7,FMT_F,2,FILLSPC);
	QString pct = QString::number(percnt).rightJustified(3,FILLSPC);

	setValue(usedmb);
	setFormat(qtBuilderDiskSpaceTmpl.arg(m_name, gbt, pct));
}
开发者ID:t3t3,项目名称:QtBuilder,代码行数:19,代码来源:guiprogress.cpp


示例14: setFormat

	void OgreTexture::createManual(int _width, int _height, TextureUsage _usage, PixelFormat _format)
	{
		setFormat(_format);
		setUsage(_usage);

		mTexture = Ogre::TextureManager::getSingleton().createManual(
			mName,
			mGroup,
			Ogre::TEX_TYPE_2D,
			_width,
			_height,
			0,
			mPixelFormat,
			mUsage,
			this);

		mTexture->load();

	}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:19,代码来源:MyGUI_OgreTexture.cpp


示例15: size_t

bool StImagePlane::initSideBySide(const StImagePlane& theImageL,
                                  const StImagePlane& theImageR,
                                  const int theSeparationDx,
                                  const int theSeparationDy,
                                  const int theValue) {
    if(theImageL.isNull() || theImageR.isNull()) {
        // just ignore
        return true;
    }
    if(theImageL.getSizeX() != theImageR.getSizeX() ||
       theImageL.getSizeY() != theImageR.getSizeY()) {
        // currently unsupported operation
        return false;
    }
    size_t dxAbsPx = size_t(abs(theSeparationDx));
    size_t dxLeftRPx  = (theSeparationDx > 0) ?     dxAbsPx : 0;
    size_t dxLeftLPx  = (theSeparationDx < 0) ? 2 * dxAbsPx : 0;

    size_t dyAbsPx = size_t(abs(theSeparationDy));
    size_t dyTopLPx  = (theSeparationDy > 0) ? dyAbsPx : 0;
    size_t dyTopRPx  = (theSeparationDy < 0) ? dyAbsPx : 0;

    size_t outSizeX = (theImageL.getSizeX() + dxAbsPx) * 2;
    size_t outSizeY =  theImageL.getSizeY() + dyAbsPx  * 2;

    setFormat(theImageL.getFormat());
    if(!initZero(theImageL.getFormat(), outSizeX, outSizeY, outSizeX * theImageL.getSizePixelBytes(), theValue)) {
        return false;
    }

    // save cross-eyed
    for(size_t row = 0; row < theImageR.getSizeY(); ++row) {
        stMemCpy(changeData(dyTopRPx + row, dxLeftRPx),
                 theImageR.getData(row, 0),
                 theImageR.getSizeRowBytes());
    }
    for(size_t row = 0; row < theImageR.getSizeY(); ++row) {
        stMemCpy(changeData(dyTopLPx + row, theImageR.getSizeX() + dxLeftLPx + dxLeftRPx),
                 theImageL.getData(row, 0),
                 theImageL.getSizeRowBytes());
    }
    return true;
}
开发者ID:KindDragon,项目名称:sview,代码行数:43,代码来源:StImagePlane.cpp


示例16: QTestWindow

    QTestWindow() {
        setSurfaceType(QSurface::OpenGLSurface);

        QSurfaceFormat format;
        // Qt Quick may need a depth and stencil buffer. Always make sure these are available.
        format.setDepthBufferSize(16);
        format.setStencilBufferSize(8);
        format.setVersion(4, 3);
        format.setProfile(QSurfaceFormat::OpenGLContextProfile::CoreProfile);
        format.setOption(QSurfaceFormat::DebugContext);
        format.setSwapInterval(0);

        setFormat(format);

        _qGlContext.setFormat(format);
        _qGlContext.create();

        show();
        makeCurrent();
        setupDebugLogger(this);

        gpu::Context::init<gpu::GLBackend>();
        _context = std::make_shared<gpu::Context>();
        
        auto shader = makeShader(unlit_vert, unlit_frag, gpu::Shader::BindingSet{});
        auto state = std::make_shared<gpu::State>();
        state->setMultisampleEnable(true);
        state->setDepthTest(gpu::State::DepthTest { true });
        _pipeline = gpu::Pipeline::create(shader, state);
        
        // Clear screen
        gpu::Batch batch;
        batch.clearColorFramebuffer(gpu::Framebuffer::BUFFER_COLORS, { 1.0, 0.0, 0.5, 1.0 });
        _context->render(batch);
        
        DependencyManager::set<GeometryCache>();
        DependencyManager::set<DeferredLightingEffect>();

        resize(QSize(800, 600));
        
        _time.start();
    }
开发者ID:JamesLinus,项目名称:hifi,代码行数:42,代码来源:main.cpp


示例17: Java_com_sun_media_protocol_sunvideo_XILCapture_xilSetCompress

/*
 * Class:	com_sun_media_protocol_sunvideo_XILCapture
 * Method:	xilSetCompress
 * Signature:	(Ljava/lang/String;)Z
 */
JNIEXPORT jboolean JNICALL
Java_com_sun_media_protocol_sunvideo_XILCapture_xilSetCompress(JNIEnv *env,
						      jobject jxil,
						      jstring jcompress)
{
    const char *compress;

    InstanceState *inst = (InstanceState *) GetLongField(env, jxil, "peer");

    if (inst == NULL)
	return;

    /*    Debug Message*/
    PRINT("In xilSetCompress\n");

    compress = (*env)->GetStringUTFChars(env, jcompress, 0);

    if (strcasecmp(compress, "rgb") == 0) {
	inst->do_cis = RAW;
	inst->cis_type = "Raw";
    } else if (strcasecmp(compress, "jpeg") == 0) {
	inst->do_cis = JPEG;
	inst->cis_type = "Jpeg";
    } else if ((strcasecmp(compress, "mpeg") == 0) ||
		(strcasecmp(compress, "mpeg1") == 0)) {
	inst->do_cis = MPEG;
	inst->cis_type = "Mpeg1";
    } else if (strcasecmp(compress, "cellb") == 0) {
	inst->do_cis = CELLB;
	inst->cis_type = "CellB";
    } else {
	/*    Debug Message */
	PRINT("Invalid compress format specified %s ");
	PRINT(compress);
	PRINT("\n");
    }
    (*env)->ReleaseStringUTFChars(env, jcompress, compress);

    setFormat(env, jxil, inst);

    return TRUE;
}
开发者ID:TheCrazyT,项目名称:jmf,代码行数:47,代码来源:XILCapture.c


示例18: while

void Highlighter::highlightStrings(int startStringIndex, QString & text) {
	if (startStringIndex < 0) {
		startStringIndex = m_syntaxer->matchStringStart(text, 0);
	}

	// TODO: not handling "" as a way to escape-quote
	while (startStringIndex >= 0) {
		int endIndex = -1;
		int ssi = startStringIndex;
		while (true) {
			endIndex = m_syntaxer->matchStringEnd(text, ssi + 1);
			if (!m_syntaxer->hlCStringChar()) {
				// only some languages use \ to escape 
				break;
			}

			if (endIndex == -1) {
				break;
			}

			// TODO: escape char is backslash only; are there others in other compilers?
			if (text.at(endIndex - 1) != CEscapeChar) {
				break;
			}
			ssi = endIndex;
		}
		int stringLength;
		if (endIndex == -1) {
			setCurrentBlockState(STRINGOFFSET);
			stringLength = text.length() - startStringIndex;
		} 
		else {
			stringLength = endIndex - startStringIndex + 1;
		}
		text.replace(startStringIndex, stringLength, QString(stringLength, ' '));
		QTextCharFormat * sf = m_styleFormats.value("String", NULL);
		if (sf != NULL) {
			setFormat(startStringIndex, stringLength, *sf);
		}
		startStringIndex = m_syntaxer->matchStringStart(text, startStringIndex + stringLength);
	}
}
开发者ID:honsey,项目名称:fztaxedit,代码行数:42,代码来源:highlighter.cpp


示例19: QWindow

OpenGLWindow::OpenGLWindow( QWindow *parent )
    : QWindow( parent ), d( new Private(this) )
{
    setSurfaceType( QWindow::OpenGLSurface );

    QSurfaceFormat format;
    //format.setDepthBufferSize( 24 );
    //format.setSamples( 4 );
    //format.setMajorVersion( 3 );
    //format.setMinorVersion( 3 );
    format.setSwapBehavior( QSurfaceFormat::DoubleBuffer );
    format.setRenderableType( QSurfaceFormat::OpenGL );
    format.setProfile( QSurfaceFormat::CompatibilityProfile );
    setFormat( format );
    create();

    d->thread = OpenGLRenderThread::instance();
    d->renderId = d->thread->registerSurface( this );
    d->thread->update( d->renderId );
}
开发者ID:hasbromlp,项目名称:ocs,代码行数:20,代码来源:openglwindow.cpp


示例20: getline

void ressource_num::load(std::istream &file)
{
    string tampon;
    ressource::load(file);
    cout << "Quel est le format de cette ressource?" << endl;
    do{
    getline( file, tampon);
    }while(tampon.size()==0);
    setFormat(tampon);
    cout << "Quelle est la taille de cette ressource? (En octets)" << endl;
    do{
    getline( file, tampon);
    }while(tampon.size()==0);
    setTaille(atoi(tampon.c_str()));
    cout << "Quem est l'URL de cette ressource?" << endl;
    do{
    getline( file, tampon);
    }while(tampon.size()==0);
    setURL(tampon);
}
开发者ID:kmaincent,项目名称:C-_project,代码行数:20,代码来源:ressource_num.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setFrame函数代码示例发布时间:2022-05-30
下一篇:
C++ setFormControlValueMatchesRenderer函数代码示例发布时间: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