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

Quick switch #11

Open
mottosso opened this issue Apr 29, 2017 · 13 comments
Open

Quick switch #11

mottosso opened this issue Apr 29, 2017 · 13 comments

Comments

@mottosso
Copy link
Contributor

Goal

Save time browsing for assets.

Implemenation

Mimic the Windows Explorer mechanism of browsing to an arbitrary level in any of the currently selected levels.

image

@BigRoy
Copy link
Contributor

BigRoy commented Oct 29, 2017

Does this mean clicking on "assets" and directly going there? Or do you mean the pop-up list when clicking on the arrows in-between?

I'm looking for the first actually and tried adding index in the controller.pop() for the Breadcrumbs.qml (which is a QML Repeater) but somehow the index is always 1. Any idea how to pass to Python what index or button is pressed of the repeater?

@mottosso
Copy link
Contributor Author

I mean both, but the former is a good first step.

As for how to go about it, if you mean this controller.pop() then I think you're on the right track. But it might not be an integer, but a QModelIndex. You'll need to tell the slot to accept QModelIndex here as well. Then you can get the integer index via index.row().

@BigRoy
Copy link
Contributor

BigRoy commented Oct 30, 2017

According to this page the following would show it just as integers:

Column {
    Repeater {
        model: 10
        Text { text: "I'm item " + index }
    }
}

So I'd expect them to be integers. I was able to have it also print the index, it would just always be the integer 1 somehow.

@mottosso
Copy link
Contributor Author

Possibly. In that case, it should work.

@BigRoy
Copy link
Contributor

BigRoy commented Oct 30, 2017

Possibly. In that case, it should work.

That's what I assumed, but for each button - no matter which I clicked it - it was giving me a value of one. Maybe I'll have another stab at this soon. :)

@BigRoy
Copy link
Contributor

BigRoy commented Nov 10, 2017

Regarding this:

onClicked: controller.pop()

Ok, so I think I see what the issue is. The index in that scope in the QML file is probably from the Delegate. I need to somehow bring along (in QML) the index from the scope above it (the Repeater) into the delegate (the Toolbox).

@mottosso
Copy link
Contributor Author

Hm, the delegate is a ToolButton, and it's got no index member. Try model.index to explicitly refer to the delegate's model.

@BigRoy
Copy link
Contributor

BigRoy commented Nov 10, 2017

Actually. @aardschok is working on this now and we're getting to something functional now. I must have missed adding int to the Slot when I tried this before.

Cool stuff coming up soon.

@aardschok
Copy link
Collaborator

Solution was to give the Slot decorator and the method controller.pop an int argument. In the Breadcrumbs qml file we needed to give the index to controller.pop of the repeater.

See #22

@ruchitinfushion
Copy link

Right now breadcrumbs navbar can jump only to current index -1, right ?
Let say user trail is " batman > assets > bruce > modeling", After this if user click on batman then QListView will set to "anim, layout, lookdev,etc" instead of "assets,film".

@tokejepsen
Copy link
Collaborator

Pretty sure the quick switch has been implemented?

@BigRoy
Copy link
Contributor

BigRoy commented Oct 29, 2018

Yes, should be with: #22

We have it working on our Launcher at least, and I believe it's merged into here too.

@davidlatwe
Copy link
Collaborator

Supplying evidence GIF

launcher_quick_switch

🍻

tokejepsen pushed a commit to tokejepsen/launcher that referenced this issue Oct 23, 2019
…er_update

Feature/pype 310 launcher update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants