Smooth scrolling in a QListView (or QAbstractItemView) - scroll

I have a QListView that displays square-shaped items. My problem is that when I scroll this list, it scrolls one entire row of squares at a time, and I think that doesn't look right. Instead, I would like the list to scroll 1 pixels or two at a time - i.e. smoothly. It's mostly a cosmetic change. Any idea how I would do that?

Ok I just found there's a property for that:
listView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
The other option, the default, is ScrollPerItem.

Tried your solution and it didn't work for me.
But it worked well when i added:
listView -> verticalScrollBar() -> setSingleStep(5);
Or something like that, sorry for mistakes if there are any, i'm writing in PyQt5:
listView.verticalScrollBar().setSingleStep(5)
Edit: oh, i haven't noticed the year of this answer...

Related

How to quickly snap a view in storyboard back into its constraints after accidentally moving it

Everything I have found, every one says this cant be done.
I studied in fullsail university and they taught me how to do this so I know without a doubt it can be done. No one just knows how and assumes it can't.
Basically, when in XCode-story board, I would add constraints to a view and everything is all blue and perfect. From there, if you click, hold a drag, the view to another position then all of the constraints will turn orange. (Not RED because the constraints are still good it just simply needs to snap back into place..)
When in school my teacher taught me a quick key short cut that you press and everything snaps back into place and its all blue again. It has been a while since I have coded and i am just now getting back into it again and i just cant remember what that shortcut was.
I hope someone out there knows how to do this. Maybe any fullsail graduates?
Your responses are greatly appreciated.
I figured it out.
option + CMND + '='
What you're looking to do is referred to as "Update(ing) Frames."
The quick command is indeed option-command-equals
The command can also be reached from the bottom menu of a storyboard.
This link may change in the future but check out the Auto Layout Guide. Specifically reference the "Resolve Auto Layout Issues Tool" section.

NSOutlineView MoveItemAtIndex Doesn't Animate

I have a (view-based) NSOUtlineView that is programatically fully functional with drag and drop - i.e. I've implemented all of the correct methods and everything seems to work fine. Everything, that is, except animations.
When I execute MoveItemAtIndex, the row movements do not animate. The row is moved however, because when I scroll up or down the view refreshes and the row is in its new place. I've confirmed that all of the input arguments are correct.
Furthermore, when I send an invalid "oldParent" item, the row insertion animation works correctly! And if I send an invalid "newParent" item, the row removal animation works correctly! Needless to say, this confuses me - am I missing something regarding the function of MoveItemAtIndex? There seem to precious little in the docs, everything seems to indicate that the animation should "just work".
I've tried with and without the beginUpdates/endUpdates, getting the same result each time.
To anyone's knowledge, is there something that is not documented or hard to find regarding these animations?
Thanks
I got caught with something similar with collection views. Try...
outlineView.animator().moveItem(...

wp7 list Peel animation

I am using List Peel animation as described here. Its working as expected but now I want to add the similar effect on onItemSelectionChanged event of the list box. The only difference is that this time, I want the selected item to leave the page at the very last. How can that be achieved?
Regards
I think that Clarity's turnstile with feather transition might be what you are looking for:
http://blogs.claritycon.com/blog/2010/10/13/wp7-page-transitions-sample/
I can't quite remember how it works... but I remember it did act on individual elements - it tried to work like the start menu.

Xcode: Method definition not found message on a non-existing method (?) + slight color change in XIB

I have two basic practical problems:
1) The first one is really stupid. I receive a message saying: "Method definition for 'aIncreasedSelection' not found, together with an "Incomplete Implementation".
Well, that is quite strange, because I don't have this method in neither my .m or .h file (and the class name is mentioned in the remark).
I used to implement this method, but I deleted it because it was redundant. In a certain way, it appears as if my Xcode project can't let go of the method...
2) The second question is also a very mysterious one. I have a couple of viewControllers in which I have put the identical same background, and the identical same buttons. It's really identical in size and position in the screen as well (I defined the pixels). For an unknown reason, when I switch between the views, one of the buttons changes very slightly its color (it is a Photoshop created button with mirror effect on the bottom, it's the mirror that becomes lighter). That is really annoying because it's supposed to be identical; when the user switches views now, he can see that there is a color difference in the button (supposed to be planted as a button in a dock, which should be identical over the entire app)...
Very frustrating as I cannot solve these small mistakes... Any ideas? Thanks!
Regarding your first problem, if you have verified that it no longer exists in your .h or .m file, try to cmd+shift+k and clean your project, then rebuild. This should update everything and in theory solve that issue for you.
As for the second problem, it sounds strange indeed. Is there any chance you could provide pictures somehow? Are you statically loading the image into similar buttons, or are you doing something differently?
Re - opening my project solved my first problem (unlike the refresh - cmd + shift + k, which didn't work). The color problem is not solved despite :-/
It was definitely a bug since I didn't change anything. It is in fact - very confusing!

Showing a list of events

Our site, http://www.racedayworld.com has events that you can register for which are listed in an accordion control by each month ..
I've been getting feedback that says people aren't looking past the first open month as they are not too familiar with the whole accordion thing ..
Can anyone post any suggestions on what type of control I could use that would work - I wanted to do something which wasn't just a normal boring table, but I haven't been really able to think of anything as of yet .. let me know if you have any suggestions..
How about a tree view, or something like the MacOS Finder? On the left a scrolling pane with each month, saying "January: 12 Events" or similar on each line. Then clicking that updates the right pane to a scrollable list of the events...
Done with unobtrusive javascript of course so it degrades nicely. No clues in your tags if you're doing this in Flash...
You might want to consider keeping the control and just do something to draw attention to it. For example, add a "swoopy" arrow that points to the second month with the words "click here for more events!". Just make sure you can disable that once someone expands that second month.

Resources