Ejemplo n.º 1
0
void 
create_fgbz_chunk(IFFByteStream &iff)
{
  int nzones = g().colorzones.size();
  int npalette = g().colorpalette->size() / 3;
  GP<DjVuPalette> pal = DjVuPalette::create();
  g().colorpalette->seek(0);
  pal->decode_rgb_entries(*g().colorpalette, npalette);
  pal->colordata.resize(0,blit_count-1);
  for (int d=0; d<blit_count; d++)
    {
      JB2Blit *blit = g().stencil->get_blit(d);
      const JB2Shape &shape = g().stencil->get_shape(blit->shapeno);
      GRect brect(blit->left, blit->bottom, shape.bits->columns(), shape.bits->rows());
      int index = nzones;
      for (int i=0; i<nzones; i++)
        {
          GRect zrect = g().colorzones[i];
          if (zrect.isempty() || zrect.intersect(brect, zrect))
            index = i;
        }
      if (index >= npalette)
        G_THROW("create_fgbz_chunk: internal error");
      pal->colordata[d] = index;
    }
  iff.put_chunk("FGbz");
  pal->encode(iff.get_bytestream());
  iff.close_chunk();
}
Ejemplo n.º 2
0
/*!
    \fn void QDecorationDefault::paintButton(QPainter *painter, const
    QWidget *widget, int buttonRegion, DecorationState state,
    const QPalette &palette)

    Paints a region of the top-level \a widget. The region is
    painted in the specified decoration \a state using the
    \a painter and \a palette provided. The region to be painted is specified
    by \a buttonRegion, which is a combination of the bitmask values of
    DecorationRegion. If the value of \a buttonRegion is one of \e Help,
    \e Menu, \e Close, \e Minimize, \e Maximize, and \e Normalize, the
    button pixmap for that region is painted.

    \sa pixmapFor()
 */
