Why on qt4.4 i can not qgraphicsitem_cast child item?
on other lower version is possibel ... is this a Bug?


d:/qt4.4/include/QtGui/../../src/gui/graphicsview/qgraphicsitem.h: In function `
T qgraphicsitem_cast(QGraphicsItem*) [with T = AbsoluteLayer*]':
textapi\Layer_Auto_Extended.cpp:226: instantiated from here
d:/qt4.4/include/QtGui/../../src/gui/graphicsview/qgraphicsitem.h:945: error: ag
gregate value used where an integer was expected
d:/qt4.4/include/QtGui/../../src/gui/graphicsview/qgraphicsitem.h:945: error: ag
gregate value used where an integer was expected
mingw32-make[1]: *** [build/.obj/Layer_Auto_Extended.o] Error 1
mingw32-make[1]: Leaving directory `C:/_dev2/luxor_svn/fop_miniscribus.2.0.r1/sr
c'
mingw32-make: *** [debug] Error 2
this is the error code piece....

Qt Code:
  1. /* check if absolute layer need a new page document */
  2. void TextLayer::childAreaCheck()
  3. {
  4. /////// qDebug() << "### childArea ";
  5. AbsoluteLayer *itemabsolute = 0;
  6. QList<QGraphicsItem *> subLevelItems = childItems();
  7. qreal lastdown = 400.0; /* A4:2 */
  8.  
  9. for (int i = 0; i < subLevelItems.size(); ++i) {
  10.  
  11. if (itemabsolute = qgraphicsitem_cast<AbsoluteLayer *>(subLevelItems[i]) ) {
  12. itemabsolute->UpdatePageFormat();
  13. lastdown = qMax (lastdown,itemabsolute->pos().y());
  14. }
  15.  
  16. }
  17.  
  18. QPointF lastpoint(50.,lastdown);
  19. ////////qDebug() << "### childArea lastpoint " << lastpoint;
  20. const QRectF allpageRect = boundingRect();
  21. if (!allpageRect.contains(lastpoint)) {
  22. QTextCursor Tcursor = textCursor();
  23. Tcursor.movePosition(QTextCursor::End);
  24. Tcursor.beginEditBlock();
  25. Tcursor.insertText(" \t");
  26. Tcursor.setBlockFormat(PageBreackBlock());
  27. Tcursor.endEditBlock();
  28. }
  29. }
  30.  
  31. /* type is declared */
  32.  
  33. enum { Typex = UserType + 3 };
  34. int type() const { return Typex; }
To copy to clipboard, switch view to plain text mode