void componentComplete() { m_complete = true; if (transientParent() && !transientParent()->isVisible()) { connect(transientParent(), &QQuickWindow::visibleChanged, this, &QQuickWindowQmlImpl::setWindowVisibility, Qt::QueuedConnection); } else { setWindowVisibility(); } }
bool Window::isOnlyInstance( ) { HANDLE handle = CreateMutex( nullptr, true, _windowName ); if ( GetLastError( ) != ERROR_SUCCESS ) { WindowHandle windowHandle = FindWindow( _windowName, nullptr ); if ( windowHandle != nullptr ) { setWindowVisibility( windowHandle, true ); return false; } } return true; }
void Window::switchToFullscreen( ) { // set display settings DEVMODE devMode; devMode.dmSize = sizeof( devMode ); devMode.dmPelsWidth = _width; devMode.dmPelsHeight = _height; devMode.dmBitsPerPel = _bitsPerPx; devMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL; // change default display device settings if ( ChangeDisplaySettings( &devMode, CDS_FULLSCREEN ) != DISP_CHANGE_SUCCESSFUL ) { return; } // set window style SetWindowLong( _windowHandle, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS ); // set extended window style SetWindowLong( _windowHandle, GWL_EXSTYLE, WS_EX_APPWINDOW ); // set window size, position and z-order SetWindowPos( _windowHandle, HWND_TOP, 0, 0, _width, _height, SWP_FRAMECHANGED ); // show the window setWindowVisibility( _windowHandle, true ); }