Skip to content

Qt 6.4 build compat, Windows VFS dedupe fix, scrollbar UX#1959

Merged
Robosturm merged 7 commits into
Robosturm:masterfrom
TheMasterCreed:master
May 5, 2026
Merged

Qt 6.4 build compat, Windows VFS dedupe fix, scrollbar UX#1959
Robosturm merged 7 commits into
Robosturm:masterfrom
TheMasterCreed:master

Conversation

@TheMasterCreed
Copy link
Copy Markdown
Contributor

Three independent fixes from building this fork against Debian's Qt 6.4
toolchain. Happy to split into separate PRs if preferred; commits are
already organized one-per-topic.

Restore Qt 6.4 build compatibility (commit 1)

The repo has a few Qt 6.5+-only API uses that block compilation on Qt 6.4
systems (Debian stable, several CI sandboxes, older distros).

  • Replace QtTypes with QtGlobal in oxygine ShaderProgram.h and the three
    ai/*.h selectors.
  • Wrap QDomDocument::setContent() in a Qt-version branch in Resources.cpp,
    fontmanager.cpp, audiomanager.cpp, and uifactory.cpp; older Qt uses the
    out-parameter form, 6.5+ keeps the ParseResult struct.
  • Replace QString::removeFirst() (Qt 6.5+) loop with QString::remove(0, n)
    in globalutils.cpp; one in-place call beats N single-char removes anyway.
  • Add add_compile_definitions(Qt_6_5=Qt_6_4) for Qt < 6.5 in
    CMakeLists.txt so QDataStream::Version::Qt_6_5 references map to the
    older save format constant.

All paths are version-guarded; no-ops on Qt 6.5+. Verified by full
Commander_Wars build against Debian's Qt 6.4 in a sandbox.

Compare canonical paths in VFS dedupe (commit 2)

VirtualPaths::setSearchPath() compared cwd vs userPath using QFileInfo's
string equality, which is case-sensitive on Windows even though NTFS is
not. Two paths pointing at the same directory (C:\Game vs c:\game) were
treated as different and the cwd entry was added redundantly.

Add a normalizedPath() helper using canonicalFilePath() (with
absoluteFilePath() fallback), cleanPath(), and lowercase-on-Windows. Use
it for the existing dedupe check. No search paths added or removed.

Click-to-scroll on scrollbar tracks, plus panel sync fixes (commit 3)

V_Scrollbar and H_Scrollbar only responded to the slider thumb and arrow
buttons; clicking on the bare track did nothing.

Scrollbar changes:

  • Tap on track jumps slider to click position; continued hold tracks
    the cursor (m_trackSliding state).
  • Destructor detaches the global Stage move listene

TheMasterCreed and others added 4 commits May 3, 2026 10:47
* Replace QtTypes (Qt 6.5+) with QtGlobal in oxygine ShaderProgram.h and the
  ai/*.h selectors so headers parse on Qt 6.0+.
* Wrap QDomDocument::setContent() in a Qt-version branch in Resources.cpp,
  fontmanager.cpp, audiomanager.cpp, and uifactory.cpp so the pre-6.5
  out-parameter form is used on older Qt.
* Replace QString::removeFirst() (Qt 6.5+) loop with QString::remove(0, n) in
  globalutils.cpp; one in-place call beats N single-char removes anyway.
* Add 'add_compile_definitions(Qt_6_5=Qt_6_4)' for Qt < 6.5 in CMakeLists.txt
  so QDataStream::Version::Qt_6_5 references compile against the older save
  format constant.

No-ops on Qt 6.5+; all version-guarded. Verified by full Commander_Wars
build against Debian's Qt 6.4 in a sandbox.
VirtualPaths::setSearchPath() compared cwd vs userPath using QFileInfo's
string equality, which is case-sensitive on Windows even though NTFS is not.
Add a normalizedPath() helper using canonicalFilePath()/cleanPath() and
lowercase-on-Windows, and use it for the existing dedupe check.
* Tap on the bare V_Scrollbar / H_Scrollbar track now jumps the slider to the
  click position; continued hold keeps tracking the cursor.
* Destructors detach the global Stage move listener if one was registered,
  closing a leak on scrollbar disposal.
* TOUCH_UP guards added on arrows and slider so spurious sigEndEditValue
  signals stop firing when the scrollbar wasn't active.
* stopPropagation() added so scrollbar clicks don't bleed through to UI
  beneath them.
* Panel skips auto-syncing scrollbar value while the user is actively
  sliding it, and adds a div > 0 guard to the V scrollbar value calc.
Comment thread coreengine/virtualpaths.cpp Outdated

namespace
{
QString normalizedPath(const QFileInfo& info)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this a static function of the class as the rest instead of putting it in a private namespace

Comment thread objects/base/panel.cpp
}
}
else
else if (!m_VScrollbar->getVisible())
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either this condition is wrong or it's missing for the HScrollbar

TheMasterCreed added a commit to TheMasterCreed/Commander_Wars that referenced this pull request May 4, 2026
Robosturm review feedback on PR Robosturm#1959: relocate the helper out of
the anonymous namespace so it matches the existing private-static
convention used by processName, createSearchPathInternal, and
findAllInternal.
TheMasterCreed added a commit to TheMasterCreed/Commander_Wars that referenced this pull request May 4, 2026
Robosturm review feedback on PR Robosturm#1959: the V-axis branch was tightened
to reset content X only when the scrollbar is hidden, but the H-axis
branch kept a bare else that snapped Y to 0 every frame the scrollbar
was visible but div<=0. Apply the same !getVisible() guard to H so
both axes behave symmetrically.
GameMenue::doDespawnSlave and Multiplayermenu::doSaveLobbyState constructed the
SLAVEINFODESPAWNING JSON manually and never inserted versionMajor / versionMinor
/ versionRevision / versionSufix. MainServer::onSlaveInfoDespawning called
NetworkGameData::fromJson on the message, which read those missing keys as 0
and the empty string, so each suspended-slave entry in m_runningSlaves and
m_runningLobbies got stamped 0.0.0- as its game version. When a player tried
to rejoin from the My Games view, LobbyMenu::checkGameVersion compared 0.0.0-
against GameVersion() (the live binary) and refused the join with "Game has a
different version. Game version: 0.0.0-".

Insert the four version keys at both call sites, mirroring NetworkGameData::
toJson, so suspended games carry their actual version through the despawn /
relaunch round trip.
Robosturm review feedback on PR Robosturm#1959: relocate the helper out of
the anonymous namespace so it matches the existing private-static
convention used by processName, createSearchPathInternal, and
findAllInternal.
Robosturm review feedback on PR Robosturm#1959: the V-axis branch was tightened
to reset content X only when the scrollbar is hidden, but the H-axis
branch kept a bare else that snapped Y to 0 every frame the scrollbar
was visible but div<=0. Apply the same !getVisible() guard to H so
both axes behave symmetrically.
@Robosturm Robosturm merged commit 42df333 into Robosturm:master May 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants