Now I added layout to my QWinWidget and it seems to work .Although I am not sure why.
int MyCDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate( lpCreateStruct ) == -1 )
return -1;
win=new QWinWidget( this->m_hWnd );
MyFrame * dialog=new MyFrame(win);
mylayout->addWidget(dialog);
win->setLayout(mylayout);
win->move(0,0);
win->show();
return 0;
}
int MyCDialog::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate( lpCreateStruct ) == -1 )
return -1;
win=new QWinWidget( this->m_hWnd );
MyFrame * dialog=new MyFrame(win);
QVBoxLayout mylayout=new QVBoxLayout ;
mylayout->addWidget(dialog);
win->setLayout(mylayout);
win->move(0,0);
win->show();
return 0;
}
To copy to clipboard, switch view to plain text mode
and in my OnSize handler :
void MyCDailog::OnSize(UINT nType,int cx,int cy)
{
win->resize(cx,cy);
}
void MyCDailog::OnSize(UINT nType,int cx,int cy)
{
win->resize(cx,cy);
}
To copy to clipboard, switch view to plain text mode
Bookmarks