Important: Please read the Qt Code of Conduct -

Qt5 and QWinWidget

  • Hello,
    I'm trying to display a Qt widget (a QLineEdit to be precise) in a MFC window. To do so, I'm using QWinWidget. I am using Qt5.12.3

    It displays well the QLineEdit, but the problem I have is that when I want to update the field and click on it, it's disappearing...
    Then when I click on another window in my application, it's reapprearing, and is well updated if I changed the text inside of it (even if it had disappeared)
    Anyone has an idea on what's going wrong here? May it be due to the version of Qt I am using? Do you know which is the last one that is safe with QWinMigrate?

    Here is my code :

    	CRect ControlArea2;
    	HWND hWnd_TransfFunction = m_Control3.GetSafeHwnd();
    	QWinWidget w(hWnd_TransfFunction, 0, 0);
    	QWidget *widget = new QWidget(&w);
    	QHBoxLayout *hbox = new QHBoxLayout(widget);
    	QLabel *label = new QLabel("Enter text:", widget);
    	QLineEdit *edit = new QLineEdit(widget);
    	widget->move(0, 0);
    	w.setGeometry(ControlArea2.left,, ControlArea2.Width(), ControlArea2.Height());
    	w.setFixedSize(ControlArea2.Width(), ControlArea2.Height());;

  • Lifetime Qt Champion

    Why do you ask the same question you did two days before --> closed.

Log in to reply