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

Restoring of Tabs order #165

Closed
amuralev opened this issue Feb 9, 2021 · 4 comments
Closed

Restoring of Tabs order #165

amuralev opened this issue Feb 9, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request hard_to_do

Comments

@amuralev
Copy link

amuralev commented Feb 9, 2021

  1. Run example "kddockwidgets_example";
  2. Tabify at MainWindow "DockWidget #0", "DockWidget #1", "DockWidget #2"
    image
  3. Undock by mouse "DockWidget #1";
  4. Undock by mouse "DockWidget #2";
  5. Dock "DockWidget #1";
  6. Dock "DockWidget #2";

You can see that the order of tabs is different:
image

Is it possible to modify this behavior?
P.S.: QDockWidget support "correct" order of tabs-restoring.

Environment:

  1. Windows 10 (64bit);
  2. Qt 5.15.1 MSVC 2019 64bit;
  3. KDDW 1.1-1.3.
@iamsergio
Copy link
Contributor

I think so

@iamsergio iamsergio added the enhancement New feature or request label Feb 10, 2021
@iamsergio
Copy link
Contributor

It's a bit of a pickle, Dock2 only remembers it was at index 1

@iamsergio iamsergio self-assigned this May 3, 2021
@bbc131
Copy link
Contributor

bbc131 commented Feb 8, 2024

With the current version, I cannot reproduce @amuralev s issue.
The current functionality seems always to append the inserted dock to the end, which is why I end up with the desired order of 0, 1, 2 if I follow the description of @amuralev.

But I have the following question:
What if I have a specific order, which should always be obeyed.
With the example above (DockWidgets #0, #1 and #2), this would mean, if some of them are tabbed together #0 is always before #1 and #2. And #1 is always before #2.
So for example, there could be #0, #2 tabbed, but never #2, #0.

Is there a possibility to achieve this without touching the KDDockWidgets internals?
(The information for the order could be in the uniqueName.)

iamsergio added a commit that referenced this issue Jul 4, 2024
Allows the user to manipulate the tab index when dockwidget
is being redocked.

Fixes issue #165, or is at least the workaround we can manage.
@iamsergio
Copy link
Contributor

You can now pass a lambda and change the tabIndex before it's used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hard_to_do
Projects
None yet
Development

No branches or pull requests

3 participants