MainWindow::MainWindow() : QMainWindow(NULL, "mainwnd", WType_TopLevel | WStyle_Customize | WStyle_Title | WStyle_NormalBorder| WStyle_SysMenu), EventReceiver(LowestPriority) { m_grip = NULL; h_lay = NULL; m_bNoResize = false; SET_WNDPROC("mainwnd"); m_icon = "ICQ"; setIcon(Pict(m_icon.c_str())); setTitle(); #ifdef WIN32 pMain = this; if (IsWindowUnicode(winId())){ oldProc = (WNDPROC)SetWindowLongW(winId(), GWL_WNDPROC, (LONG)wndProc); }else{ oldProc = (WNDPROC)SetWindowLongA(winId(), GWL_WNDPROC, (LONG)wndProc); } #endif bar = NULL; main = new MainWindowWidget(this); setCentralWidget(main); lay = new QVBoxLayout(main); QStatusBar *status = statusBar(); status->hide(); status->installEventFilter(this); }
MainWindow::MainWindow() : QMainWindow(NULL, Qt::Window) , EventReceiver(LowestPriority) { setObjectName("mainwnd"); setAttribute(Qt::WA_AlwaysShowToolTips); Q_ASSERT(s_mainWindow == NULL); s_mainWindow = this; h_lay = NULL; m_bNoResize = false; m_icon = "SIM"; setWindowIcon(Icon(m_icon)); setTitle(); // setIconSize(QSize(16,16)); m_bar = NULL; main = new QWidget(this); setCentralWidget(main); lay = new QVBoxLayout(main); lay->setMargin(0); QStatusBar *status = statusBar(); status->show(); status->installEventFilter(this); }
MainWindow::MainWindow(Geometry &geometry) : QMainWindow(NULL, Qt::Window) , EventReceiver(LowestPriority) { setObjectName("mainwnd"); setAttribute(Qt::WA_AlwaysShowToolTips); Q_ASSERT(s_mainWindow == NULL); s_mainWindow = this; h_lay = NULL; m_bNoResize = false; m_icon = "SIM"; setWindowIcon(Icon(m_icon)); setTitle(); // setIconSize(QSize(16,16)); m_bar = NULL; main = new QWidget(this); setCentralWidget(main); lay = new QVBoxLayout(main); lay->setMargin(0); QStatusBar *status = statusBar(); status->show(); status->installEventFilter(this); if ((geometry[WIDTH].toLong() == -1) && (geometry[HEIGHT].toLong() == -1)) { geometry[HEIGHT].asLong() = QApplication::desktop()->height() * 2 / 3; geometry[WIDTH].asLong() = geometry[HEIGHT].toLong() / 3; } if ((geometry[LEFT].toLong() == -1) && (geometry[TOP].toLong() == -1)){ geometry[LEFT].asLong() = QApplication::desktop()->width() - 25 - geometry[WIDTH].toLong(); geometry[TOP].asLong() = 5; } ::restoreGeometry(this, geometry, true, true); }