Пример #1
0
/*!
  Draw the border of the plot canvas

  \param painter Painter
  \sa setBorderRadius()
*/
void QwtPlotCanvas::drawBorder( QPainter *painter )
{
    if ( d_data->borderRadius > 0 )
    {
        if ( frameWidth() > 0 )
        {
            QwtPainter::drawRoundedFrame( painter, QRectF( frameRect() ), 
                d_data->borderRadius, d_data->borderRadius,
                palette(), frameWidth(), frameStyle() );
        }
    }
    else
    {
#if QT_VERSION >= 0x040500
#if QT_VERSION < 0x050000
        QStyleOptionFrameV3 opt;
#else
        QStyleOptionFrame opt;
#endif
        opt.init(this);

        int frameShape  = frameStyle() & QFrame::Shape_Mask;
        int frameShadow = frameStyle() & QFrame::Shadow_Mask;

        opt.frameShape = QFrame::Shape( int( opt.frameShape ) | frameShape );
#if 0
        opt.rect = frameRect();
#endif

        switch (frameShape) 
        {
            case QFrame::Box:
            case QFrame::HLine:
            case QFrame::VLine:
            case QFrame::StyledPanel:
            case QFrame::Panel:
            {
                opt.lineWidth = lineWidth();
                opt.midLineWidth = midLineWidth();
                break; 
            }
            default: 
            {
                opt.lineWidth = frameWidth();
                break;
            }
        }
    
        if ( frameShadow == Sunken )
            opt.state |= QStyle::State_Sunken;
        else if ( frameShadow == Raised )
            opt.state |= QStyle::State_Raised;

        style()->drawControl(QStyle::CE_ShapedFrame, &opt, painter, this);
#else
        drawFrame( painter );
#endif
    }
}
Пример #2
0
QSize KSeparator::sizeHint() const
{
    if ( frameStyle() & VLine )
        return QSize( 2, 0 );

    if ( frameStyle() & HLine )
        return QSize( 0, 2 );

    return QSize( -1, -1 );
}
Пример #3
0
int KSeparator::orientation() const
{
    if ( frameStyle() & VLine )
        return VLine;

    if ( frameStyle() & HLine )
        return HLine;

    return 0;
}
Пример #4
0
void VCFrame::parseWidgetMenu(int item)
{
  switch (item)
    {
    case KVCMenuEditProperties:
      {
	VCFrameProperties* vcfp = new VCFrameProperties(this);
	vcfp->init();
	if (vcfp->exec() == QDialog::Accepted)
	  {
	    _app->doc()->setModified(true);
	  }

	delete vcfp;
      }
      break;

    case KVCMenuBackgroundFrame:
      {
	if (frameStyle() & KFrameStyle)
	  {
	    setFrameStyle(NoFrame);
	  }
	else
	  {
	    setFrameStyle(KFrameStyle);
	  }
	_app->doc()->setModified(true);
      }
      break;

    default:
      break;
    }
}
Пример #5
0
void KMenuBar::setTopLevelMenuInternal(bool top_level)
{
    if(d->forcedTopLevel)
        top_level = true;

    d->wasTopLevel = top_level;
    if(parentWidget() && parentWidget()->topLevelWidget()->isFullScreen())
        top_level = false;

    if(isTopLevelMenu() == top_level)
        return;
    d->topLevel = top_level;
    if(isTopLevelMenu())
    {
#ifdef Q_WS_X11
        d->selection = new KSelectionWatcher(KMenuBarPrivate::makeSelectionAtom(), DefaultScreen(qt_xdisplay()));
        connect(d->selection, SIGNAL(newOwner(Window)), this, SLOT(updateFallbackSize()));
        connect(d->selection, SIGNAL(lostOwner()), this, SLOT(updateFallbackSize()));
#endif
        d->frameStyle = frameStyle();
        d->lineWidth = lineWidth();
        d->margin = margin();
        d->fallback_mode = false;
        bool wasShown = !isHidden();
        reparent(parentWidget(), WType_TopLevel | WStyle_Tool | WStyle_Customize | WStyle_NoBorder, QPoint(0, 0), false);
#ifdef Q_WS_X11
        KWin::setType(winId(), NET::TopMenu);
        if(parentWidget())
            XSetTransientForHint(qt_xdisplay(), winId(), parentWidget()->topLevelWidget()->winId());
#endif
        QMenuBar::setFrameStyle(NoFrame);
        QMenuBar::setLineWidth(0);
        QMenuBar::setMargin(0);
        updateFallbackSize();
        d->min_size = QSize(0, 0);
        if(parentWidget() && !parentWidget()->isTopLevel())
            setShown(parentWidget()->isVisible());
        else if(wasShown)
            show();
    }
    else
    {
#ifdef Q_WS_X11
        delete d->selection;
        d->selection = NULL;
#endif
        setBackgroundMode(PaletteButton);
        setFrameStyle(d->frameStyle);
        setLineWidth(d->lineWidth);
        setMargin(d->margin);
        setMinimumSize(0, 0);
        setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
        updateMenuBarSize();
        if(parentWidget())
            reparent(parentWidget(), QPoint(0, 0), !isHidden());
    }
}
Пример #6
0
void HGView::setFrameStyle(QSharedPointer<HFrameStyle> style)
{
    Q_D(HGView);

   QSharedPointer<HFrameStyle> oldStyle = frameStyle();
    if (oldStyle == style)
        return ;

    d->mFrameStyle = style;

    d->initStyle(HSTYLE);
}
Пример #7
0
void TreeIndicator::paintEvent(QPaintEvent*)
{
    QStyleOptionFrame frame;
    frame.init(this);
    int frameShape  = frameStyle() & QFrame::Shape_Mask;
    int frameShadow = frameStyle() & QFrame::Shadow_Mask;
    frame.frameShape = Shape(int(frame.frameShape) | frameShape);
    frame.rect = frameRect();
    switch (frameShape) {
        case QFrame::Box:
        case QFrame::HLine:
        case QFrame::VLine:
        case QFrame::StyledPanel:
        case QFrame::Panel:
            frame.lineWidth = lineWidth();
            frame.midLineWidth = midLineWidth();
            break;
        default:
            frame.lineWidth = frameWidth();
            break;
    }
    if (frameShadow == Sunken)
        frame.state |= QStyle::State_Sunken;
    else if (frameShadow == Raised)
        frame.state |= QStyle::State_Raised;
    frame.state |= d.state;

    if (d.lag > 0 && d.state == QStyle::State_None) {
        qreal f = qMin(100.0, qSqrt(d.lag)) / 100;
        QColor color = QColor::fromHsl(120 - f * 120, 96, 152); // TODO
        setStyleSheet(QString("background-color:%1").arg(color.name()));
    } else {
        setStyleSheet(QString());
    }

    QStylePainter painter(this);
    painter.drawPrimitive(QStyle::PE_Widget, frame);
    painter.drawControl(QStyle::CE_ShapedFrame, frame);
}
/*!
  Draw the border of the plot canvas

  \param painter Painter
  \sa setBorderRadius(), QFrame::drawFrame()
*/
void QwtPlotCanvas::drawBorder( QPainter *painter )
{
    if ( d_data->borderRadius > 0 )
    {
        if ( frameWidth() > 0 )
        {
            QwtPainter::drawRoundedFrame( painter, QRectF( rect() ), 
                d_data->borderRadius, d_data->borderRadius,
                palette(), frameWidth(), frameStyle() );
        }
    }
    else
    {
        drawFrame( painter );
    }
}
Пример #9
0
void FormatTextEdit::setEditable(bool editable)
{
    // save default frame style
    static int framed = frameStyle();
    static Qt::FocusPolicy defaultFocus = focusPolicy();

    if (editable) {
        setFrameStyle(framed);
        setFocusPolicy(defaultFocus);
    } else {
        setFrameStyle(QFrame::NoFrame | QFrame::Plain);
        setFocusPolicy(Qt::NoFocus);
    }

    setReadOnly(!editable);
}
Пример #10
0
void KSeparator::drawFrame( QPainter *p )
{
    QPoint p1, p2;
    QRect r = frameRect();
    const QColorGroup & g = colorGroup();

    if ( frameStyle() & HLine )
    {
        p1 = QPoint( r.x(), r.height() / 2 );
        p2 = QPoint( r.x() + r.width(), p1.y() );
    }
    else
    {
        p1 = QPoint( r.x() + r.width() / 2, 0 );
        p2 = QPoint( p1.x(), r.height() );
    }

    QStyleOption opt( lineWidth(), midLineWidth() );
    style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g,
                           QStyle::Style_Sunken, opt );
}
Пример #11
0
void MplVideoWidget::setFullScreen(bool on)
{
    if (on)
    {
        setWindowFlags(windowFlags() | Qt::Window);
        m_normalFrameStyle = frameStyle();
        setFrameStyle(QFrame::NoFrame);
        showFullScreen();
    }
    else
    {
        setWindowFlags(windowFlags() & ~Qt::Window);
        setFrameStyle(m_normalFrameStyle);
        showNormal();
        //update();
    }

    QSettings settings;
    if (settings.value(QLatin1String("ui/disableScreensaver/onFullscreen")).toBool())
        bcApp->setScreensaverInhibited(on);
}
Пример #12
0
void PageView::setFullScreenMode(bool fullScreen)
{
  this -> fullScreen = fullScreen;
  if (fullScreen == true) 
  {
    setVScrollBarMode(QScrollView::AlwaysOff);
    setHScrollBarMode(QScrollView::AlwaysOff);
    oldFrameStyle = frameStyle();
    setFrameStyle(QFrame::NoFrame);
    backgroundColor = viewport()->paletteBackgroundColor();
    if (singlePageFullScreenMode())
    {
      viewport()->setPaletteBackgroundColor( Qt::black ) ;
    }
  }
  else
  {
    viewport()->setPaletteBackgroundColor( backgroundColor ) ;
    setFrameStyle(oldFrameStyle);
  }
}
Пример #13
0
void VCLabel::parseWidgetMenu(int item)
{
  switch (item)
    {
    case KVCMenuBackgroundFrame:
      {
	if (frameStyle() & KFrameStyle)
	  {
	    setFrameStyle(NoFrame);
	  }
	else
	  {
	    setFrameStyle(KFrameStyle);
	  }
	_app->doc()->setModified(true);
      }
      break;

    default:
      break;
    }
}
Пример #14
0
//!
//! Toggles the display of tool bars in the panel frame.
//!
//! \param visible Flag to control whether to display tool bars in the panel frame.
//!
void PanelFrame::toggleToolBars ( bool visible )
{
    if (visible) {
        //ui_vboxLayout->removeItem(ui_hboxLayout);
		ui_vboxLayout->insertLayout(0, ui_hboxLayout);
        ui_vboxLayout->setSpacing(0);
        ui_vboxLayout->setMargin(0);
        setFrameStyle(0);
        m_mainToolBar->show();
        m_panelToolBar->show();
        ui_panelTypeComboBox->show();
    } else {
        ui_vboxLayout->removeItem(ui_hboxLayout);
        ui_hboxLayout->setParent(0);
        m_mainToolBar->hide();
        m_panelToolBar->hide();
        ui_panelTypeComboBox->hide();
        ui_vboxLayout->setSpacing(0);
        ui_vboxLayout->setMargin(0);
        int frameSyle = frameStyle();
        setFrameStyle(0);

    }
}
Пример #15
0
void VCLabel::saveToFile(QFile& file, unsigned int parentID)
{
  QString s;
  QString t;

  // Comment
  s = QString("# Virtual Console Label Entry\n");
  file.writeBlock((const char*) s, s.length());

  // Entry type
  s = QString("Entry = Label") + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Name
  s = QString("Name = ") + caption() + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Parent ID
  t.setNum(parentID);
  s = QString("Parent = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // X
  t.setNum(x());
  s = QString("X = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Y
  t.setNum(y());
  s = QString("Y = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // W
  t.setNum(width());
  s = QString("Width = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // H
  t.setNum(height());
  s = QString("Height = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Text color
  if (ownPalette())
    {
      t.setNum(qRgb(paletteForegroundColor().red(),
		    paletteForegroundColor().green(),
		    paletteForegroundColor().blue()));
      s = QString("Textcolor = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());

      // Background color
      t.setNum(qRgb(paletteBackgroundColor().red(),
		    paletteBackgroundColor().green(),
		    paletteBackgroundColor().blue()));
      s = QString("Backgroundcolor = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());
    }

  // Background pixmap
  if (paletteBackgroundPixmap())
    {
      s = QString("Pixmap = " + iconText() + QString("\n"));
      file.writeBlock((const char*) s, s.length());
    }

  // Font
  s = QString("Font = ") + font().toString() + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Frame
  if (frameStyle() & KFrameStyle)
    {
      s = QString("Frame = ") + Settings::trueValue() + QString("\n");
    }
  else
    {
      s = QString("Frame = ") + Settings::falseValue() + QString("\n");
    }
  file.writeBlock((const char*) s, s.length());
}
Пример #16
0
/*!
  \return Frame width depending on the style, line width and midline width.
 */
int QwtPlotGLCanvas::frameWidth() const
{
    return ( frameStyle() != NoFrame ) ? d_data->lineWidth : 0;
}
Пример #17
0
void VCFrame::saveFramesToFile(QFile& file, t_vc_id parentID)
{
  QString s;
  QString t;

  // Comment
  s = QString("# Virtual Console Frame Entry\n");
  file.writeBlock((const char*) s, s.length());

  // Entry type
  s = QString("Entry = Frame") + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Name
  s = QString("Name = ") + caption() + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Parent ID
  if (parentID != 0)
    {
      t.setNum(parentID);
      s = QString("Parent = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());
    }

  // Geometry
  if (m_bottomFrame == false)
    {
      // X
      t.setNum(x());
      s = QString("X = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());
      
      // Y
      t.setNum(y());
      s = QString("Y = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());
      
      // W
      t.setNum(width());
      s = QString("Width = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());
      
      // H
      t.setNum(height());
      s = QString("Height = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());
    }

  // Palette
  if (ownPalette())
    {
      // Text color
      t.setNum(qRgb(paletteForegroundColor().red(),
		    paletteForegroundColor().green(),
		    paletteForegroundColor().blue()));
      s = QString("Textcolor = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());

      // Background color
      t.setNum(qRgb(paletteBackgroundColor().red(),
		    paletteBackgroundColor().green(),
		    paletteBackgroundColor().blue()));
      s = QString("Backgroundcolor = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());
    }

  // Background pixmap
  if (paletteBackgroundPixmap())
    {
      s = QString("Pixmap = " + iconText() + QString("\n"));
      file.writeBlock((const char*) s, s.length());
    }

  // Font
  s = QString("Font = ") + font().toString() + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Frame
  if (frameStyle() & KFrameStyle)
    {
      s = QString("Frame = ") + Settings::trueValue() + QString("\n");
    }
  else
    {
      s = QString("Frame = ") + Settings::falseValue() + QString("\n");
    }
  file.writeBlock((const char*) s, s.length());

  // Button Behaviour
  t.setNum(m_buttonBehaviour);
  s = QString("ButtonBehaviour = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // ID
  t.setNum(id());
  s = QString("ID = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  if (children() != NULL)
    {
      QObjectList* ol = (QObjectList*) children();
      QObjectListIt it(*ol);
      
      // Child frames
      for (; it.current() != NULL; ++it)
	{
	  if (QString(it.current()->className()) == QString("VCFrame"))
	    {
	      VCFrame* w = (VCFrame*) it.current();
	      w->saveFramesToFile(file, id());
	    }
	}
    }
}
Пример #18
0
//
// Save settings to file
//
void VCDockSlider::saveToFile(QFile &file, t_vc_id parentID)
{
  QString s;
  QString t;
  
  // Comment
  s = QString("# Virtual Console Slider Entry\n");
  file.writeBlock((const char*) s, s.length());

  // Entry type
  s = QString("Entry = Slider") + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Name
  s = QString("Name = ") + caption() + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Parent ID
  t.setNum(parentID);
  s = QString("Parent = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // X
  t.setNum(x());
  s = QString("X = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Y
  t.setNum(y());
  s = QString("Y = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // W
  t.setNum(width());
  s = QString("Width = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // H
  t.setNum(height());
  s = QString("Height = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Text color
  if (ownPalette())
    {
      t.setNum(qRgb(paletteForegroundColor().red(),
		    paletteForegroundColor().green(),
		    paletteForegroundColor().blue()));
      s = QString("Textcolor = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());
      
      t.setNum(qRgb(paletteBackgroundColor().red(),
		    paletteBackgroundColor().green(),
		    paletteBackgroundColor().blue()));
      s = QString("Backgroundcolor = ") + t + QString("\n");
      file.writeBlock((const char*) s, s.length());
    }

  // Background pixmap
  if (paletteBackgroundPixmap())
    {
      s = QString("Pixmap = " + iconText() + QString("\n"));
      file.writeBlock((const char*) s, s.length());
    }

  // Frame
  if (frameStyle() & KFrameStyle)
    {
      s = QString("Frame = ") + Settings::trueValue() + QString("\n");
    }
  else
    {
      s = QString("Frame = ") + Settings::falseValue() + QString("\n");
    }
  file.writeBlock((const char*) s, s.length());

  // Font
  s = QString("Font = ") + font().toString() + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Bus
  t.setNum(m_busID);
  s = QString("Bus = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Bus Lo
  t.setNum(m_busLowLimit);
  s = QString("BusLowLimit = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Bus Hi
  t.setNum(m_busHighLimit);
  s = QString("BusHighLimit = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Channels
  if (m_channels.count())
    {
      s = QString("Channels = ");
      QValueList<t_channel>::Iterator it;
      for (it = m_channels.begin(); it != m_channels.end(); ++it)
	{
	  t.sprintf("%.3d", *it);
	  s += t + QString(" ");
	}

      s += QString("\n");
      file.writeBlock((const char*) s, s.length());      
    }

  // Level Lo
  t.setNum(m_levelLowLimit);
  s = QString("LevelLowLimit = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Level Hi
  t.setNum(m_levelHighLimit);
  s = QString("LevelHighLimit = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Mode (must be written after bus & channel settings)
  s = QString("Mode = ") + modeString(m_mode) + QString("\n");
  file.writeBlock((const char*) s, s.length());

  // Value
  t.setNum(m_slider->value());
  s = QString("Value = ") + t + QString("\n");
  file.writeBlock((const char*) s, s.length());
}
Пример #19
0
Qt::Orientation TSeparator::orientation() const
{
   return (frameStyle() & VLine) ? Qt::Vertical : Qt::Horizontal;
}
Пример #20
0
/*!
  \return Frame width depending on the style, line width and midline width.
 */
int QwtPlotAbstractGLCanvas::frameWidth() const
{
    return ( frameStyle() != QFrame::NoFrame ) ? d_data->lineWidth : 0;
}
Пример #21
0
void Frame::drawFrame(QPainter *p)
{
    QPoint p1, p2;
    QStyleOptionFrame opt;
    opt.init(this);
    if ( hasFocus() ) {
        opt.state |= QStyle::State_HasFocus;
    }
    int frameShape  = frameStyle() & QFrame::Shape_Mask;
    int frameShadow = frameStyle() & QFrame::Shadow_Mask;

    int lw = 0;
    int mlw = 0;
    opt.rect = frameRect();
    switch (frameShape) {
        case QFrame::Box:
        case QFrame::HLine:
        case QFrame::VLine:
        case QFrame::StyledPanel:
            lw = lineWidth();
            mlw = midLineWidth();
            break;
        default:
            // most frame styles do not handle customized line and midline widths
            // (see updateFrameWidth()).
            lw = frameWidth();
            break;
    }
    opt.lineWidth = lw;
    opt.midLineWidth = mlw;
    if (frameShadow == Sunken)
        opt.state |= QStyle::State_Sunken;
    else if (frameShadow == Raised)
        opt.state |= QStyle::State_Raised;

    switch (frameShape) {
        case Box:
            if (frameShadow == Plain)
                qDrawPlainRect(p, opt.rect, opt.palette.foreground().color(), lw);
            else
                qDrawShadeRect(p, opt.rect, opt.palette, frameShadow == Sunken, lw, mlw);
            break;


        case StyledPanel:
            style()->drawPrimitive(QStyle::PE_Frame, &opt, p, this);
            break;

        case Panel:
            if (frameShadow == Plain)
                qDrawPlainRect(p, opt.rect, opt.palette.foreground().color(), lw);
            else
                qDrawShadePanel(p, opt.rect, opt.palette, frameShadow == Sunken, lw);
            break;

        case WinPanel:
            if (frameShadow == Plain)
                qDrawPlainRect(p, opt.rect, opt.palette.foreground().color(), lw);
            else
                qDrawWinPanel(p, opt.rect, opt.palette, frameShadow == Sunken);
            break;
        case HLine:
        case VLine:
            if (frameShape == HLine) {
                p1 = QPoint(opt.rect.x(), opt.rect.height() / 2);
                p2 = QPoint(opt.rect.x() + opt.rect.width(), p1.y());
            } else {
                p1 = QPoint(opt.rect.x()+opt.rect.width() / 2, 0);
                p2 = QPoint(p1.x(), opt.rect.height());
            }
            if (frameShadow == Plain) {
                QPen oldPen = p->pen();
                p->setPen(QPen(opt.palette.foreground().color(), lw));
                p->drawLine(p1, p2);
                p->setPen(oldPen);
            } else {
                qDrawShadeLine(p, p1, p2, opt.palette, frameShadow == Sunken, lw, mlw);
            }
            break;
    }
}
Пример #22
0
bool VCWidget::saveXMLAppearance(QDomDocument* doc, QDomElement* frame_root)
{
	QDomElement root;
	QDomElement tag;
	QDomText text;
	QString str;

	Q_ASSERT(doc != NULL);
	Q_ASSERT(frame_root != NULL);

	/* VC Label entry */
	root = doc->createElement(KXMLQLCVCWidgetAppearance);
	frame_root->appendChild(root);

	/* Frame style */
	tag = doc->createElement(KXMLQLCVCWidgetFrameStyle);
	root.appendChild(tag);
	text = doc->createTextNode(frameStyleToString(frameStyle()));
	tag.appendChild(text);

	/* Foreground color */
	tag = doc->createElement(KXMLQLCVCWidgetForegroundColor);
	root.appendChild(tag);
	if (hasCustomForegroundColor() == true)
		str.setNum(paletteForegroundColor().rgb());
	else
		str = KXMLQLCVCWidgetColorDefault;
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Background color */
	tag = doc->createElement(KXMLQLCVCWidgetBackgroundColor);
	root.appendChild(tag);
	if (hasCustomBackgroundColor() == true)
		str.setNum(paletteBackgroundColor().rgb());
	else
		str = KXMLQLCVCWidgetColorDefault;
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Background image */
	tag = doc->createElement(KXMLQLCVCWidgetBackgroundImage);
	root.appendChild(tag);
	if (backgroundImage() != QString::null)
		str = m_backgroundImage;
	else
		str = KXMLQLCVCWidgetBackgroundImageNone;
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Font */
	tag = doc->createElement(KXMLQLCVCWidgetFont);
	root.appendChild(tag);
	if (hasCustomFont() == true)
		str = font().toString();
	else
		str = KXMLQLCVCWidgetFontDefault;
	text = doc->createTextNode(str);
	tag.appendChild(text);	

	return true;
}