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....
/* check if absolute layer need a new page document */
void TextLayer::childAreaCheck()
{
/////// qDebug() << "### childArea ";
AbsoluteLayer *itemabsolute = 0;
QList<QGraphicsItem *> subLevelItems = childItems();
qreal lastdown = 400.0; /* A4:2 */
for (int i = 0; i < subLevelItems.size(); ++i) {
if (itemabsolute = qgraphicsitem_cast<AbsoluteLayer *>(subLevelItems[i]) ) {
itemabsolute->UpdatePageFormat();
lastdown = qMax (lastdown,itemabsolute->pos().y());
}
}
////////qDebug() << "### childArea lastpoint " << lastpoint;
const QRectF allpageRect
= boundingRect
();
if (!allpageRect.contains(lastpoint)) {
Tcursor.beginEditBlock();
Tcursor.insertText(" \t");
Tcursor.setBlockFormat(PageBreackBlock());
Tcursor.endEditBlock();
}
}
/* type is declared */
enum { Typex = UserType + 3 };
int type() const { return Typex; }
/* check if absolute layer need a new page document */
void TextLayer::childAreaCheck()
{
/////// qDebug() << "### childArea ";
AbsoluteLayer *itemabsolute = 0;
QList<QGraphicsItem *> subLevelItems = childItems();
qreal lastdown = 400.0; /* A4:2 */
for (int i = 0; i < subLevelItems.size(); ++i) {
if (itemabsolute = qgraphicsitem_cast<AbsoluteLayer *>(subLevelItems[i]) ) {
itemabsolute->UpdatePageFormat();
lastdown = qMax (lastdown,itemabsolute->pos().y());
}
}
QPointF lastpoint(50.,lastdown);
////////qDebug() << "### childArea lastpoint " << lastpoint;
const QRectF allpageRect = boundingRect();
if (!allpageRect.contains(lastpoint)) {
QTextCursor Tcursor = textCursor();
Tcursor.movePosition(QTextCursor::End);
Tcursor.beginEditBlock();
Tcursor.insertText(" \t");
Tcursor.setBlockFormat(PageBreackBlock());
Tcursor.endEditBlock();
}
}
/* type is declared */
enum { Typex = UserType + 3 };
int type() const { return Typex; }
To copy to clipboard, switch view to plain text mode
Bookmarks