void WVuMeter::setup(QDomNode node) { // Set pixmaps bool bHorizontal = false; if (!selectNode(node, "Horizontal").isNull() && selectNodeQString(node, "Horizontal")=="true") bHorizontal = true; setPixmaps(getPath(selectNodeQString(node, "PathBack")), getPath(selectNodeQString(node, "PathVu")), bHorizontal); m_iPeakHoldSize = selectNodeInt(node, "PeakHoldSize"); if(m_iPeakHoldSize < 0 || m_iPeakHoldSize > 100) m_iPeakHoldSize = DEFAULT_HOLDSIZE; m_iPeakFallStep = selectNodeInt(node, "PeakFallStep"); if(m_iPeakFallStep < 1 || m_iPeakFallStep > 1000) m_iPeakFallStep = DEFAULT_FALLSTEP; m_iPeakHoldTime = selectNodeInt(node, "PeakHoldTime"); if(m_iPeakHoldTime < 1 || m_iPeakHoldTime > 3000) m_iPeakHoldTime = DEFAULT_HOLDTIME; m_iPeakFallTime = selectNodeInt(node, "PeakFallTime"); if(m_iPeakFallTime < 1 || m_iPeakFallTime > 1000) m_iPeakFallTime = DEFAULT_FALLTIME; }
void WNumber::setup(QDomNode node) { // Number of digits setNumDigits(selectNodeInt(node, "NumberOfDigits")); // Colors QPalette palette = m_pLabel->palette(); //we have to copy out the palette to edit it since it's const (probably for threadsafety) if (!WWidget::selectNode(node, "BgColor").isNull()) { m_qBgColor.setNamedColor(WWidget::selectNodeQString(node, "BgColor")); palette.setColor(this->backgroundRole(), WSkinColor::getCorrectColor(m_qBgColor)); m_pLabel->setAutoFillBackground(true); } m_qFgColor.setNamedColor(WWidget::selectNodeQString(node, "FgColor")); palette.setColor(this->foregroundRole(), WSkinColor::getCorrectColor(m_qFgColor)); m_pLabel->setPalette(palette); // Text if (!selectNode(node, "Text").isNull()) m_qsText = selectNodeQString(node, "Text"); // FWI: Begin of font size patch if (!selectNode(node, "FontSize").isNull()) { int fontsize = 9; fontsize = selectNodeQString(node, "FontSize").toInt(); m_pLabel->setFont( QFont("Helvetica",fontsize,QFont::Normal) ); } // FWI: End of font size patch // Alignment if (!selectNode(node, "Alignment").isNull()) { if (selectNodeQString(node, "Alignment")=="right") m_pLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter); // FWI: Begin of font alignment patch else if (selectNodeQString(node, "Alignment")=="center") m_pLabel->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter); // FWI: End of font alignment patch } // Constant factor if (!selectNode(node, "ConstFactor").isNull()) { m_dConstFactor = selectNodeQString(node, "ConstFactor").toDouble(); setValue(0.); } }