Hi,
I’m trying to create a plugin for a Windows program and would like to use Qt. I found the Qt-winmigrate solution and tried it.
I have no problem opening a QMessageBox like this:
QWinWidget win1( static_cast<HWND>(m_LocalPIWin) );
win1.showCentered();
QMessageBox::about( &win, "About QtMfc", "QtMfc Version 1.0\nCopyright (C) 2003" );
But when I try to create the QWinWidget with its children inside of the given parent I can’t see any content.
HWND hWnd = static_cast<HWND>(m_LocalPIWin);
QWinWidget win(hWnd);
HWND winId = (HWND)win.winId();
QHBoxLayout hbox(&win);
hbox.setSpacing(5);
hbox.setMargin(0);
QPushButton *pb = new QPushButton("Qt command button", &win);
pb->setObjectName("pb");
hbox.addWidget(pb);
QLabel *label = new QLabel("Some label", &win);
label->setObjectName("label");
hbox.addWidget(label);
QLineEdit *le1 = new QLineEdit(&win);
le1->setObjectName("le1");
hbox.addWidget(le1);
QLineEdit *le2 = new QLineEdit(&win);
le1->setObjectName("le2");
hbox.addWidget(le2);
QLineEdit *le3 = new QLineEdit(&win);
le1->setObjectName("le3");
hbox.addWidget(le3);
win.move(0, 0);
win.show();
ShowWindow(hWnd, SW_SHOWNORMAL);
UpdateWindow(hWnd);
I’m pretty lost on this one. Any advise?
↧