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


C++ reposition函数代码示例

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


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

示例1: setVisible

void QmlProfilerStateWidget::updateDisplay()
{
    // When datamodel is acquiring data
    if (!d->loadingDone && !d->emptyList && !d->appKilled) {
        setVisible(true);
        d->text->setText(tr("Loading data"));
        if (d->isRecording) {
            d->isRecording = false;
            d->estimatedProfilingTime = d->profilingTimer.elapsed();
            emit newTimeEstimation(d->estimatedProfilingTime);
        }
        d->progressBar->setValue(d->m_modelManager->progress() * 1000);
        d->progressBar->setVisible(true);
        resize(300,70);
        reposition();
        return;
    }

    // When application is being profiled
    if (d->isRecording) {
        setVisible(true);
        d->progressBar->setVisible(false);
        d->text->setText(tr("Profiling application"));
        resize(200,70);
        reposition();
        return;
    }

    // After profiling, there is an empty trace
    if (d->traceAvailable && d->loadingDone && d->emptyList) {
        setVisible(true);
        d->progressBar->setVisible(false);
        d->text->setText(tr("No QML events recorded"));
        resize(200,70);
        reposition();
        return;
    }

    // Application died before all data could be read
    if (!d->loadingDone && !d->emptyList && d->appKilled) {
        setVisible(true);
        d->text->setText(tr("Application stopped before loading all data"));
        if (d->isRecording) {
            d->isRecording = false;
            d->estimatedProfilingTime = d->profilingTimer.elapsed();
            emit newTimeEstimation(d->estimatedProfilingTime);
        }
        d->progressBar->setValue(d->m_modelManager->progress() * 1000);
        d->progressBar->setVisible(true);
        resize(300,70);
        reposition();
        return;
    }

    // There is a trace on view, hide this dialog
    d->progressBar->setVisible(false);
    setVisible(false);
}
开发者ID:OnlineCop,项目名称:qt-creator,代码行数:58,代码来源:qmlprofilerstatewidget.cpp

示例2: while

static char *editinput(void)
{
    int c;

    Repeat = NO_ARG;
    old_point = rl_point = rl_mark = rl_end = 0;
    rl_line_buffer[0] = '\0';

    el_intr_pending = -1;
    while ((c = tty_get()) != EOF) {
        switch (tty_special(c)) {
	    case CSdone:
		return rl_line_buffer;

	    case CSeof:
		return NULL;

	    case CSsignal:
		return (char *)"";

	    case CSmove:
		reposition();
		break;

	    case CSdispatch:
		switch (emacs(c)) {
		    case CSdone:
			return rl_line_buffer;

		    case CSeof:
			return NULL;

		    case CSsignal:
			return (char *)"";

		    case CSmove:
			reposition();
			break;

		    case CSdispatch:
		    case CSstay:
			break;
		}
		break;

	    case CSstay:
		break;
        }
    }
    return NULL;
}
开发者ID:jakubpawlo,项目名称:editline,代码行数:51,代码来源:editline.c

示例3: switch

bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
	CInventoryGlyphAction *invAction = static_cast<CInventoryGlyphAction *>(action);
	CPetInventoryGlyphs *owner = dynamic_cast<CPetInventoryGlyphs *>(_owner);
	if (!invAction)
		return false;

	switch (invAction->getMode()) {
	case ACTION_REMOVED:
		if (invAction->_item == _item) {
			_item = nullptr;
			_background = nullptr;
			_field34 = 0;
		}
		break;

	case ACTION_REMOVE:
		if (_item == invAction->_item && _owner) {
			int v = populateItem(_item, 0);
			_background = owner->getBackground(v);

			if (isHighlighted()) {
				Point glyphPos = _owner->getHighlightedGlyphPos();
				reposition(glyphPos);
				updateTooltip();
			}
		}
		break;

	default:
		break;
	}

	return true;
}
开发者ID:peterkohaut,项目名称:scummvm,代码行数:34,代码来源:pet_inventory_glyphs.cpp

