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

C++ setContext函数代码示例

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

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



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

示例1: pt

void Selection3DDisplayCustom::queryContext( int x, int y )
{
    float win_width = render_panel_->width();
    float win_height = render_panel_->height();

    //then send a raycast straight out from the camera at the mouse's position
    Ogre::Ray mouseRay = this->render_panel_->getCamera()->getCameraToViewportRay((float)x/win_width, (float)y/win_height);

    Ogre::Vector3 position;

    Ogre::Vector3 pt(0,0,0);
    Ogre::Quaternion ot(1,0,0,0);
    transform(pt,ot,"/world",fixed_frame_.toUtf8().constData());
    int type = -1;
    std::string name;
    if(raycast_utils_->RayCastFromPoint(mouseRay,pt,ot,position,type,name))
    {
        //ROS_ERROR("COLLIDED WITH %s %d",name.c_str(), type);
        // type 0 -> UNKNOWN ENTITY
        // type 1 -> POINT CLOUD
        // type 2 -> WAYPOINT
        // type 3 -> TEMPLATE
        Q_EMIT setContext(type,name);
    }
    else
    {
        Q_EMIT setContext(-1,""); // NO_HIT
    }
}
开发者ID:team-vigir,项目名称:vigir_ocs_common,代码行数:29,代码来源:selection_3d_display_custom.cpp


示例2: qDebug

/* call seq:init,setContext,create(start),reset,
   chooseContext,glcx->makeCurrent(); */
void QGLWidget::init( QGLContext *context, const QGLWidget* shareWidget )
{
    qDebug( "qgl_win.cpp; QGLWidget::init( QGLContext *context, const QGLWidget* shareWidget )" );
    glcx = 0;
    autoSwap = TRUE;
    if ( shareWidget )
        setContext( context, shareWidget->context() );
    else
        setContext( context );
    setBackgroundMode( NoBackground ); //the widget is not cleared before paintEvent().

    /*
      if (isValid() && context->format().hasOverlay() ) {
      QCString olcxName (name() );
      olcxName+="-OGL_internal_overlay_widget";
      olcx = new QGLWidget( QGLFormat::defaultOverlayFormat(),
      this, olwName, shareWidget );
      if ( olcx->isValid() ) {
      olcx->setAutoBufferSwap( FALSE );
      }
      else {
      delete olcx;
      olcx = 0;
      glcx->glFormat.setOverlay( FALSE );
      }
      }*/


}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:31,代码来源:qgl_win.cpp


示例3: size

QPixmap QGLWidget::renderPixmap( int w, int h, bool useContext )
{
    QPixmap nullPm;
    QSize sz = size();
    if ( (w > 0) && (h > 0) )
	sz = QSize( w, h );
    QPixmap pm( sz );
    glcx->doneCurrent();
    bool success = TRUE;

    if ( useContext && isValid() && renderCxPm( &pm ) )
	return pm;

    QGLFormat fmt = format();
    fmt.setDirectRendering( FALSE );		// No direct rendering
    fmt.setDoubleBuffer( FALSE );		// We don't need dbl buf
    QGLContext* pcx = new QGLContext( fmt, &pm );
    QGLContext* ocx = (QGLContext*)context();
    setContext( pcx, 0, FALSE );
    if ( pcx->isValid() )
	updateGL();
    else
	success = FALSE;
    setContext( ocx );				// Will delete pcx

    if ( success )
	return pm;
    else
	return nullPm;
}
开发者ID:opieproject,项目名称:qte-opie,代码行数:30,代码来源:qgl.cpp


示例4: QMT_CHECK

void DUpdateVisitor::visitMObject(const MObject *object)
{
    auto dobject = dynamic_cast<DObject *>(m_target);
    QMT_CHECK(dobject);
    if (isUpdating(object->stereotypes() != dobject->stereotypes()))
        dobject->setStereotypes(object->stereotypes());
    const MObject *objectOwner = object->owner();
    const MObject *diagramOwner = m_diagram->owner();
    if (objectOwner && diagramOwner && objectOwner->uid() != diagramOwner->uid()) {
        if (isUpdating(objectOwner->name() != dobject->context()))
            dobject->setContext(objectOwner->name());
    } else {
        if (isUpdating(!dobject->context().isEmpty()))
            dobject->setContext(QString());
    }
    if (isUpdating(object->name() != dobject->name()))
        dobject->setName(object->name());
    // TODO unlikely that this is called for all objects if hierarchy is modified
    // PERFORM remove loop
    int depth = 1;
    const MObject *owner = object->owner();
    while (owner) {
        owner = owner->owner();
        depth += 1;
    }
    if (isUpdating(depth != dobject->depth()))
        dobject->setDepth(depth);
    visitMElement(object);
}
开发者ID:twistedmove,项目名称:qt-creator,代码行数:29,代码来源:dupdatevisitor.cpp


