Project

General

Profile

Actions

Feature #1950

open

[Qt] Multi-select for stacked units.

Added by John Robertson 8 months ago. Updated 19 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Qt-client
Target version:
-
Start date:
02/21/2026
Due date:
% Done:

0%

Estimated time:

Description

Implements:
  • Ctrl+A to select all
  • Ctrl+LeftMouseClick to toggle individual unit's selection state
  • Shift+LeftMouseClick to select all units from the previously selected unit
  • (as before) LeftMouseClick selects and completes the selection window
  • The Enter/Return key also completes the selection window

Files

clipboard-202602211942-r1an4.png (127 KB) clipboard-202602211942-r1an4.png John Robertson, 02/22/2026 04:42 AM
1950.patch (13.7 KB) 1950.patch John Robertson, 02/22/2026 05:59 AM
1950.v2.patch (13.6 KB) 1950.v2.patch John Robertson, 02/22/2026 06:46 AM
clipboard-202602221910-5yuf7.png (132 KB) clipboard-202602221910-5yuf7.png John Robertson, 02/23/2026 04:10 AM
1950.v3.patch (16.7 KB) 1950.v3.patch John Robertson, 02/23/2026 04:12 AM
1950_on_top_of_2312.patch (16 KB) 1950_on_top_of_2312.patch Marko Lindqvist, 09/30/2026 06:59 AM
1950_on_top_of_2312.patch (13.6 KB) 1950_on_top_of_2312.patch Marko Lindqvist, 09/30/2026 07:19 AM
clipboard-202602211942-r1an4.png
clipboard-202602221910-5yuf7.png

Related issues 1 (0 open — 1 closed)

Blocked by Feature #2312: Qt: Improve units_select::create_pixmap() formattingClosedMarko Lindqvist09/30/2026

Actions
Actions #1

Updated by John Robertson 8 months ago

Actions #2

Updated by John Robertson 8 months ago

whoops, need to remove the `log_normal()` lines.

Updated by John Robertson 8 months ago

clipboard-202602221910-5yuf7.png


necessarily, changed the selected text color

Actions #4

Updated by Marko Lindqvist 19 days ago

In file included from ../../src/utility/shared.h:181,
                 from ../../src/common/fc_types.h:23,
                 from ../../src/common/actres.h:21,
                 from ../../src/common/actions.h:18,
                 from ../../src/client/gui-qt/dialogs.cpp:41:
../../src/client/gui-qt/dialogs.cpp: In member function ‘void units_select::create_pixmap()’:
../../src/client/gui-qt/dialogs.cpp:5305:37: error: declaration of ‘punit’ shadows a previous local [-Werror=shadow]
 5305 |     unit_list_iterate(utile->units, punit) {
      |                                     ^~~~~
../../src/utility/speclist.h:578:14: note: in definition of macro ‘TYPED_LIST_ITERATE’
  578 |   TYPE_data *NAME_data;                                                     \
      |              ^~~~~~~~~
../../src/client/gui-qt/dialogs.cpp:5305:5: note: in expansion of macro ‘unit_list_iterate’
 5305 |     unit_list_iterate(utile->units, punit) {
      |     ^~~~~~~~~~~~~~~~~
../../src/client/gui-qt/dialogs.cpp:5259:16: note: shadowed declaration is here
 5259 |   struct unit *punit;
      |                ^~~~~
Actions #5

Updated by Marko Lindqvist 19 days ago

The patch is quite hard to read due to big formatting changes hiding the small logic changes.

Actions #6

Updated by Marko Lindqvist 19 days ago

  • Blocked by Feature #2312: Qt: Improve units_select::create_pixmap() formatting added
Actions #7

Updated by Marko Lindqvist 19 days ago

Marko Lindqvist wrote in #note-5:

The patch is quite hard to read due to big formatting changes hiding the small logic changes.

#2312 does bulk of the formatting changes first. Attached patch applies on top of it. The patch results in the same final files that the old patch did without #2312. This also reveals that formatting also with this patch is badly off at places.

Actions #8

Updated by Marko Lindqvist 19 days ago

Marko Lindqvist wrote in #note-7:

Marko Lindqvist wrote in #note-5:

The patch is quite hard to read due to big formatting changes hiding the small logic changes.

#2312 does bulk of the formatting changes first. Attached patch applies on top of it. The patch results in the same final files that the old patch did without #2312. This also reveals that formatting also with this patch is badly off at places.

New version attached, with indentation adjusted. No other changes, e.g., the compiler warning is still there.

Actions #9

Updated by Marko Lindqvist 19 days ago

- You remove update_units(), and all calls to it. Are you sure things work correctly when enemy kills some units from the tile while the selection is open?
- style: Make sure there's an empty line between variable declarations and first line of code on each code block

Actions #10

Updated by Marko Lindqvist 19 days ago

Marko Lindqvist wrote in #note-9:

- You remove update_units(), and all calls to it. Are you sure things work correctly when enemy kills some units from the tile while the selection is open?

Indexes in tile->units can change also because of allied player moving units in/out. It can even be an allied ship carrying our units in/out.

Actions

Also available in: Atom PDF