Changeset 3726 for pjproject/trunk/pjsip-apps/src/vidgui/vidwin.cpp
- Timestamp:
- Aug 26, 2011 4:30:18 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/vidgui/vidwin.cpp
r3724 r3726 47 47 VidWin::~VidWin() 48 48 { 49 show(false); 49 50 detach(); 50 pj_bzero(&hwnd, sizeof(hwnd));51 size_hint = QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);52 destroy(true, false);53 51 } 54 52 … … 56 54 { 57 55 switch(e->type()) { 56 58 57 case QEvent::Resize: 59 { 60 // revert to default size hint, make it resizable 61 setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); 62 // resize now 63 set_size(); 64 } 65 break; 66 case QEvent::ParentAboutToChange: 58 set_size(); 59 break; 60 61 case QEvent::ParentChange: 67 62 get_size(); 68 setFixedSize(size_hint); 69 break; 70 case QEvent::ParentChange: 71 { 72 get_size(); 73 /* 63 if (0) { 74 64 QRect qr = rect(); 75 65 if (qr.width() > size_hint.width()) … … 77 67 if (qr.height() > size_hint.height()) 78 68 size_hint.setWidth(qr.height()); 79 */80 setFixedSize(size_hint);81 attach();82 69 } 83 break; 70 setFixedSize(size_hint); 71 attach(); 72 break; 73 74 case QEvent::Show: 75 show(true); 76 // revert to default size hint, make it resizable 77 setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); 78 break; 79 80 case QEvent::Hide: 81 show(false); 82 break; 83 84 84 default: 85 85 break; … … 103 103 orig_parent = GetParent(w); 104 104 105 SetWindowLong(w, GWL_STYLE, WS_CHILD); 105 106 SetParent(w, new_parent); 106 SetWindowLong(w, GWL_STYLE, WS_CHILD);107 ShowWindow(w, SW_SHOWNOACTIVATE);108 107 TRACE_("%p new parent handle = %p", w, new_parent); 109 108 } … … 114 113 115 114 HWND w = (HWND)hwnd.info.win.hwnd; 116 ShowWindow(w, SW_HIDE);117 115 SetParent(w, (HWND)orig_parent); 118 116 TRACE_("%p revert parent handle to %p", w, orig_parent); … … 145 143 if (!hwnd.info.win.hwnd) return; 146 144 147 ShowWindow(hwnd.info.win.hwnd, visible ? SW_SHOW : SW_HIDE); 145 HWND w = (HWND)hwnd.info.win.hwnd; 146 ShowWindow(w, visible ? SW_SHOW : SW_HIDE); 148 147 } 149 148
Note: See TracChangeset
for help on using the changeset viewer.