示例4: parentRect

void HighlightItem::setPos(double x, double y)
{
    QRectF pr = parentRect();
    m_xn = (x - pr.left()) / (double)pr.width();
    m_yn = (y - pr.top()) / (double)pr.height();
    reposition();
}
开发者ID:AndySardina,项目名称:fotowall,代码行数:7,代码来源:HighlightItem.cpp

示例5: reposition

void CPetInventoryGlyph::highlightCurrent(const Point &pt) {
	reposition(pt);
	if (_item) {
		CPETObjectSelectedMsg selectedMsg;
		selectedMsg.execute(_item);
	}
}
开发者ID:peterkohaut,项目名称:scummvm,代码行数:7,代码来源:pet_inventory_glyphs.cpp

示例6: QWidget

WaitingOverlay::WaitingOverlay(KJob *job, QWidget *baseWidget, QWidget *parent)
    : QWidget(parent ? parent : baseWidget->window())
    , mBaseWidget(baseWidget)
{
    Q_ASSERT(baseWidget);
    Q_ASSERT(parentWidget() != baseWidget);

    connect(baseWidget, &QObject::destroyed, this, &QObject::deleteLater);
    connect(job, &KJob::result, this, &QObject::deleteLater);
    mPreviousState = mBaseWidget->isEnabled();

    QBoxLayout *topLayout = new QVBoxLayout(this);
    topLayout->addStretch();
    QLabel *description = new QLabel(this);
    description->setText(i18n("<p style=\"color: white;\"><b>Waiting for operation</b><br/></p>"));
    description->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    topLayout->addWidget(description);
    topLayout->addStretch();

    QPalette p = palette();
    p.setColor(backgroundRole(), QColor(0, 0, 0, 128));
    setPalette(p);
    setAutoFillBackground(true);

    mBaseWidget->installEventFilter(this);

    reposition();
}
开发者ID:KDE,项目名称:akonadi-contacts,代码行数:28,代码来源:waitingoverlay.cpp

示例7: decltype

void ThreadControlBlock::updateBoostedPriority(const uint8_t boostedPriority)
{
	decltype(boostedPriority_) newBoostedPriority {boostedPriority};

	for (const auto& mutexControlBlock : ownedProtocolMutexList_)
	{
		const auto mutexBoostedPriority = mutexControlBlock.getBoostedPriority();
		newBoostedPriority = std::max(newBoostedPriority, mutexBoostedPriority);
	}

	if (boostedPriority_ == newBoostedPriority)
		return;

	const auto oldEffectivePriority = getEffectivePriority();
	boostedPriority_ = newBoostedPriority;
	const auto newEffectivePriority = getEffectivePriority();

	if (oldEffectivePriority == newEffectivePriority || threadListNode.isLinked() == false)
		return;

	const auto loweringBefore = newEffectivePriority < oldEffectivePriority;

	reposition(loweringBefore);

	// this code is placed here, even though it could be moved to ThreadControlBlock::reposition(), simplifying
	// ThreadControlBlock::setPriority(). This way optimizer can remove recursive calls to this function, reducing
	// memory usage of threads.
	if (priorityInheritanceMutexControlBlock_ != nullptr)
		priorityInheritanceMutexControlBlock_->getOwner()->updateBoostedPriority();
}
开发者ID:cederom,项目名称:distortos,代码行数:30,代码来源:ThreadControlBlock.cpp

示例8: PopupWidget