示例5: kDebug

NavigationWidget::NavigationWidget(KDevelop::DeclarationPointer declaration, KDevelop::TopDUContextPointer topContext, const QString& /* htmlPrefix */, const QString& /* htmlSuffix */)
{
    kDebug() << "Navigation widget for Declaration requested";
    m_topContext = topContext;
    
    initBrowser(400);
    
    DeclarationNavigationContext* context = new DeclarationNavigationContext(declaration, m_topContext);
    m_startContext = context;
    setContext(m_startContext);
    
    m_fullyQualifiedModuleIdentifier = context->m_fullyQualifiedModuleIdentifier;
    kDebug() << "Identifier: " << m_fullyQualifiedModuleIdentifier;
    if ( m_fullyQualifiedModuleIdentifier.length() ) {
        kDebug() << "Checking wether doc server is running";
        QTcpSocket* sock = new QTcpSocket();
        sock->connectToHost(QHostAddress::LocalHost, 1050, QTcpSocket::ReadOnly);
        bool running = sock->waitForConnected(300);
        if ( ! running ) {
            kDebug() << "Not running, starting pydoc server";
            QProcess::startDetached("/usr/bin/env", QStringList() << "python" << QString(INSTALL_PATH) + "/pydoc.py" << "-p" << "1050");
            usleep(100000); // give pydoc server 100ms to start up
        }
        else {
            sock->disconnectFromHost();
        }
        delete sock;
        
        m_documentationWebView = new QWebView(this);
        m_documentationWebView->load(QUrl("http://localhost:1050/" + m_fullyQualifiedModuleIdentifier + ".html"));
        connect( m_documentationWebView, SIGNAL(loadFinished(bool)), SLOT(addDocumentationData(bool)) );
    }
}
开发者ID:mcanes,项目名称:kdevelop-python,代码行数:33,代码来源:navigationwidget.cpp


示例6: d_func_dynamic

VariableDeclaration::VariableDeclaration(const KDevelop::RangeInRevision& range, KDevelop::DUContext* context)
        : KDevelop::Declaration(*new VariableDeclarationData, range)
{
    d_func_dynamic()->setClassId(this);
    if (context)
        setContext(context);
}
开发者ID:KDE,项目名称:kdev-php,代码行数:7,代码来源:variabledeclaration.cpp


示例7: setContext

PythonEditor::PythonEditor(EditorWidget *editorWidget)
    :BaseTextEditor(editorWidget)
{
    setContext(Core::Context(Constants::C_PYTHONEDITOR_ID,
                             TextEditor::Constants::C_TEXTEDITOR));
    setDuplicateSupported(true);
}
开发者ID:FlavioFalcao,项目名称:qt-creator,代码行数:7,代码来源:pythoneditor.cpp


示例8: setContext

void X11Wnd::fillRects(Context* context, RECT* rects, int numRects)
{
  setContext(context);
  for (int i = 0; i < numRects; i++)
    solidRect(rects[i],::GetTextColor(m_dc));
  ::InvalidateRect(m_hWnd,NULL,FALSE);
}
开发者ID:DavidKinder,项目名称:Xlife,代码行数:7,代码来源:X11Wnd.cpp


示例9: WebCLEvent

