void ParticleParameters::UpdateUI() { ui->ApertureSpin->setValue(m_parameters.getAngle()*RAG2DEG); ui->DirectionSpin->setValue(m_parameters.getDirection()*RAG2DEG); const math::vec2f &pos = m_parameters.position(); const math::vec2f &grav = m_parameters.gravity(); ui->PosXSpin->setValue(pos.x); ui->PosYSpin->setValue(pos.y); ui->GravXSpin->setValue(grav.x); ui->GravYSpin->setValue(grav.y); ui->FrequencySpin->setValue(m_parameters.frequency()); StartColor = toQColor(m_parameters.particleColorStart()); EndColor = toQColor(m_parameters.particleColorEnd()); setBackgroundColor(ui->StartColorBut, StartColor); setBackgroundColor(ui->EndColorBut, EndColor); ui->MinLiveSpin->setValue(m_parameters.particleLiveMin()); ui->MaxLiveSpin->setValue(m_parameters.particleLiveMax()); ui->NumPartSpin->setValue(m_parameters.particleCount()); ui->MinSpeedSpin->setValue(m_parameters.particleSpeedMin()); ui->MaxSpeedSpin->setValue(m_parameters.particleSpeedMax()); ui->StartSizeSpin->setValue(m_parameters.particleSizeStart()); ui->EndSizeSpin->setValue(m_parameters.particleSizeEnd()); ui->AccumColorCheckbox->setChecked(m_parameters.particleAccumulativeColor()); ui->MaterialLineEdit->setText(QString(m_parameters.particleMaterial().c_str())); }
void DebugDraw::DrawPolygon(const b2Vec2 *vertices, int32 vertexCount, const b2Color &color) { mP->setPen(toQColor(color)); mP->setBrush(Qt::NoBrush); mP->drawPolygon(toQPolygonF(vertices, vertexCount)); }
void QB2Draw::DrawCircle(const b2Vec2 ¢er, float32 radius, const b2Color &color) { if (painter==NULL) return; //Check the painter QColor c=toQColor(color); //Convert the color painter->setPen(c); //Set pen color painter->setBrush(Qt::transparent); //set brush color painter->drawEllipse(toQPoint(center),qRound(radius*scale),qRound(radius*scale)); //draw circonference }
void DebugDraw::DrawCircle(const b2Vec2 ¢er, float32 radius, const b2Color &color) { mP->setPen(toQColor(color)); mP->setBrush(Qt::NoBrush); mP->drawEllipse(toQPointF(center), radius * scaleRatio, radius * scaleRatio); }
void TestClient::networkStatusChanged( Solid::Networking::Status status ) { kDebug() ; kDebug() << "Networking is now: " << toString( status ) << " (" << status << ")"; ui.netStatusLabel->setText( toString( status ) ); QPalette palette; palette.setColor( ui.netStatusLabel->backgroundRole(), toQColor( m_status ) ); ui.netStatusLabel->setPalette( palette ); }
void ZClickableColorLabel::labelClicked() { if (m_isClickable) { QColor newColor = QColorDialog::getColor(toQColor()); if(newColor.isValid()) { fromQColor(newColor); } } }
void DebugDraw::DrawSolidCircle(const b2Vec2 ¢er, float32 radius, const b2Vec2 &axis, const b2Color &color) { Q_UNUSED(axis) mP->setPen(Qt::NoPen); mP->setBrush(toQColor(color)); mP->drawEllipse(toQPointF(center), radius * scaleRatio, radius * scaleRatio); }
bool ZClickableColorLabel::getTip(const QPoint &p, QRect *r, QString *s) { if (!m_vec4Color && !m_vec3Color && !m_dvec4Color && !m_dvec3Color) return false; if(contentsRect().contains(p)) { *r = contentsRect(); *s = toQColor().name(); return true; } return false; }
ImageWidget::ImageWidget(Image &img, QWidget * parent) : QWidget(parent), m_image(img.width(), img.height(), QImage::Format_ARGB32) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); TRACE(TRC_INFO, "Created new ImageWidget, %dx%d\n", m_image.width(), m_image.height()); for(unsigned i=0; i<img.height(); ++i) { for(unsigned j=0; j<img.width(); ++j) { m_image.setPixel(j, i, toQColor(img, i, j).rgb()); } } }
ColorPropertyWidget::ColorPropertyWidget(FloatVec4Property* prop, QWidget* parent) : QPropertyWidget(prop, parent) , property_(prop) , colorLbl_(new ClickableColorLabel("")) , currentColor_(toQColor(prop->get())) { updateColorLabel(); addWidget(colorLbl_); connect(colorLbl_, SIGNAL(clicked(void)), this, SLOT(setProperty(void))); connect(colorLbl_, SIGNAL(clicked(void)), this, SIGNAL(widgetChanged(void))); addVisibilityControls(); setMinimumHeight(18); }
ImageWidget::ImageWidget(Render &render, QWidget *parent) : QWidget(parent), m_image(render.m_processedSize.m_width, render.m_processedSize.m_height, QImage::Format_ARGB32) { TRACE(TRC_INFO, "Created new ImageWidget, %dx%d\n", m_image.width(), m_image.height()); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); std::auto_ptr<Image> img = render.execute(); for(unsigned i=0; i<img->height(); ++i) { for(unsigned j=0; j<img->width(); ++j) { m_image.setPixel(j, i, toQColor(*img, i, j).rgb()); } } }
void djvStyle::colorUpdate() { //DJV_DEBUG("djvStyle::colorUpdate"); //DJV_DEBUG_PRINT("foreground = " << // _p->palettes[_p->palettesIndex].foreground); //DJV_DEBUG_PRINT("background = " << // _p->palettes[_p->palettesIndex].background); //DJV_DEBUG_PRINT("background2 = " << // _p->palettes[_p->palettesIndex].background2); QPalette palette; palette.setColor( QPalette::Window, toQColor(_p->palettes[_p->palettesIndex].background)); palette.setColor( QPalette::WindowText, toQColor(_p->palettes[_p->palettesIndex].foreground)); palette.setColor( QPalette::Base, toQColor(_p->palettes[_p->palettesIndex].background2)); palette.setColor( QPalette::AlternateBase, toQColor(_p->palettes[_p->palettesIndex].background2).darker(120)); palette.setColor( QPalette::Text, toQColor(_p->palettes[_p->palettesIndex].foreground)); palette.setColor( QPalette::Button, toQColor(_p->palettes[_p->palettesIndex].button)); palette.setColor( QPalette::ButtonText, toQColor(_p->palettes[_p->palettesIndex].foreground)); palette.setColor( QPalette::Highlight, toQColor(_p->palettes[_p->palettesIndex].select)); qApp->setPalette(palette); }
void PlotEntitySettingsDialog::cbMainColumnChanged(int index) { int plotDataIndex = cbMainColumn_->itemData(index).toInt(); entitySettings_.setMainColumnIndex(plotDataIndex); if(plotData_ && (plotDataIndex < plotData_->getColumnCount()) && plotData_->hasColumnColorHint(plotDataIndex)) { // we have a color hint for this column QColor col = toQColor(plotData_->getColumnColorHint(plotDataIndex)); cclrFirst_->setColor(col); switch (entitySettings_.getEntity()) { case PlotEntitySettings::LINE: cclrFourth_->setColor(col); case PlotEntitySettings::SURFACE: cclrThird_->setColor(col); break; case PlotEntitySettings::BAR: case PlotEntitySettings::SCATTER: break; } entitySettings_.setFirstColor(toTgtColor(col)); entitySettings_.setSecondColor(toTgtColor(col)); } }
void ZClickableColorLabel::paintEvent(QPaintEvent *e) { if (!m_vec4Color && !m_vec3Color && !m_dvec4Color && !m_dvec3Color) { QWidget::paintEvent(e); // clear the widget return; } QColor labelColor = toQColor(); QPainter painter(this); painter.setBrush(labelColor); painter.drawRect(1, 1, rect().width() - 2, rect().height() - 2); if (m_vec4Color != NULL) { double gray = .299*labelColor.redF() + .587*labelColor.greenF() + .114*labelColor.blueF(); if (gray > 0.5) { painter.setPen(QColor(0, 0, 0)); } else { painter.setPen(QColor(255, 255, 255)); } painter.drawText(rect(), Qt::AlignCenter, m_vec4Color->getName()); } }
QColor CQGnuPlotMark:: color() const { return toQColor(CGnuPlotMark::color()); }
void DebugDraw::DrawSegment(const b2Vec2 &p1, const b2Vec2 &p2, const b2Color &color) { mP->setPen(toQColor(color)); mP->drawLine(toQPointF(p1), toQPointF(p2)); }
void KoDumbColorDisplayRenderer::getHsv(const KoColor &srcColor, int *h, int *s, int *v, int *a) const { QColor qcolor = toQColor(srcColor); qcolor.getHsv(h, s, v, a); }
void ColorPropertyWidget::updateFromProperty() { currentColor_ = toQColor(property_->get()); updateColorLabel(); }
QColor CQGnuPlotStroke:: color() const { return toQColor(CGnuPlotStroke::color()); }
QColor KoColor::toQColor() const { QColor c; toQColor(&c); return c; }