ScriptTerminatorWidget::ScriptTerminatorWidget( const QString &message )
: PopupWidget( 0 )
{
    setFrameStyle( QFrame::StyledPanel | QFrame::Raised );

    setContentsMargins( 4, 4, 4, 4 );

    setMinimumWidth( 26 );
    setMinimumHeight( 26 );
    setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );

    QPalette p = QToolTip::palette();
    setPalette( p );

    QLabel *alabel = new QLabel( message, this );
    alabel->setWordWrap( true );
    alabel->setTextFormat( Qt::RichText );
    alabel->setTextInteractionFlags( Qt::TextBrowserInteraction );
    alabel->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
    alabel->setPalette( p );

    KPushButton *button = new KPushButton( i18n( "Terminate" ), this );
    button->setPalette(p);;
    connect( button, SIGNAL(clicked()), SIGNAL(terminate()) );
    button = new KPushButton( KStandardGuiItem::close(), this );
    button->setPalette(p);
    connect( button, SIGNAL(clicked()), SLOT(hide()) );

    reposition();
}
开发者ID:darthcodus,项目名称:Amarok,代码行数:30,代码来源:ScriptItem.cpp

示例9: clearNodes

void GraphGraphicsView::drawSpecifiedGraph(int vertices, int edges)
{
    clearNodes();
    clearArrows();
    adjMatrix.clear();
    adj.clear();

    for (int i = 0; i < vertices; ++i) {
        nodes.push_back(new NodeGraphicsItem(QString::number(i+1)));
        scene.addItem(nodes[i]);
        nodes[i]->setPos(qrand() % 500, qrand() % 500);
    }

    for (int i = 0; i < nodes.length(); ++i) {
        adjMatrix.push_back(QList<int>());
        adj.push_back(AdjacencyList());
        for (int j = 0; j < nodes.length(); ++j) {
            if (edges > 0 && i != j)
            {
                int val = qrand() % 11;
                adjMatrix[i].push_back(val);
                if (val > 0) {
                    adj[i].Insert(j,val);
                }
                edges--;
            }
        }
        //adj[i].printValues();
    }

    reposition();
}
开发者ID:DaytimeAH,项目名称:DataVisualize,代码行数:32,代码来源:graphgraphicsview.cpp

示例10: findAvailableScreen

void RazorPanelPrivate::screensChangeds()
{
    if (! canPlacedOn(mScreenNum, mPosition))
        mScreenNum = findAvailableScreen(mPosition);

    reposition();
}
开发者ID:Devoter,项目名称:razor-qt,代码行数:7,代码来源:razorpanel.cpp

示例11: reposition

Node* MapManager::loadZoneByNumber(const int zoneNumber)
{
	//일단 반복문 없이 생짜로 때려박는다.
	NodeTileMap* centerZone = _mapsForNodesWithIndex[zoneNumber-1];
	_nineZones[DIRECTION_N] = centerZone;
	_nineZones[DIRECTION_1] = centerZone->nearNodesMap[DIRECTION_1];
	_nineZones[DIRECTION_2] = centerZone->nearNodesMap[DIRECTION_2];
	_nineZones[DIRECTION_3] = centerZone->nearNodesMap[DIRECTION_3];
	_nineZones[DIRECTION_4] = centerZone->nearNodesMap[DIRECTION_4];
	_nineZones[DIRECTION_6] = centerZone->nearNodesMap[DIRECTION_6];
	_nineZones[DIRECTION_7] = centerZone->nearNodesMap[DIRECTION_7];
	_nineZones[DIRECTION_8] = centerZone->nearNodesMap[DIRECTION_8];
	_nineZones[DIRECTION_9] = centerZone->nearNodesMap[DIRECTION_9];
	
	for (int i = (int)DIRECTION_1; i <= (int)DIRECTION_9; ++i)
	{
		_nineZones[(DirectionKind)i]->_tiledMap = TMXTiledMap::create(_nineZones[(DirectionKind)i]->_mapFileName);
		_handle->addChild(_nineZones[(DirectionKind)i]->_tiledMap);
	}

	for (int i = DIRECTION_1; i <= DIRECTION_9; ++i)
	{
		_nineZones[(DirectionKind)i]->_tiledMap->setAnchorPoint(ccp(0.5, 0.5));
	}
	_nineZones[DIRECTION_N]->_tiledMap->setPosition(ccp(0,0));
	reposition();

	_handle->setPosition(ccp(0,0/*SCREEN_PIXEL_WIDTH/2,SCREEN_PIXEL_HEIGHT/2*/));

	return _handle;
}
开发者ID:seokmin,项目名称:2d_map,代码行数:31,代码来源:MapManager.cpp