WebCLUserEvent::WebCLUserEvent(cl_event event, PassRefPtr<WebCLContext> context)
    : WebCLEvent(event)
    , m_eventStatusSituation(StatusUnset)
    , m_executionStatus(0)
{
    setContext(context);
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:7,代码来源:WebCLUserEvent.cpp


示例10: setContext

void Console::setScriptEvaluator(const ScriptEvaluator &evaluator)
{
    m_scriptEvaluator = evaluator;
    m_consoleItemModel->setCanFetchMore(bool(m_scriptEvaluator));
    if (!m_scriptEvaluator)
        setContext(QString());
}
开发者ID:qtproject,项目名称:qt-creator,代码行数:7,代码来源:console.cpp


示例11: wxPaintDC

/* OGLCanvas::onPaint
 * Called when the gfx canvas has to be redrawn
 *******************************************************************/
void OGLCanvas::onPaint(wxPaintEvent& e) {
	wxPaintDC(this);

	if (IsShown()) {
		// Set context to this window
#ifdef USE_SFML_RENDERWINDOW
#if SFML_VERSION_MAJOR < 2
		sf::RenderWindow::SetActive();
		Drawing::setRenderTarget(this);
		SetView(sf::View(sf::FloatRect(0.0f, 0.0f, GetSize().x, GetSize().y)));
#else
		sf::RenderWindow::setActive();
		Drawing::setRenderTarget(this);
		setView(sf::View(sf::FloatRect(0.0f, 0.0f, GetSize().x, GetSize().y)));
#endif//SFML_VERSION_MAJOR
#else
		setContext();
#endif//USE_SFML_RENDERWINDOW

		// Init if needed
		if (!init_done)
			init();

		// Draw content
		draw();
	}
}
开发者ID:doomtech,项目名称:slade,代码行数:30,代码来源:OGLCanvas.cpp


示例12: setAgent

 AgentCallbackLoginAction::AgentCallbackLoginAction(const std::string& agent, const std::string& exten, const std::string& context, bool ackCall, long wrapupTime) {
     setAgent(agent);
     setExten(exten);
     setContext(context);
     setAckCall(ackCall);
     setWrapupTime(wrapupTime);
 }
开发者ID:augcampos,项目名称:asterisk-cpp,代码行数:7,代码来源:AgentCallbackLoginAction.cpp


示例13: findContext

bool QQmlAndroidContextual::initContext(QQmlAndroidContext *context)
{
    if (!context)
        context = findContext(this);
    setContext(context);
    return context;
}
开发者ID:butzist,项目名称:playground-qtqmlandroid,代码行数:7,代码来源:qqmlandroidcontextual.cpp


示例14: ClassMemberDeclaration

AliasDeclaration::AliasDeclaration(const RangeInRevision& range, DUContext* context)
  : ClassMemberDeclaration(*new AliasDeclarationData, range)
{
  d_func_dynamic()->setClassId(this);
  setKind(Alias);
  if( context )
    setContext( context );
}
开发者ID:KDE,项目名称:kdevplatform,代码行数:8,代码来源:aliasdeclaration.cpp


示例15: setContext

void QQmlAndroidContextual::resolveContext()
{
    if (!m_context) {
        setContext(findContext(this));
        if (!m_context)
            qWarning() << "QQmlAndroidContextual: could not resolve context for" << this;
    }
}
开发者ID:butzist,项目名称:playground-qtqmlandroid,代码行数:8,代码来源:qqmlandroidcontextual.cpp


示例16: BaseTextEditor

VcsBaseEditor::VcsBaseEditor(VcsBaseEditorWidget *widget,
                             const VcsBaseEditorParameters *type)  :
    BaseTextEditor(widget),
    m_id(type->id),
    m_temporary(false)
{
    setContext(Core::Context(type->context, TextEditor::Constants::C_TEXTEDITOR));
}
开发者ID:KDE,项目名称:android-qt-creator,代码行数:8,代码来源:vcsbaseeditor.cpp


示例17: setSlotContext

// context: String containing the parent context's name
bool ZeroMQHandler::setSlotContext(ZeroMQContext* const msg)
{
   // Save the name and find the context for use in the initialization
   // of the socket
   bool ok = false;
   if (msg != nullptr) ok = setContext(msg);
   return ok;
}
开发者ID:krhohio,项目名称:OpenEaaglesExamples,代码行数:9,代码来源:ZeroMQHandler.cpp


示例18: setContext

PaintPlugin::~PaintPlugin() {
    gPathI.deletePath(m_touchPath);
    gPaintI.deletePaint(m_paintSurface);
    gPaintI.deletePaint(m_paintButton);

    setContext(NULL);
    destroySurface();
}
开发者ID:0omega,项目名称:platform_development,代码行数:8,代码来源:PaintPlugin.cpp


示例19: exitProcess

void
exitProcess(int code)
{
   sExitCode = code;
   sRunning = false;
   cpu::halt();
   setContext(nullptr);
}
开发者ID:achurch,项目名称:decaf-emu,代码行数:8,代码来源:kernel.cpp


示例20: Declaration

NamespaceAliasDeclaration::NamespaceAliasDeclaration(const SimpleRange& range, DUContext* context)
  : Declaration(*new NamespaceAliasDeclarationData, range)
{
  d_func_dynamic()->setClassId(this);
  setKind(NamespaceAlias);
  if( context )
    setContext( context );
}
开发者ID:portaloffreedom,项目名称:kdev-golang-plugin,代码行数:8,代码来源:namespacealiasdeclaration.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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