- Replace deprecated QLayout::setMargin() with setContentsMargins().
- Replace QPalette::Foreground with QPalette::WindowText to adapt to Qt6's QPalette role changes.
- Ensure compatibility with both Qt5 and Qt6 to avoid API-related compilation errors.
Test Results:
- Successfully compiles and runs on both Qt5 and Qt6 environments.
- The fixes maintain functional consistency and do not introduce new issues.
This update improves cross-version compatibility and provides better support for future migration to Qt6.