void QDecorationDefault::paintButton(QPainter *painter,
                                     const QWidget *widget,
                                     int buttonRegion,
                                     DecorationState state,
                                     const QPalette &pal)
{
    int xoff = 2;
    int yoff = 2;

    const QPixmap pm = pixmapFor(widget, buttonRegion, xoff, yoff);
    QRect brect(QDecoration::region(widget, buttonRegion).boundingRect());
    bool porterDuff = painter->paintEngine()->hasFeature(QPaintEngine::PorterDuff);

    if (state & QDecoration::Pressed) {
        if (porterDuff)
            painter->setCompositionMode(QPainter::CompositionMode_Source);
        qDrawWinPanel(painter, brect, pal, true, &pal.brush(QPalette::Window));
        if (porterDuff)
            painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
        ++xoff;
        ++yoff;
    } else {
        painter->fillRect(brect, pal.brush(QPalette::Window));
    }

    if (!pm.isNull())
        painter->drawPixmap(brect.x() + xoff, brect.y() + yoff, pm);
}
Ejemplo n.º 3
0
void create_vga_font(void)
{
  int32 bitslength;
  int32 bytesperrow;
  unsigned char *data;
  BRect brect(0,0, 7,15);

  BX_INFO(("BeOS: creating VGA font from bitmaps"));

  // VGA font is 8wide x 16high
  for (unsigned c=0; c<256; c++) {
    vgafont[c] = new BBitmap(brect, B_MONOCHROME_1_BIT);
    if (!vgafont[c]) {
      BX_PANIC(("beos: could not create bitmap"));
    }

    bitslength = vgafont[c]->BitsLength();
    bytesperrow = vgafont[c]->BytesPerRow();
    data = (unsigned char *) vgafont[c]->Bits();
    memset(data, 0, bitslength);
    for (unsigned i=0; i<16; i++) {
      data[i*bytesperrow] = reverse_bitorder(bx_vgafont[c].data[i]);
    }
  }
}
static void
_cairo_beos_surface_fill_rectangle (cairo_beos_surface_t	*surface,
				    cairo_rectangle_int16_t	*rect)
{
    BRect brect(_cairo_rect_to_brect(rect));
    surface->view->FillRect(brect);
}
Ejemplo n.º 5
0
status_t ConvertToAMessage(const Message & from, os::Message & to) 
{
   to.MakeEmpty();
   to.SetCode(from.what);

   uint32 type;
   uint32 count;
   bool fixedSize;

   for (MessageFieldNameIterator it = from.GetFieldNameIterator(B_ANY_TYPE, HTIT_FLAG_NOREGISTER); it.HasData(); it++)
   {
      const String & n = it.GetFieldName();
      if (from.GetInfo(n, &type, &count, &fixedSize) != B_NO_ERROR) return B_ERROR;

      for (uint32 j=0; j<count; j++)
      {
         const void * nextItem;
         uint32 itemSize;
         if (from.FindData(n, type, j, &nextItem, &itemSize) != B_NO_ERROR) return B_ERROR;

         // do any necessary translation from the Muscle data types to Be data types
         switch(type)
         {
            case B_POINT_TYPE:
            {
               const Point * p = static_cast<const Point *>(nextItem);
               os::Point bpoint(p->x(), p->y());
               if (to.AddPoint(n, bpoint) != B_NO_ERROR) return B_ERROR;
            }
            break;

            case B_RECT_TYPE:
            {
               const Rect * r = static_cast<const Rect *>(nextItem);
               os::Rect brect(r->left(), r->top(), r->right(), r->bottom());
               if (to.AddRect(n, brect) != B_NO_ERROR) return B_ERROR;
            }
            break;
 
            case B_MESSAGE_TYPE:
            {
               const MessageRef * msgRef = static_cast<const MessageRef *>(nextItem);
               os::Message amsg;
               if (msgRef->GetItemPointer() == NULL) return B_ERROR;
               if (ConvertToAMessage(*msgRef->GetItemPointer(), amsg) != B_NO_ERROR) return B_ERROR;
               if (to.AddMessage(n, &amsg) != B_NO_ERROR) return B_ERROR;
            }
            break;

            default:
               if (to.AddData(n, type, nextItem, itemSize, fixedSize, count) != B_NO_ERROR) return B_ERROR;
            break;
         }
      }
   }
   return B_NO_ERROR;
}
Ejemplo n.º 6
0
// assumes cells correctly adjacent...
void drawdomino(long n1,long n2,long c)
{
float x1,y1,x2,y2;
long ix1,iy1,ix2,iy2,i1,j1,i2,j2;
long nn;

if(n1-n2 == 1)	// for correct graphics outline...
	{
	nn = n1;
	n1 = n2;
	n2 = nn;
	}
if(n1-n2 == -ROWL)
	{
	nn = n1;
	n1 = n2;
	n2 = nn;
	}
i1 = n1%ROWL;
j1 = n1/ROWL;
x1 = i1 * CELLSZ - 1.5;
y1 = j1 * CELLSZ - 1.0;
x1 -= gl_oleft;
x1 *= gl_oxfact;
ix1 = x1;
y1 -= gl_otop;
y1 *= gl_oyfact;
iy1 = y1 - YDISP;
i2 = n2%ROWL;
j2 = n2/ROWL;
x2 = i2 * CELLSZ - 1.5;
y2 = j2 * CELLSZ - 1.0;
x2 -= gl_oleft;
x2 *= gl_oxfact;
ix2 = x2;
y2 -= gl_otop;
y2 *= gl_oyfact;
iy2 = y2 - YDISP;
//if(c == 0)
//	color(RED);
//else
//	color(BLUE);
color(c);
//gl_rect(ix1+SZ1,iy1+SZ1,ix1+SZ2,iy1+SZ2);
//gl_rect(ix2+SZ1,iy2+SZ1,ix2+SZ2,iy2+SZ2);
brectf(ix1+SZ1,iy1+SZ1,ix2+SZ2,iy2+SZ2);
color(BLACK);
brect(ix1+SZ1,iy1+SZ1,ix2+SZ2,iy2+SZ2);
}
void QWSWindowsDecoration::paintButton(QPainter *painter, const QWidget *w,
			QWSDecoration::Region type, int state)
{
#ifndef QT_NO_PALETTE
    const QColorGroup &cg = QApplication::palette().active();
//    const QColorGroup &cg = w->palette().active();
    QRect brect(region(w, w->rect(), type).boundingRect());
    int xoff=2;
    int yoff=2;
    const QPixmap *pm=pixmapFor(w,type,state & QWSButton::On, xoff, yoff);
    if ((state & QWSButton::MouseOver) && (state & QWSButton::Clicked))
	xoff++, yoff++;
    if (type != Menu)
	painter->fillRect(brect.x()+xoff+1, brect.y()+yoff, 16, 15, cg.brush(QColorGroup::Background));
    if (pm) painter->drawPixmap(brect.x()+xoff+1, brect.y()+yoff, *pm);
#endif
}
Ejemplo n.º 8
0
void QDecorationWindows::paintButton(QPainter *painter, const QWidget *widget, int buttonRegion,
                                     DecorationState state, const QPalette &pal)
{
    QBrush fromBrush, toBrush;
    QPen   titlePen;

    if (widget == qApp->activeWindow() || qApp->activeWindow() == qApp->activePopupWidget()) {
        fromBrush = pal.brush(QPalette::Highlight);
        titlePen  = pal.color(QPalette::HighlightedText);
    } else {
        fromBrush = pal.brush(QPalette::Window);
        titlePen  = pal.color(QPalette::Text);
    }
    toBrush = fromBrush.color().lighter(300);

    QRect brect(QDecoration::region(widget, buttonRegion).boundingRect());
    if (buttonRegion != Close && buttonRegion != Menu)
        painter->fillRect(brect, toBrush);
    else
        painter->fillRect(brect.x() - 2, brect.y(), brect.width() + 4, brect.height(),
                          buttonRegion == Menu ? fromBrush : toBrush);

    int xoff = 1;
    int yoff = 2;
    const QPixmap pm = pixmapFor(widget, buttonRegion, xoff, yoff);
    if (buttonRegion != Menu) {
        if (state & Normal) {
            qDrawWinPanel(painter, brect.x(), brect.y() + 2, brect.width(),
                          brect.height() - 4, pal, false, &pal.brush(QPalette::Window));
        } else if (state & Pressed) {
            qDrawWinPanel(painter, brect.x(), brect.y() + 2, brect.width(),
                          brect.height() - 4, pal, true, &pal.brush(QPalette::Window));
            ++xoff;
            ++yoff;
        }
    } else {
        xoff = 0;
        yoff = 2;
    }

    if (!pm.isNull())
        painter->drawPixmap(brect.x() + xoff, brect.y() + yoff, pm);
}
bool RenderThemeSymbian::paintMenuListButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{          
    if (!m_selectArrow) {
        m_selectArrow = Image::loadPlatformResource("selectArrow");
    }
    IntSize s = m_selectArrow->size();

    // draw the bounding area
    i.context->save();
    //i.context->setPen(Pen(Color::black,1));
    i.context->setFillColor(Color::lightGray);
    
    IntRect brect(r.x() + r.width() - s.width(), r.y(), s.width(), r.height() - 3 );
    i.context->drawRect(r);
    paintButtonDecorations(o, i, r);

    // draw the arrow 
    int y = (r.height() - s.height())/2 + r.y();
    IntRect arrowRect(IntPoint(r.x() + r.width() - s.width(), y), s);
    MScrollView* wv = scrollView(i);
    // don't scale the checkbox if scalingFactor is 100% or  we are in the process of scaling another image
    if (wv->scalingFactor() <= 100  || m_bitmapScaler) {
        i.context->drawImage(m_selectArrow, arrowRect);
    }
    // use the cached scaled image if it has the same scaling factor
    else if (wv->scalingFactor() == (m_scalingForSelectArrow)) {
        i.context->drawImage(m_scaledSelectArrow, arrowRect);
    }
    // scale
    else {
        scaleImage(ESelectArrow, wv->scalingFactor());
        if (wv->scalingFactor() == m_scalingForSelectArrow) {
            i.context->drawImage(m_scaledSelectArrow, arrowRect);
        }
        else {        
            i.context->drawImage(m_selectArrow, arrowRect);
        }
    }
    i.context->restore();
    return false;    
}
void QWSDefaultDecoration::paintButton(QPainter *painter, const QWidget *w,
			QWSDecoration::Region type, int state)
{
#ifndef QT_NO_PALETTE
#ifndef QT_NO_STYLE
    QStyle &style = QApplication::style();
#endif
    const QColorGroup &cg = w->palette().active();

    QRect brect(region(w, w->rect(), type).boundingRect());

    int xoff=2;
    int yoff=2;

    const QPixmap *pm=pixmapFor(w,type,state & QWSButton::On, xoff, yoff);

    {

	if ((state & QWSButton::MouseOver) && (state & QWSButton::Clicked)) {
#if !defined(QT_NO_STYLE)
	    style.drawToolButton(painter, brect.x(), brect.y(), brect.width()-1,
		        brect.height()-1, cg, TRUE,
			&cg.brush(QColorGroup::Background));
#elif !defined(QT_NO_DRAWUTIL)
	    qDrawWinPanel(painter, brect.x(), brect.y(), brect.width()-1,
			brect.height()-1, cg, TRUE,
			&cg.brush(QColorGroup::Background));
#endif	
	    if (pm) painter->drawPixmap(brect.x()+xoff+1, brect.y()+yoff+1, *pm);
	} else {
	    painter->fillRect(brect.x(), brect.y(), brect.width()-1,
			brect.height()-1, cg.brush(QColorGroup::Background));
	    if (pm) painter->drawPixmap(brect.x()+xoff, brect.y()+yoff, *pm);
	}
    }

#endif

}
Ejemplo n.º 11
0
// draws a single domino node
void drawnode(long n,long c)
{
float x1,y1,x2,y2;
long ix1,iy1,ix2,iy2,i1,j1,i2,j2;
//long nn;
long n1,n2;

n1 = n2 = n;
i1 = n1%ROWL;
j1 = n1/ROWL;
x1 = i1 * CELLSZ - 1.5;
y1 = j1 * CELLSZ - 1.0;
x1 -= gl_oleft;
x1 *= gl_oxfact;
ix1 = x1;
y1 -= gl_otop;
y1 *= gl_oyfact;
iy1 = y1 - YDISP;
i2 = n2%ROWL;
j2 = n2/ROWL;
x2 = i2 * CELLSZ - 1.5;
y2 = j2 * CELLSZ - 1.0;
x2 -= gl_oleft;
x2 *= gl_oxfact;
ix2 = x2;
y2 -= gl_otop;
y2 *= gl_oyfact;
iy2 = y2 - YDISP;

color(c);

//gl_rect(ix1+SZ1,iy1+SZ1,ix1+SZ2,iy1+SZ2);
//gl_rect(ix2+SZ1,iy2+SZ1,ix2+SZ2,iy2+SZ2);
brectf(ix1+SZ1,iy1+SZ1,ix2+SZ2,iy2+SZ2);
color(BLACK);
brect(ix1+SZ1,iy1+SZ1,ix2+SZ2,iy2+SZ2);
}
Ejemplo n.º 12
0
void qkeybutton::InitAllProperty(KeyBoardItem *pItem)
{
    if (pItem)//打开一个已有的位按钮
    {
        pCopyItem = pItem;
        pScene->clear();
        pScene->addItem(pCopyItem);
        pBaseItem = new QGroupItem(pCopyItem);
        pBaseItem->SetHeigth(100);
        pBaseItem->SetWidth(100);
        pASCIIInputgen->Init(pItem);//初始化一般页面
        pSecurityWight->init(pItem);
        oId = pItem->id();
        ui->spinBox->setValue(oId);
    }
    else//新建
    {
        pASCIIInputgen->Init(NULL);//初始化一般页面

        KeyInfo key;
        pASCIIInputgen->onGetinfo(key);

        KeyBoardItem *pGroupItem = new KeyBoardItem;
        QRectItem *pBackRect;
        QRectItem *pFramRect;
        QSimpleTextItem *pTextRect;

        QRectF brect(QPointF(5,5), QSize(90,90));
        pBackRect = new QRectItem(brect);
        //pQvalueColor->onGetValueBackColor(mColor);
        pBackRect->SetBackColor(key.nUpBackColor);
        pBackRect->SetLineType(0);
        pBackRect->setZValue(2);
        pBackRect->SetName(tr("mBackRect"));
        pBackRect->setFlag(QGraphicsItem::ItemIsSelectable, false);
        pBackRect->setFlag(QGraphicsItem::ItemIsMovable, false);

        QRectF frect(QPointF(0,0), QSize(100,100));
        pFramRect = new QRectItem(frect);
        pFramRect->SetBackColor(key.nUpFrameColor);
        pFramRect->SetLineType(0);
        pFramRect->setZValue(1);
        pFramRect->SetName(tr("mFramRect"));
        pFramRect->setFlag(QGraphicsItem::ItemIsSelectable, false);
        pFramRect->setFlag(QGraphicsItem::ItemIsMovable, false);

        QRectF mrect(QPointF(5,5), QSize(90,90));
        pTextRect = new QSimpleTextItem(mrect,key.sText);
        pTextRect->SetName("mText");
        pTextRect->SetRectOutLine(false);
        pTextRect->setZValue(5);
        pTextRect->setFlag(QGraphicsItem::ItemIsSelectable, false);
        pTextRect->SetFontColor(pASCIIInputgen->sColor);

        pGroupItem->addToGroup(pFramRect);
        pGroupItem->addToGroup(pBackRect);
        pGroupItem->addToGroup(pTextRect);

        pCopyItem = pGroupItem;
        pCopyItem->textItem = pTextRect;
        pCopyItem->pBackRect = pBackRect;
        pCopyItem->frameRect = pFramRect;
        pScene->clear();
        pScene->addItem(pCopyItem);
        pBaseItem = new QGroupItem(pCopyItem);
        pBaseItem->SetHeigth(100);
        pBaseItem->SetWidth(100);
        ui->spinBox->setValue(pwnd->getNewId());
    }
}
Ejemplo n.º 13
0
QPainterPath SPoint::shape() const
{
QPainterPath path;
	path.addEllipse(brect());
	return path;
}
Ejemplo n.º 14
0
void SPoint::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
{
    if(active)
	painter->drawEllipse(brect());
}
Ejemplo n.º 15
0
void drawdominocb(long n1,long n2,long c)
{
float x1,y1,x2,y2;
long ix1,iy1,ix2,iy2,i1,j1,i2,j2;
long nn;
#if 1
if(n1-n2 == 1)	// for correct graphics outline...
	{
	nn = n1;
	n1 = n2;
	n2 = nn;
	}
#endif
#if 1
if(n1-n2 == -ROWL)
	{
	nn = n1;
	n1 = n2;
	n2 = nn;
	}
#endif
// domino wrap-around...
// just skip for time bean...
// ok, now filling in with single squares.
if(n1-n2 == (ROWL-1)) goto cb;
if(n2-n1 == (ROWL-1)) goto cb;
if(n1-n2 == (NROWS-1)*ROWL) goto cb;
if(n2-n1 == (NROWS-1)*ROWL) goto cb;
i1 = n1%ROWL;
j1 = n1/ROWL;
x1 = i1 * CELLSZ - 1.5;
y1 = j1 * CELLSZ - 1.0;
x1 -= gl_oleft;
x1 *= gl_oxfact;
ix1 = x1;
y1 -= gl_otop;
y1 *= gl_oyfact;
iy1 = y1 - YDISP;
i2 = n2%ROWL;
j2 = n2/ROWL;
x2 = i2 * CELLSZ - 1.5;
y2 = j2 * CELLSZ - 1.0;
x2 -= gl_oleft;
x2 *= gl_oxfact;
ix2 = x2;
y2 -= gl_otop;
y2 *= gl_oyfact;
iy2 = y2 - YDISP;
//if(c == 0)
//	color(RED);
//else
//	color(BLUE);
color(c);
//gl_rect(ix1+SZ1,iy1+SZ1,ix1+SZ2,iy1+SZ2);
//gl_rect(ix2+SZ1,iy2+SZ1,ix2+SZ2,iy2+SZ2);
brectf(ix1+SZ1,iy1+SZ1,ix2+SZ2,iy2+SZ2);
color(BLACK);
brect(ix1+SZ1,iy1+SZ1,ix2+SZ2,iy2+SZ2);
return;
cb:
drawnode(n1,c);
drawnode(n2,c);
//nn = 3;		// dummy statement
//continue;
}
Ejemplo n.º 16
0
void QValueDlg::onDrawSence(QString sName)
{
    QString sText = "";
    QColor mColor(0,0,0);
    if(bInitFlag)//初始化完成后调用就是重画设置属性
    {
        if("FontColor" == sName)
        {
            pQvalueColor->onGetValueColor(mColor);
            pCopyItem->SetFontColor(mColor);
            //pBaseItem->SetPropertyValue("mText.FontColor",QVariant(nColor));
        }
        else if("BackColor" == sName)
        {
            pQvalueColor->onGetValueBackColor(mColor);
            pCopyItem->SetRectBackColor(mColor);
            //pBaseItem->SetPropertyValue("mBackRect.BackColor",QVariant(nColor));
        }
        else if("Text" == sName)
        {
            if(DATAINPUTSHOW == eDataType)
            {
                sText.clear();
                int nTotaldigit = pQvalueShow->onGetTotaldigit();
                for(int i = 0; i < nTotaldigit;i++)
                {
                    sText = sText + "8";
                }
                int nPoint = pQvalueShow->onGetDecimaldigit();
                if(nPoint > 0 && nPoint < nTotaldigit)
                {
                    sText.insert(nTotaldigit - nPoint,'.');
                }
                int nfontsize = pQvalueShow->onGetFontSize();
                QString sFont = pQvalueShow->onGetFont(eDataType);
                pBaseItem->SetPropertyValue("mText.Font",QVariant(sFont));
                pBaseItem->SetPropertyValue("mText.FontSize",QVariant(nfontsize));
            }
            else if(ASCIIINPUTSHOW == eDataType)
            {
                for(int i = 0; i <pQvalueShow->onGetTotaldigit(); i++)
                {
                    int nChar = i%26;
                    sText.insert(i,'A'+nChar);
                }
                int nfontsize = pQvalueShow->onGetFontSize();
                QString sFont = pQvalueShow->onGetFont(eDataType);
                pBaseItem->SetPropertyValue("mText.Font",QVariant(sFont));
                pBaseItem->SetPropertyValue("mText.FontSize",QVariant(nfontsize));
            }
            else if(DATETIMEINPUT == eDataType)
            {
                sText = pQvalueBace->onGetpreText();
                pCopyItem->SetTextAlign(5);
                QString sFont = pQvalueBace->onGetFontType();
                pBaseItem->SetPropertyValue("mText.Font",QVariant(sFont));
                int nfontsize = pQvalueBace->onGetFontSize();
                pBaseItem->SetPropertyValue("mText.FontSize",QVariant(nfontsize));
                //pBaseItem->SetPropertyValue("mText.Alignment",QVariant(5)); //居中对齐
            }
            pCopyItem->SetText(sText);
            //pBaseItem->SetPropertyValue("mText.Text",QVariant(sText));
        }
        else if("4" == sName)
        {
            if(pCopyItem)
            {
                pCopyItem->SetTextAlign(4);
            }
//            pBaseItem->SetPropertyValue("mText.Alignment",QVariant(4)); //左对齐
//            data_st.eShowStyle = LStart;
//            ascii_st.nShowStyle = LStart;
//            time_st.nShowStyle = LStart;
        }
        else if("5" == sName)
        {
            if(pCopyItem)
            {
                pCopyItem->SetTextAlign(5);
            }
//            pBaseItem->SetPropertyValue("mText.Alignment",QVariant(5)); //居中对齐
//            data_st.eShowStyle = CStart;
//            ascii_st.nShowStyle = CStart;
//            time_st.nShowStyle = CStart;
        }
        else if("6" == sName)
        {
            if(pCopyItem)
            {
                pCopyItem->SetTextAlign(6);
            }
//            pBaseItem->SetPropertyValue("mText.Alignment",QVariant(6)); //右对齐
//            data_st.eShowStyle = RStart;
//            ascii_st.nShowStyle = RStart;
//            time_st.nShowStyle = RStart;
        }
        else if("Font" == sName)
        {
            QString sFont = "";
            if(DATAINPUTSHOW == eDataType || ASCIIINPUTSHOW == eDataType)
            {
                sFont = pQvalueShow->onGetFont(eDataType);
            }
            else
            {
                sFont = pQvalueBace->onGetFontType();
            }
            pBaseItem->SetPropertyValue("mText.Font",QVariant(sFont));
        }
        else if("FontSize" == sName)
        {
            int nfontsize = 10;
            if(DATAINPUTSHOW == eDataType || ASCIIINPUTSHOW == eDataType)
            {
                nfontsize = pQvalueShow->onGetFontSize();
            }
            else
            {
                nfontsize = pQvalueBace->onGetFontSize();
            }
            pBaseItem->SetPropertyValue("mText.FontSize",QVariant(nfontsize));
        }
        else if("FontType" == sName)
        {
            onSetFontType();
        }
    }
    else
    {
        if("" != sName)
        {
            return;//非初始化进入直接返回
        }
        DataDisplayItem *pGroupItem = new DataDisplayItem;
        QRectItem *pBackRect;
        QRectItem *pFramRect;
        QSimpleTextItem *pTextRect;

        QRectF brect(QPointF(5,5), QSize(90,90));
        pBackRect = new QRectItem(brect);
        pQvalueColor->onGetValueBackColor(mColor);
        pBackRect->SetBackColor(mColor);
        pBackRect->SetLineType(0);
        pBackRect->setZValue(2);
        pBackRect->SetName(tr("mBackRect"));
        pBackRect->setFlag(QGraphicsItem::ItemIsSelectable, false);
        pBackRect->setFlag(QGraphicsItem::ItemIsMovable, false);

        QRectF frect(QPointF(0,0), QSize(100,100));
        pFramRect = new QRectItem(frect);
        pFramRect->SetBackColor(QColor(224,224,224));
        pFramRect->SetLineType(0);
        pFramRect->setZValue(1);
        pFramRect->SetName(tr("mFramRect"));
        pFramRect->setFlag(QGraphicsItem::ItemIsSelectable, false);
        pFramRect->setFlag(QGraphicsItem::ItemIsMovable, false);
        pFramRect->SetPattern(0);

        QRectF mrect(QPointF(15,25), QSize(70,50));
        pTextRect = new QSimpleTextItem(mrect,"");
        pTextRect->SetName("mText");
        pTextRect->SetRectOutLine(false);
        pTextRect->setZValue(3);
        pTextRect->setFlag(QGraphicsItem::ItemIsSelectable, false);
        pTextRect->SetPattern(1);
        pTextRect->SetFontSize(pQvalueShow->onGetFontSize());
        int nTotaldigit = pQvalueShow->onGetTotaldigit();
        for(int i = 0; i < nTotaldigit;i++)
        {
            sText = sText + "8";
        }
        int nPoint = pQvalueShow->onGetDecimaldigit();
        if(nPoint > 0 && nPoint < nTotaldigit)
        {
            sText.insert(nTotaldigit - nPoint,'.');
        }
        pTextRect->SetText(sText);
        pQvalueColor->onGetValueColor(mColor);
        pTextRect->SetFontColor(mColor);
        pQvalueColor->onGetValueBackColor(mColor);
        pTextRect->SetRectBackColor(mColor);

        QString sFont = pQvalueShow->onGetFont(eDataType);
        pTextRect->SetFontName(sFont);
        //pGroupItem->addToGroup(pFramRect);
        //pGroupItem->addToGroup(pBackRect);
        pGroupItem->addToGroup(pTextRect);

        pCopyItem = pGroupItem;
        pCopyItem->textItem = pTextRect;
        pScene->clear();
        pScene->addItem(pCopyItem);
        pBaseItem = new QGroupItem(pCopyItem);
        //pBaseItem->SetHeigth(100);
        //pBaseItem->SetWidth(100);
    }
    setTransparent();
}