示例12: switchFullScreen

    void EGLWindow::setFullscreen(bool fullscreen, uint width, uint height)
    {
        short frequency = 0;

        if (mClosed || !mIsTopLevel)
        {
            return;
        }

        if (fullscreen == mIsFullScreen && width == mWidth && height == mHeight)
        {
            return;
        }
		if (fullscreen)
        {
            mGLSupport->switchMode(width, height, frequency);
        }
        else
        {
            mGLSupport->switchMode();
        }

        if (mIsFullScreen != fullscreen)
        {
            switchFullScreen(fullscreen);
        }

        if (!mIsFullScreen)
        {
            resize(width, height);
            reposition(mLeft, mTop);
        }
    }
开发者ID:jakzale,项目名称:ogre,代码行数:33,代码来源:OgreEGLWindow.cpp

示例13: QWidget

PDFViewerWindow::PDFViewerWindow(unsigned int monitor, PagePart myPart, bool showInformationLine, const RuntimeConfiguration& r, bool enabled): 
  QWidget(),
  m_enabled(enabled),
  m_monitor(monitor),
  minimumPageNumber(0),
  maximumPageNumber(65535),
  myPart(myPart)
{
  if ( ! enabled )
    return;
  setupUi(this);
  if ( !showInformationLine || ! r.showPresenterArea()) {
    /* If the information line is disabled because we're the primary screen,
     * or the user explicitly said so, disable it completely.
     */
    hideInformationLine();
  }
  else {
    /* Enable the information line, but control visibility of the components as requested by the user.
     */
    this->showInformationLine();
    this->wallClock->setVisible(r.showWallClock());
    this->thumbnailArea->setVisible(r.showThumbnails());
    this->slideClock->setVisible(r.showSlideClock());
    this->presentationClock->setVisible(r.showPresentationClock());
  }
  reposition();
}
开发者ID:wwwdata,项目名称:dspdfviewer,代码行数:28,代码来源:pdfviewerwindow.cpp

示例14: adjustBob

void Camera::moveBackward()
{
	adjustBob(false);
	Vector3 newPos = getPosition() - getSubjectRelative();
	setPosition(newPos.x, getPosition().y, newPos.z);
	reposition();
}
开发者ID:dalorin,项目名称:FPSDemo,代码行数:7,代码来源:Camera.cpp

示例15: QWidget

ErrorOverlay::ErrorOverlay(QWidget *baseWidget, const QString &details, QWidget *parent) :
    QWidget(parent ? parent : baseWidget->window()),
    m_BaseWidget(baseWidget)
{
    // Build the UI
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setSpacing(10);

    QLabel *pixmap = new QLabel();
    pixmap->setPixmap(KIcon("dialog-error").pixmap(64));

    QLabel *message = new QLabel(i18n("Power Management configuration module could not be loaded.\n%1", details));

    pixmap->setAlignment(Qt::AlignHCenter);
    message->setAlignment(Qt::AlignHCenter);

    layout->addStretch();
    layout->addWidget(pixmap);
    layout->addWidget(message);
    layout->addStretch();

    setLayout(layout);

    // Draw the transparent overlay background
    QPalette p = palette();
    p.setColor(backgroundRole(), QColor(0, 0, 0, 128));
    p.setColor(foregroundRole(), Qt::white);
    setPalette(p);
    setAutoFillBackground(true);

    m_BaseWidget->installEventFilter(this);

    reposition();
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:34,代码来源:ErrorOverlay.cpp


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