C++ (Qt) QRect rect = geometry(); rect.setHeight( event->size().width() / m_fScaleFactor ); setGeometry( rect );