Qtはろくに触ったことがないので、あしからず。
(せいぜい、開発用のツールを作るための試作として、せいぜいサンプルコードを打ってみた程度です)
sceneは、QGraphicsSceneクラスのインスタンスということでいいですか?
addTextの戻り値は、追加した項目を示すQGraphicsTextItemのポインタです。
QGraphicsTextItemのリファレンスを見ると、setDefaultTextColorというそれらしいメソッドがありましたよ。
Qtの開発環境を整えるのはめんどくさいので、PySide(PythonのQtバインディング)で試してみました。
python
1# coding: utf-8
2
3import sys
4from PySide import QtCore, QtGui
5
6class MyView(QtGui.QGraphicsView):
7 def __init__(self):
8 QtGui.QGraphicsView.__init__(self)
9
10 scene = QtGui.QGraphicsScene(self)
11 scene.setSceneRect(0, 0, 100, 100)
12 self.setScene(scene)
13
14 text = scene.addText('Hello, world!')
15 text.setDefaultTextColor(QtGui.QColor(255, 0, 0))
16
17if __name__ == '__main__':
18 app = QtGui.QApplication(sys.argv)
19
20 widget = MyView()
21 widget.show()
22
23 sys.exit(app.exec_())
24
25
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。