qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

Please remove the "auto scroll to start" when reordering columns

Open ghost opened this issue 1 year ago • 33 comments

Suggestion

Whenever I reorder a column the app forcefullly scrolls all the way back to the left. Trying to scroll while it's doing this just ends up fighting it. It's a ridiculous behavior with no purpose other than to annoy people.

Use case

No response

Extra info/examples/attachments

No response

ghost avatar Oct 28 '23 06:10 ghost

I confirm with 4.5.5 and 4.6.0 in Windows. Both use the same Qt version 6.4.3. I can't reproduce in Linux with Qt 6.6.0. Although chances are it will be fixed with a higher Qt6 version, i didn't test it in Windows so we'll have to wait for such a Windows build unless someone else can confirm it before then.

thalieht avatar Oct 28 '23 15:10 thalieht

It's not even scrolling all the way to the left, it scrolls to the "Name" column; Try reordering your columns and put something to the left of the "Name" column.

You will find that it snaps to align the left side of the "Name" column, no matter where it is.

Ofunniku avatar Oct 28 '23 16:10 Ofunniku

FWIW I see this on both 4.6.0 on a Mac and 5.0.0 unstable on Ubuntu 22.04. Not sure which qt version either uses

ghost avatar Oct 28 '23 16:10 ghost

I also see this on 4.5.3 which uses qt 6.5.1

mahkitah avatar Oct 28 '23 17:10 mahkitah

also duplicate https://github.com/qbittorrent/qBittorrent/issues/18992

stalkerok avatar Nov 27 '23 07:11 stalkerok

@thalieht

This appears to be Qt option that was added way back - not a bug. I think the behavior can be turned off when building with the correct flags, if one knows how to do so.

I think this page is talking about this "feature"? https://stackoverflow.com/questions/47422525/disabling-horizontal-auto-scroll-in-qt5

May we have a build where the automatic scrolling is turned off please. I've been really looking forward to the day. It's been two to three years since this was introduced - qBt wasn't always like this.

macOS 14.3 qBittorrent v4.6.2 qt 6.4.3

101Dude avatar Jan 09 '24 04:01 101Dude

@Ofunniku

It's not even scrolling all the way to the left, it scrolls to the "Name" column; Try reordering your columns and put something to the left of the "Name" column.

You will find that it snaps to align the left side of the "Name" column, no matter where it is.

Mine doesn't snap to the name column, it snaps all the way to the left. It doesn't matter which columns are displayed either or what order they are in. What matters is that all of the columns don't fit inside the window frame and you are scrolled to the far right when clicking to reorder the column.

101Dude avatar Jan 09 '24 04:01 101Dude

it looks like this is a bug/feature of Qt and will not be changed for a long time. see https://bugreports.qt.io/browse/QTBUG-37800 https://bugreports.qt.io/browse/QTBUG-3927 https://bugreports.qt.io/browse/QTBUG-5115.

By inheriting QTreeView and reimplementing related functions may change the behavior.

in the comments for this "bug" there are some workarounds proposed:

Eike Ziller added a comment - 06 Nov '17 11:56 A workaround seems to be to set setAutoScroll(false), and avoid the use of scrollTo(...) or fixup the horizontal position directly after the call to scrollTo(...) in whatever way you like e.g. const int xpos = m_view->horizontalScrollBar()->value(); m_view->scrollTo(index); m_view->horizontalScrollBar()->setValue(xpos); to keep the horizontal position the same.

Eike Ziller added a comment - 08 Nov '17 08:49 - edited Qt Creator works around that now by overriding scrollTo with some horizontal scroll logic: https://codereview.qt-project.org/210408 + https://codereview.qt-project.org/212124 Not sure if that logic works well with multiple columns. To me it seems that there are two related but separate issues here:

  1. autoScroll is supposed to only affect scrolling when using drag & drop, but factually it leads to scrollTo(...) calls whenever clicking on an item with the mouse, or navigating through the tree with the keyboard.
  2. scrollTo(...)'s horizontal scrolling is questionable.

101Dude avatar Jan 09 '24 16:01 101Dude

@glassez Would you please take a look at this? This is a very long running UI issue (many years) and Qt upgrades and updates will never address it - only changing Qt build options will.

101Dude avatar Jan 15 '24 22:01 101Dude

When I drag a column header out of viewport, I would expect it to scroll in that direction. Currently I see the following problems:

  1. it starts scrolling as soon as I start dragging the column header, even if dragging are being performed in the middle of the viewport,
  2. it only scrolls to the left no matter in which direction I drag the column header,
  3. it does not stop scrolling after I drop the column header.

I have no desire to investigate this problem in Qt. I can disable auto-scrolling when dragging column headers, if that suits you.

glassez avatar Jan 17 '24 12:01 glassez

When I drag a column header out of viewport, I would expect it to scroll in that direction. Currently I see the following problems:

  1. it starts scrolling as soon as I start dragging the column header, even if dragging are being performed in the middle of the viewport,
  2. it only scrolls to the left no matter in which direction I drag the column header,
  3. it does not stop scrolling after I drop the column header.

I have no desire to investigate this problem in Qt. I can disable auto-scrolling when dragging column headers, if that suits you.

In that case I sincerely hope the two issues are related... I see what you describe as well. If auto-scrolling can be disabled globally that would be wonderful 🙏

The auto-scrolling behavior that I find maddening is sorting a column from ascending to descending, or vice versa - when the column is on the right side of the viewport it auto-scrolls to the far left every time. It can't be stopped. Then I have to scroll back to the right to view the freshly sorted column. I do much more sorting than moving columns

101Dude avatar Jan 17 '24 22:01 101Dude

The auto-scrolling behavior that I find maddening is sorting a column from ascending to descending, or vice versa

So it is another problem. This Issue is about "auto scroll to start" when reordering columns.

glassez avatar Jan 18 '24 04:01 glassez

@glassez

also duplicate #18992

Another comment above mentioned my post as a "duplicate" and then it was closed.. Should I reopen it?

101Dude avatar Jan 18 '24 04:01 101Dude

@glassez

also duplicate #18992

Another comment above mentioned my post as a "duplicate" and then it was closed.. Should I reopen it?

IMO, they are similar, but I would not call them duplicated. I've reopened your.

glassez avatar Jan 18 '24 05:01 glassez

also duplicate https://github.com/qbittorrent/qBittorrent/issues/18992

Another comment above mentioned my post as a "duplicate" and then it was closed

I think it is duplicate. @101Dude can you guarantee you didn't move the mouse even slightly while mouse button is pressed down? I see in the video that the first sort click didn't trigger the problem. Mouse moved a little after the 2nd click but i don't know if you had released the button before that. Related https://github.com/qbittorrent/qBittorrent/issues/19906#issuecomment-1811607797 (possibly same trigger for another problem i mean)

Why are you guys talking about doing anything before we test with Qt 6.6.0+ https://github.com/qbittorrent/qBittorrent/issues/19810#issuecomment-1783844181? Maybe one of you have already tested? (Why are we still stuck on Qt 6.4.3, what did i miss?)

thalieht avatar Jan 18 '24 11:01 thalieht

Why are you guys talking about doing anything before we test with Qt 6.6.0+ #19810 (comment)?

Well, here are my results:

  1. Windows 11, official qBittorrent v4.6.3 build (Qt 6.4.3). Issue with moving column headers is reproducible.
  2. Linux Mint, qBittorrent master build (Qt 6.6.0). Issue with moving column headers is reproducible.
  3. Windows 11, qBittorrent master build (Qt 6.6.1). Issue with moving column headers isn't reproducible.

The autoscroll problem on sorting by column is reproducible only in those cases mentioned above, in which the problem with moving the column header is reproducible, and ONLY if the column header is carelessly affected during a click, which leads to a short-term drag (as @thalieht suggested).

glassez avatar Jan 18 '24 12:01 glassez

Why are we still stuck on Qt 6.4.3, what did i miss?

What exactly do you ask? qBittorrent 4.6.x series uses Qt 6.4.x because there were complaints about some changes in Qt 6.5 (from project members as well), so it was decided not to use it.

glassez avatar Jan 18 '24 12:01 glassez

Qt 6.5 builds were causing crashes on macOS -> https://github.com/qbittorrent/qBittorrent/issues/19090#issuecomment-1579104400 (Minimum macOS for Qt 6.5+ = 11)

On windows - dark mode could be automatically enabled with Qt 6.5 but caused some parts of GUI to remain white etc for example: #18950

Qt 6.6.1 also fixed that issue, https://github.com/qbittorrent/qBittorrent/issues/18950#issuecomment-1827656834

xavier2k6 avatar Jan 18 '24 12:01 xavier2k6

@glassez @xavier2k6 thanks, i wasn't aware of these issues.

thalieht avatar Jan 18 '24 12:01 thalieht

I think it is duplicate. @101Dude can you guarantee you didn't move the mouse even slightly while mouse button is pressed down? I see in the video that the first sort click didn't trigger the problem. Mouse moved a little after the 2nd click but i don't know if you had released the button before that.

I retested with two mice (one wired with no trackpad) and was extra careful not to move the mouse while clicking. Clicking and dragging a column will cause the column header to highlight. I even paid $4.99 for a mouse coordinate app to verify 🤓

Towards the end (about 0:58) you will see successive clicks on exactly the "correct" pixel that don't cause an auto-scroll.

https://github.com/qbittorrent/qBittorrent/assets/142523670/9bcfbd8a-a2b6-45f8-b845-63aa931be12f

I spent an hour looking for patterns of behavior. Location of click seems to be something, time between clicks - faster is not good because it causes clicks to be missed entirely, when a column is already selected it seems to be less prone to auto-scrolling when clicked on again.

I can't really discern a pattern... very frustrating. I know that if I find the right spot by trial and error I can keep clicking there and sort the column repeatedly until the viewport is changed then that spot no longer works.

Theory is that the clicking area is just too narrow. I have also noticed selection issues with rows where I can't SHIFT click to select a group if I don't make the second click exactly on the correct spot in the row. If second click is too high or low in the row then the selection won't happen.

SHIFT click on mac is select one row while holding shift key down then select another row and all rows between will become selected.

If I can do any more experimentation let me know. I'd really like to see this resolved.

101Dude avatar Jan 19 '24 06:01 101Dude

Wow thanks for doing that @101Dude. Maybe it's a Mac only bug... i can't reproduce it in Windows.

thalieht avatar Jan 19 '24 11:01 thalieht

https://github.com/qbittorrent/qBittorrent/assets/63958081/412c62c7-a547-46a0-9fce-5e4654f0a37a

stalkerok avatar Jan 19 '24 12:01 stalkerok

@glassez Is there a version I can test on macOS to see if it's still an issue?

This is still tagged as "waiting info". Is there any info I can provide?

When I drag a column header out of viewport, I would expect it to scroll in that direction. Currently I see the following problems:

  1. it starts scrolling as soon as I start dragging the column header, even if dragging are being performed in the middle of the viewport,
  2. it only scrolls to the left no matter in which direction I drag the column header,
  3. it does not stop scrolling after I drop the column header.

I have no desire to investigate this problem in Qt. I can disable auto-scrolling when dragging column headers, if that suits you.

I did test this release : https://github.com/qbittorrent/qBittorrent/actions/runs/7847706305/artifacts/1234090587

Whatever has changed has worked for two issues on macOS (thank you)

  1. autoscroll when sorting by header has been greatly reduced on macOS (99% of time no autoscroll)
  2. selection of rows now works perfectly (select a row and then shift+click another row keeps rows selected)

However, the autoscroll still happens when dragging a column on macOS

Thank you so much for your efforts!

101Dude avatar Feb 09 '24 17:02 101Dude

Wow thanks for doing that @101Dude. Maybe it's a Mac only bug... i can't reproduce it in Windows.

This bug is occurring for me on Windows 10 with the latest v4.6.3 version. Definitely not exclusive to MacOS. There are tons of other weird UI bugs too (like row height randomly changing).

Lucane avatar Mar 23 '24 06:03 Lucane

Wow thanks for doing that @101Dude. Maybe it's a Mac only bug... i can't reproduce it in Windows.

This bug is occurring for me on Windows 10 with the latest v4.6.3 version. Definitely not exclusive to MacOS. There are tons of other weird UI bugs too (like row height randomly changing).

more or less exactly the same behaviors (auto left scroll + row height changing then return to initial height) in Windows 11 and qBittorrent v4.6.4 (64-bit).

Dams-77 avatar Apr 15 '24 13:04 Dams-77

At some point I downloaded a beta to test and it was better on macOS. It looks like those fixes didn't get incorporated into qBittorrent v4.6.4 build.

What I notice over and over is the area to select any header to avoid the auto scroll is so narrow - a few pixels at most. The same for shift-selecting multiple rows - the selection area is a few pixels high and just below the midpoint of the row.

The area to select should be the full row height. There is an alignment issue. It's most likely how the devs have set up qt. Been an annoyance for ~5 years.

101Dude avatar Apr 15 '24 14:04 101Dude

Thanks for the clarification 101Dude.

Dams-77 avatar Apr 15 '24 15:04 Dams-77

OS Edition: Windows 10 Pro Version: 22H2 qBittorent: qBittorrent v4.6.4 (64-bit)

order of operations: open program scroll to the right click and drag a column The scrolling begins as soon as the column is drag-selected

rawesomeawesome avatar Jun 13 '24 18:06 rawesomeawesome

@Ofunniku Mine doesn't snap to the name column, it snaps all the way to the left.

This is what happens for me, too.

kiwichick888 avatar Jun 29 '24 04:06 kiwichick888

I've only just discovered this bug. Happening for me on Windows 10 Pro 22H2 x64 and qBittorrent v4.6.5.

kiwichick888 avatar Jun 29 '24 04:06 kiwichick888