Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.3
-
None
Description
Using a QTextEdit as a QGraphicsProxyWidget and setColor() to red.
Without any previous text,the entered text stays black.
Example Code:
#include <QApplication>
#include <QVBoxLayout>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsProxyWidget>
#include <QTextEdit>
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
QWidget window;
window.resize(400, 250);
//normal QTextEdit
QVBoxLayout *layout = new QVBoxLayout;
QTextEdit *textWidget1 = new QTextEdit;
layout->addWidget(textWidget1);
textWidget1->setTextColor(QColor(Qt::red));
// ** input some text it'll be red
//QtextEdit with WoC
QTextEdit *textWidget2 = new QTextEdit;
QGraphicsView *view = new QGraphicsView;
QGraphicsScene *scene = new QGraphicsScene;
view->setScene(scene);
QGraphicsProxyWidget *proxy = scene->addWidget(textWidget2);
textWidget2->setTextColor(QColor(Qt::red));
// ** input some text, it'll stay black
layout->addWidget(view);
textWidget1->show();
window.setLayout(layout);
view->show();
window.show();
return a.exec();
}