Qt 6.11 is out! See what's new in the release
blog
QTextEdit can not redraw when its Ancestor is a native widget(use dx9 painting)?
-
Hi and welcome to devnet,
You're a bit too vague. What version of Qt ? On what version of Windows ?
If possible, you should share your implementation so other can take a look at it.
-
@SGaist said in QTextEdit can not redraw when its Ancestor is a native widget(use dx9 painting)?:
vague
Thank you for your reply.
Qt Ver = 5.6 in Win10.code likes:
//this is my m_mainView part implementation D3dWidget()D3dWidget(QWidget *parent): QWidget(parent) { setAttribute(Qt::WA_PaintOnScreen, true); setAttribute(Qt::WA_NativeWindow, true); initializeDirect3D();//Creat D3DDevice using winId() } QPaintEngine* D3dWidget::paintEngine() const { return NULL; } void D3dWidget::mouseDoubleClickEvent(QMouseEvent *event) { m_pTextEdit = new QTextEdit(this); m_pTextEdit->setStyleSheet("background-color:transparent;"); m_pTextEdit->setAcceptRichText(false); m_pTextEdit->setWordWrapMode(QTextOption::NoWrap); m_pTextEdit->setPlainText("This is a test text!"); m_pTextEdit->move(event->pos()); m_pTextEdit->resize(200,100); m_pTextEdit->show(); m_pTextEdit->setFocus(); }and
auto m_mainView = new D3dWidget(); vlayout->addWidget(m_mainView);//the layout belong to one QScrollAreaWidget -
Did you check the Creating Transparent Windows documentation in the QWidget documentation ?
-
Did you check the Creating Transparent Windows documentation in the QWidget documentation ?
-
What are you drawing with DirectX ?