使用setFlags( )函数的时候忘记加QGraphicsItem::ItemAcceptsInputMethod,
setFlags()函数的文档是这样说的"Sets the item flags to flags. All flags in flags are enabled; all flags not in flags are disabled."一旦调用只有设置的选项为enabled,其他的都为disabled。
// 修改前
pItem->setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsFocusable);
// 修改后(QGraphicsItem::ItemAcceptsInputMethod 表示支持不同的语言)
pItem->setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod);