Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghost opened this issue Oct 28, 2023 · 37 comments
Closed

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

ghost opened this issue Oct 28, 2023 · 37 comments
Labels
Qt bugs Bug resides in Qt library

Comments

@ghost
Copy link

ghost commented Oct 28, 2023

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 ghost added the Feature request label Oct 28, 2023
@thalieht thalieht added Qt bugs Bug resides in Qt library and removed Feature request labels Oct 28, 2023
@thalieht
Copy link
Contributor

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 thalieht added the Waiting info Waiting for participants to supply more info/fulfill template requirements label Oct 28, 2023
@Ofunniku
Copy link

Ofunniku commented Oct 28, 2023

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.

@ghost
Copy link
Author

ghost commented Oct 28, 2023

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

@mahkitah
Copy link

I also see this on 4.5.3 which uses qt 6.5.1

@stalkerok
Copy link
Contributor

stalkerok commented Nov 27, 2023

also duplicate #18992

@101Dude
Copy link

101Dude commented Jan 9, 2024

@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
Copy link

101Dude commented Jan 9, 2024

@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
Copy link

101Dude commented Jan 9, 2024

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
Copy link

101Dude commented Jan 15, 2024

@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.

@glassez
Copy link
Member

glassez commented Jan 17, 2024

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.

@101Dude
Copy link

101Dude commented Jan 17, 2024

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

@glassez

This comment was marked as resolved.

@101Dude

This comment was marked as resolved.

@glassez

This comment was marked as resolved.

@thalieht
Copy link
Contributor

also duplicate #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 #19906 (comment) (possibly same trigger for another problem i mean)

Why are you guys talking about doing anything before we test with Qt 6.6.0+ #19810 (comment)? Maybe one of you have already tested?
(Why are we still stuck on Qt 6.4.3, what did i miss?)

@glassez
Copy link
Member

glassez commented Jan 18, 2024

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
Copy link
Member

glassez commented Jan 18, 2024

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.

@xavier2k6
Copy link
Member

xavier2k6 commented Jan 18, 2024

Qt 6.5 builds were causing crashes on macOS -> #19090 (comment)
(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, #18950 (comment)

@thalieht

This comment was marked as off-topic.

@101Dude
Copy link

101Dude commented Jan 19, 2024

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.

qbt.autoscroll720.mp4

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.

@thalieht
Copy link
Contributor

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

@stalkerok
Copy link
Contributor

2024-01-19.15-02-47.mp4

@101Dude
Copy link

101Dude commented Feb 9, 2024

@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!

@Lucane
Copy link

Lucane commented Mar 23, 2024

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).

@Dams-77
Copy link

Dams-77 commented Apr 15, 2024

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).

@101Dude
Copy link

101Dude commented Apr 15, 2024

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.

@Dams-77
Copy link

Dams-77 commented Apr 15, 2024

Thanks for the clarification 101Dude.

@rawesomeawesome
Copy link

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

@kiwichick888
Copy link

kiwichick888 commented Jun 29, 2024

@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
Copy link

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

@101Dude
Copy link

101Dude commented Jun 29, 2024

It appears devs don't want to remove this "feature" that is a part of Qt and well documented on the Qt website.

I have a screenshot of the exact pixel that doesn't cause the force scroll. If I move off this pixel, and click, the window scrolls to the left.

Screenshot 2024-06-29 at 12 37 55 PM

I am using

Qt: 6.4.3
Libtorrent: 1.2.19.0
Boost: 1.85.0
OpenSSL: 1.1.1w
zlib: 1.2.12

@glassez
Copy link
Member

glassez commented Jun 29, 2024

I have not noticed this problem with Qt 6.7.2. Can anyone confirm or deny?

@101Dude
Copy link

101Dude commented Jun 30, 2024

@glassez

I have tried building with Qt 6.7.2 for MacOS and running into trouble with the shell script I used a year ago.
Anyone know of any shell scripts that work for building on MacOS?

@glassez
Copy link
Member

glassez commented Jun 30, 2024

@glassez

I have tried building with Qt 6.7.2 for MacOS and running into trouble with the shell script I used a year ago. Anyone know of any shell scripts that work for building on MacOS?

macOS is not for me.

@101Dude
Copy link

101Dude commented Jun 30, 2024

@glassez @thalieht

Great news... no more auto scrolling!!!

I was able to build master using Qt 6.7.0 with the shell script linked to in the Wiki:
https://gist.github.com/Kolcha/3ccd533123b773ba110b8fd778b1c2bf

qBittorrent v4.6.5

Qt: 6.7.0
Libtorrent: 2.0.10.0
Boost: 1.85.0
OpenSSL: 3.3.0
zlib: 1.2.12

@kiwichick888
Copy link

Great news... no more auto scrolling!!!

I was able to build master using Qt 6.7.0 with the script linked to in the Wiki:

Fantastic!!! I have no idea how to build the master so hopefully your fix will be incorporated into some future version of qBT.

@thalieht
Copy link
Contributor

Great news... no more auto scrolling!!!

Great! Closing.

@xavier2k6 xavier2k6 removed the Waiting info Waiting for participants to supply more info/fulfill template requirements label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Qt bugs Bug resides in Qt library
Projects
None yet
Development

No branches or pull requests