这篇教程C++ updateColor函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中updateColor函数的典型用法代码示例。如果您正苦于以下问题:C++ updateColor函数的具体用法?C++ updateColor怎么用?C++ updateColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了updateColor函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: updateGradTypevoid Setup_Colors::action(const gcn::ActionEvent &event){ if (event.getId() == "slider_grad") updateGradType(); else if (event.getId() == "slider_graddelay") mGradDelayText->setText(toString(std::floor(mGradDelaySlider->getValue()))); else if (event.getId() == "slider_red") mRedText->setText(toString(std::floor(mRedSlider->getValue()))); else if (event.getId() == "slider_green") mGreenText->setText(toString(std::floor(mGreenSlider->getValue()))); else if (event.getId() == "slider_blue") mBlueText->setText(toString(std::floor(mBlueSlider->getValue()))); else return; updateColor();}
开发者ID:Aethyra,项目名称:Client,代码行数:17,
示例2: switchint Window::qt_metacall(QMetaObject::Call _c, int _id, void **_a){ _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: saveSvg(); break; case 1: updateBackground((*reinterpret_cast< int(*)>(_a[1]))); break; case 2: updateColor(); break; case 3: updateShape((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; } _id -= 4; } return _id;}
开发者ID:venkatarajasekhar,项目名称:ECE497,代码行数:17,
示例3: updateColorvoid ProtectedNode::updateDisplayedColor(const Color3B& parentColor){ _displayedColor.r = _realColor.r * parentColor.r/255.0; _displayedColor.g = _realColor.g * parentColor.g/255.0; _displayedColor.b = _realColor.b * parentColor.b/255.0; updateColor(); if (_cascadeColorEnabled) { for(const auto &child : _children){ child->updateDisplayedColor(_displayedColor); } } for(const auto &child : _protectedChildren){ child->updateDisplayedColor(_displayedColor); }}
开发者ID:xiaotingHuang,项目名称:Cocos2dx-quick3.8.1,代码行数:17,
示例4: updateColor//--------------------------------------------------------------------------// Advance time//--------------------------------------------------------------------------void Splash::advanceTime(F32 dt){ if (dt == 0.0) return; mElapsedTime += dt; updateColor(); updateWave( dt ); updateEmitters( dt ); updateRings( dt ); if( !mDead ) { emitRings( dt ); }}
开发者ID:03050903,项目名称:Torque3D,代码行数:20,
示例5: scS void PretzelColorPicker::redrawBox() { { gl::ScopedGlslProg scS( mBoxShader ); gl::ScopedViewport scVp( mBoxFbo->getSize() ); gl::setMatricesWindow( mBoxFbo->getSize() ); gl::ScopedFramebuffer scF( mBoxFbo ); mBoxShader->uniform( "uPickedCol", mHueCol ); gl::clear( ColorA(1,1,1,0) ); gl::drawSolidRect( mBoxFbo->getBounds() ); } updateColor(); gl::setMatricesWindow( getWindowSize() ); }
开发者ID:HackTheDinos,项目名称:DinoJerks,代码行数:18,
示例6: Private Private(const QUrl& url, URLLabel* label) : URL(url), Underline(true), LinkColor(qApp->palette().link().color()), HighlightedLinkColor(Qt::red), Tip(url.toString()), Cursor(0L), UseTips(false), UseCursor(false), Glow(true), Float(false), RealUnderline(true), Timer(new QTimer(label)) { connect( Timer, SIGNAL( timeout() ), label, SLOT( updateColor() ) ); connect( label, SIGNAL( leftClickedURL( const QUrl& ) ), label, SLOT( openURL( const QUrl& ) ) ); }
开发者ID:exic,项目名称:last.fm-dbus,代码行数:18,
示例7: updateColor void Scale9Sprite::updateDisplayedOpacity(GLubyte parentOpacity) { _displayedOpacity = _realOpacity * parentOpacity/255.0; updateColor(); if (_scale9Image) { _scale9Image->updateDisplayedOpacity(_displayedOpacity); } if (_cascadeOpacityEnabled) { for(auto child : _children) { child->updateDisplayedOpacity(_displayedOpacity); } } }
开发者ID:funseek,项目名称:TransitionExample,代码行数:18,
示例8: foreachvoid SpreadSheet::selectColor(){ QTableWidgetItem *item = table->currentItem(); QColor col = item ? item->backgroundColor() : table->palette().base().color(); col = QColorDialog::getColor(col, this); if (!col.isValid()) return; QList<QTableWidgetItem*> selected = table->selectedItems(); if (selected.count() == 0) return; foreach(QTableWidgetItem *i, selected) if (i) i->setBackgroundColor(col); updateColor(table->currentItem());}
开发者ID:RobertoMalatesta,项目名称:emscripten-qt,代码行数:18,
示例9: setAcceptHoverEventsvoidJunctionElementItem::init(){ // Selection/Highlighting // // setAcceptHoverEvents(true); if (getParentJunctionComponentItem()) { setFlag(QGraphicsItem::ItemIsMovable, false); // move the whole group } else { setFlag(QGraphicsItem::ItemIsMovable, true); } // Color & Path // // updateColor(); createPath(); // ContextMenu // // QAction *hideAction = getHideMenu()->addAction(tr("Track")); connect(hideAction, SIGNAL(triggered()), this, SLOT(hideGraphElement())); if (getParentJunctionComponentItem()) { QAction *hideParentTrackComponentAction = getHideMenu()->addAction(tr("Group")); connect(hideParentTrackComponentAction, SIGNAL(triggered()), this, SLOT(hideParentTrackComponent())); QAction *ungroupAction = getContextMenu()->addAction("Ungroup"); connect(ungroupAction, SIGNAL(triggered()), getParentJunctionComponentItem(), SLOT(ungroupComposite())); } QAction *hideRoadAction = getHideMenu()->addAction(tr("Road")); connect(hideRoadAction, SIGNAL(triggered()), this, SLOT(hideParentRoad())); QAction *removeSectionAction = getRemoveMenu()->addAction(tr("Track(s)")); connect(removeSectionAction, SIGNAL(triggered()), this, SLOT(removeSection())); QAction *removeRoadAction = getRemoveMenu()->addAction(tr("Road")); connect(removeRoadAction, SIGNAL(triggered()), this, SLOT(removeParentRoad()));}
开发者ID:xyuan,项目名称:covise,代码行数:44,
示例10: QMainWindowSpreadSheet::SpreadSheet(int rows, int cols, QWidget *parent) : QMainWindow(parent){ addToolBar(toolBar = new QToolBar()); formulaInput = new QLineEdit(); cellLabel = new QLabel(toolBar); cellLabel->setMinimumSize(80, 0); toolBar->addWidget(cellLabel); toolBar->addWidget(formulaInput); table = new QTableWidget(rows, cols, this); table->setSizeAdjustPolicy(QTableWidget::AdjustToContents); for (int c = 0; c < cols; ++c) { QString character(QChar('A' + c)); table->setHorizontalHeaderItem(c, new QTableWidgetItem(character)); } table->setItemPrototype(table->item(rows - 1, cols - 1)); table->setItemDelegate(new SpreadSheetDelegate()); createActions(); updateColor(0); setupMenuBar(); setupContents(); setupContextMenu(); setCentralWidget(table); statusBar(); connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), this, SLOT(updateStatus(QTableWidgetItem*))); connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), this, SLOT(updateColor(QTableWidgetItem*))); connect(table, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), this, SLOT(updateLineEdit(QTableWidgetItem*))); connect(table, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(updateStatus(QTableWidgetItem*))); connect(formulaInput, SIGNAL(returnPressed()), this, SLOT(returnPressed())); connect(table, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(updateLineEdit(QTableWidgetItem*))); setWindowTitle(tr("Spreadsheet"));}
开发者ID:AlexSoehn,项目名称:qt-base-deb,代码行数:44,
示例11: QgsBottomBarQgsBullsEyeWidget::QgsBullsEyeWidget( QgsMapCanvas *canvas, QgsLayerTreeView* layerTreeView ) : QgsBottomBar( canvas ), mLayerTreeView( layerTreeView ){ setLayout( new QHBoxLayout ); layout()->setSpacing( 10 ); QWidget* base = new QWidget(); ui.setupUi( base ); layout()->addWidget( base ); QPushButton* closeButton = new QPushButton(); closeButton->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); closeButton->setIcon( QIcon( ":/images/themes/default/mIconClose.png" ) ); closeButton->setToolTip( tr( "Close" ) ); connect( closeButton, SIGNAL( clicked( bool ) ), this, SIGNAL( close() ) ); layout()->addWidget( closeButton ); layout()->setAlignment( closeButton, Qt::AlignTop ); ui.comboBoxLabels->addItem( tr( "Disabled" ), static_cast<int>( QgsBullsEyeLayer::NO_LABELS ) ); ui.comboBoxLabels->addItem( tr( "Axes" ), static_cast<int>( QgsBullsEyeLayer::LABEL_AXES ) ); ui.comboBoxLabels->addItem( tr( "Rings" ), static_cast<int>( QgsBullsEyeLayer::LABEL_RINGS ) ); ui.comboBoxLabels->addItem( tr( "Axes and rings" ), static_cast<int>( QgsBullsEyeLayer::LABEL_AXES_RINGS ) ); connect( ui.toolButtonAddLayer, SIGNAL( clicked( bool ) ), this, SLOT( createLayer() ) ); connect( ui.inputCenter, SIGNAL( coordinateChanged() ), this, SLOT( updateLayer() ) ); connect( ui.toolButtonPickCenter, SIGNAL( clicked( bool ) ), this, SIGNAL( requestPickCenter() ) ); connect( ui.spinBoxRings, SIGNAL( valueChanged( int ) ), this, SLOT( updateLayer() ) ); connect( ui.spinBoxRingInterval, SIGNAL( valueChanged( double ) ), this, SLOT( updateLayer() ) ); connect( ui.spinBoxAxesInterval, SIGNAL( valueChanged( double ) ), this, SLOT( updateLayer() ) ); connect( ui.toolButtonColor, SIGNAL( colorChanged( QColor ) ), this, SLOT( updateColor( QColor ) ) ); connect( ui.spinBoxFontSize, SIGNAL( valueChanged( int ) ), this, SLOT( updateFontSize( int ) ) ); connect( ui.comboBoxLabels, SIGNAL( currentIndexChanged( int ) ), this, SLOT( updateLabeling( int ) ) ); connect( ui.spinBoxLineWidth, SIGNAL( valueChanged( int ) ), this, SLOT( updateLineWidth( int ) ) ); connect( QgsMapLayerRegistry::instance(), SIGNAL( layersAdded( QList<QgsMapLayer*> ) ), this, SLOT( repopulateLayers() ) ); connect( QgsMapLayerRegistry::instance(), SIGNAL( layersRemoved( QStringList ) ), this, SLOT( repopulateLayers() ) ); connect( mCanvas, SIGNAL( currentLayerChanged( QgsMapLayer* ) ), this, SLOT( updateSelectedLayer( QgsMapLayer* ) ) ); repopulateLayers(); connect( ui.comboBoxLayer, SIGNAL( currentIndexChanged( int ) ), this, SLOT( currentLayerChanged( int ) ) );}
开发者ID:sourcepole,项目名称:kadas-albireo,代码行数:43,
示例12: if//-----------------------------------------------------------------------------void ChannelSelectionDialog::on_channel_table__cellClicked (int row, int column){ QTableWidgetItem* item = ui_.channel_table_->item (row, column); if (column == LABEL_INDEX_) { self_setting_ = true; if (item->checkState() == Qt::Checked) item->setCheckState (Qt::Unchecked); else item->setCheckState (Qt::Checked); } else if (column == COLOR_INDEX_) { QColorDialog color_dialog (item->backgroundColor (), this); if (color_dialog.exec () == QDialog::Accepted) updateColor (row, color_dialog.selectedColor ()); } self_setting_ = false;}
开发者ID:410pfeliciano,项目名称:sigviewer,代码行数:20,
示例13: updateColor void PretzelColorPicker::mouseDragged(const ci::vec2 &pos){ if( bDragging ){ vec2 localPos = pos - mOffset; vec2 n; n.x = ci::math<float>::clamp( (localPos.x - mColorSwatchRect.x1) / mColorSwatchRect.getWidth(), 0.0, 1.0); n.y = ci::math<float>::clamp( (localPos.y - mColorSwatchRect.y1) / mColorSwatchRect.getHeight(), 0.0, 1.0); mCrosshairPos = n; updateColor(); }else if( bDraggingHue ){ vec2 localPos = pos - mOffset; mHueNorm = lmap( localPos.y, mHueStripRect.y1, mHueStripRect.y2, 0.0f, 1.0f); mHueNorm = ci::math<float>::clamp(mHueNorm); ColorA cc = mHueSurf.getPixel( vec2(1, mHueNorm * mHueSurf.getHeight()) ); mHueCol = cc; redrawBox(); } }
开发者ID:HackTheDinos,项目名称:DinoJerks,代码行数:20,
示例14: createPathvoidSuperelevationSectionPolynomialItem::updateObserver(){ // Parent // // GraphElement::updateObserver(); if (isInGarbage()) { return; // will be deleted anyway } // SuperelevationSection // // int superelevationChanges = superelevationSection_->getSuperelevationSectionChanges(); if (superelevationChanges & SuperelevationSection::CSE_ParameterChange) { createPath(); updateColor(); }}
开发者ID:nixz,项目名称:covise,代码行数:20,
示例15: QLabelColorIndicatorLabel::ColorIndicatorLabel(QWidget *parent) : QLabel(parent){ if(parent->window()) connect(parent->window(), SIGNAL(invertChanged(bool)), this, SLOT(setInverted(bool))); m = Other; dv = 0; e = 1; v = 0; r = 0; g = 0; b = 0; inverted = false; upColor = Qt::darkGreen; downColor = Qt::darkRed; updateTimer.setInterval(33); connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updateColor()));}
开发者ID:BitStocker,项目名称:MiningDash,代码行数:22,
示例16: updateFinalvoid updateFinal(vector<vector<item> > *matriz, vector<formiga> *formigas, int qtdFormigas, int tamMatrizI, int tamMatrizJ, sf::RenderWindow *window, std::vector<std::vector<sf::RectangleShape> > *grid, normalDim normalDim) { for (int i = 0; i < qtdFormigas; i++) { while (formigas->at(i).item.classe != 0) { //cout << "formig" << formigas->at(i).item.classe << endl; //cout << "map" << matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe << endl; motionAnt(matriz, &formigas->at(i), tamMatrizI, tamMatrizJ, normalDim); } if (matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe == 6) { matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe = 0; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number1 = 0; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number2 = 0; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number3 = 0; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number4 = 0; } if (matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe == 7) { matriz->at(formigas->at(i).i).at(formigas->at(i).j).classe = matriz->at(formigas->at(i).i).at( formigas->at(i).j).classePast; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number1 = matriz->at(formigas->at(i).i).at( formigas->at(i).j).number1Past; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number2 = matriz->at(formigas->at(i).i).at( formigas->at(i).j).number2Past; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number3 = matriz->at(formigas->at(i).i).at( formigas->at(i).j).number3Past; matriz->at(formigas->at(i).i).at(formigas->at(i).j).number4 = matriz->at(formigas->at(i).i).at( formigas->at(i).j).number4Past; } } updateColor(matriz, tamMatrizI, tamMatrizJ, grid); for (int i = 0; i < tamMatrizI; i++) for (int j = 0; j < tamMatrizJ; j++) window->draw(grid->at(i).at(j)); window->display(); getchar();}
开发者ID:dekonunes,项目名称:Ant-Based-Clustering-with-Real-Data,代码行数:38,
示例17: mainint main(){ void updateColor(); Display *d = XOpenDisplay( NULL ); Window w = RootWindow(d, DefaultScreen(d)); void parseField(); int ix; for(ix = 0; ix < 110; ix++){ //main loop int j; //index convention (0-63) printf("Loop %d/110. Colours updated:/n/n", ix); for(j = 63; j >= 0; j--){ //update from below to increase accuracy updateColor(j, d, w, tlx + dx*(j % 8), tly + dy*(j / 8), dx, dy); printf("%d:%x ", j + 1, colArr[j]); if(j % 8 == 0){printf("/n");} } parseField(); system("sleep 0.6"); } return 0;}
开发者ID:Shmooooo,项目名称:OMGPOP-Cheating,代码行数:23,
示例18: createScrollBarsvoid createScrollBars(HWND hwnd){ //TextBoxThicknes thicknesBox = new TextBox("",hwnd,new Dimensions(270,49,30,30)); //Eraser Scroll eraserScrollBar = new ScrollBar(WS_VISIBLE | WS_CHILD | SBS_HORZ ,new Dimensions(5,50,255,20),hwnd,hInstance); eraserScrollBar->setRange(0,255); eraserScrollBar->setThumbPosition(rand() % 100 +1); //Colors Scrolls colorScrollbarR = new ScrollBar(WS_VISIBLE | WS_CHILD | SBS_HORZ ,new Dimensions(5,80,255,20),hwnd,hInstance); colorScrollbarR->setRange(0,255); colorScrollbarR->setThumbPosition(rand() % 100 +1); colorScrollbarG = new ScrollBar(WS_VISIBLE | WS_CHILD | SBS_HORZ ,new Dimensions(5,100,255,20),hwnd,hInstance); colorScrollbarG->setRange(0,255); colorScrollbarG->setThumbPosition(rand() % 100 +1); colorScrollbarB = new ScrollBar(WS_VISIBLE | WS_CHILD | SBS_HORZ ,new Dimensions(5,120,255,20),hwnd,hInstance); colorScrollbarB->setRange(0,255); colorScrollbarB->setThumbPosition(rand() % 100 +1); updateColor(hwnd);}
开发者ID:TUM-FAF,项目名称:FAF-141-Bircu-Maxim,代码行数:24,
示例19: ofSoundUpdate//--------------------------------------------------------------void AudioPlayer::update(){ // update the sound playing system: ofSoundUpdate(); // (5) grab the fft, and put in into a "smoothed" array, // by taking maximums, as peaks and then smoothing downward float * val = ofSoundGetSpectrum(nBandsToGet); // request 128 values for fft for (int i = 0;i < nBandsToGet; i++){ // let the smoothed calue sink to zero: fftSmoothed[i] *= 0.96f; // take the max, either the smoothed or the incoming: if (fftSmoothed[i] < val[i]) fftSmoothed[i] = val[i]; } updateColor(BG_R_, BG_G_, BG_B_); float BG_R = BG_R_; float BG_G = BG_G_; float BG_B = BG_B_; amplifyColor(BG_R, BG_G, BG_B); ofBackground(BG_R,BG_G,BG_B);}
开发者ID:yuwilbur,项目名称:3DViz,代码行数:25,
示例20: updateColorvoid CGradientView::setCompressedInterpolation(bool bCompressedInterpolation){ m_bCompressedInterpolation = bCompressedInterpolation; updateColor();}
开发者ID:54993306,项目名称:Classes,代码行数:5,
示例21: setContentSizevoid Label::alignText(){ if (_fontAtlas == nullptr || _currentUTF16String.empty()) { setContentSize(Size::ZERO); return; } _fontAtlas->prepareLetterDefinitions(_currentUTF16String); auto& textures = _fontAtlas->getTextures(); if (textures.size() > _batchNodes.size()) { for (auto index = _batchNodes.size(); index < textures.size(); ++index) { auto batchNode = SpriteBatchNode::createWithTexture(textures.at(index)); batchNode->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT); batchNode->setPosition(Vec2::ZERO); Node::addChild(batchNode,0,Node::INVALID_TAG); _batchNodes.push_back(batchNode); } } LabelTextFormatter::createStringSprites(this); if(_maxLineWidth > 0 && _contentSize.width > _maxLineWidth && LabelTextFormatter::multilineText(this) ) LabelTextFormatter::createStringSprites(this); if(_labelWidth > 0 || (_currNumLines > 1 && _hAlignment != TextHAlignment::LEFT)) LabelTextFormatter::alignText(this); if (!_children.empty()) { int strLen = static_cast<int>(_currentUTF16String.length()); Rect uvRect; Sprite* letterSprite; for (auto index = 0; index < _children.size();) { auto child = _children.at(index); int tag = child->getTag(); if (tag >= strLen) { child->removeFromParentAndCleanup(true); } else if (tag >= 0) { letterSprite = dynamic_cast<Sprite*>(child); if (letterSprite) { auto& letterDef = _lettersInfo[tag].def; uvRect.size.height = letterDef.height; uvRect.size.width = letterDef.width; uvRect.origin.x = letterDef.U; uvRect.origin.y = letterDef.V; letterSprite->setBatchNode(_batchNodes[letterDef.textureID]); letterSprite->setTextureRect(uvRect, false, uvRect.size); letterSprite->setPosition(_lettersInfo[tag].position.x + letterDef.width/2, _lettersInfo[tag].position.y - letterDef.height/2); } ++index; } else { ++index; } } } for (const auto& batchNode : _batchNodes) { batchNode->getTextureAtlas()->removeAllQuads(); } updateQuads(); updateColor();}
开发者ID:Ratel13,项目名称:Cocos2dGame-v3.7,代码行数:74,
示例22: updateColorvoid LayerGradient::setCompressedInterpolation(bool compress){ _compressedInterpolation = compress; updateColor();}
开发者ID:114393824,项目名称:Cocos2dxShader,代码行数:5,
注:本文中的updateColor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ updateColors函数代码示例 C++ updateCoins函数代码示例 |