Skip to content

frontend: Sort add source list alphabetically - #13952

Open
Warchamp7 wants to merge 1 commit into
obsproject:masterfrom
Warchamp7:add-source-alphabetical-bug
Open

Warchamp7 wants to merge 1 commit into
obsproject:masterfrom
Warchamp7:add-source-alphabetical-bug

Conversation

@Warchamp7

@Warchamp7 Warchamp7 commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Description

Sort sources listed in the add source dialog alphabetically (Case insensitive) except when viewing the Recently Created tab.

image

Fixes #13947

Motivation and Context

The old dialog for existing sources leveraged a QListWidget with sortingEnabled set on it so we were getting this for free before.

Add this behaviour back via manual sorting as it is desired.

How Has This Been Tested?

Multiple sources with different names in very casings.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

The old dialog for existing sources leveraged a QListWidget with
sortingEnabled set on it so we were getting this for free before.

Add this behaviour back via manual sorting as it is desired.
@Warchamp7 Warchamp7 added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. kind/regression Regression from a previous version area/ui-ux Anything to do with changes or additions to UI/UX elements. labels Sep 28, 2026
@Dankirk

Dankirk commented Oct 13, 2026 •

Copy link
Copy Markdown

This should be done with Qt sorting methods. I'd propose using QCollator for the sorting with initialization like this.

QCollator collator(QLocale::system());
collator.setNumericMode(true);
...
return collator.compare(nameA, nameB) < 0;

With that the sorting would follow OS localization rules, and numerical mode would allow sorting source names with numbers in a logical manner. Ie. source12 should be after source3 (alphabetical sort does the opposite).
Also if the localization rules are applied, the sort shouldn't be case-insensitive, but instead let localization decide.

This is a bit extra, but for scenes tab specifically, it's worth considering if it should list them in order they are in the scenes dock or provide that as a sort option.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui-ux Anything to do with changes or additions to UI/UX elements. kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. kind/regression Regression from a previous version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

source dialog is not alphabetical sorted

2 participants