memesearch
Centering the Hour Model

Centering the Hour Model

Download Find similar pictures
Text on the meme
111 onCurrentIndexChanged: { 112 var centerIndex = model.count / 2 113 if (currentIndex > centerIndex) { 114 for (var i = 0; i < currentIndex - centerIndex; ++i) { 115 hourModel.append(hourModel.get(0)) 116 hourModel.remove(0) 117 } 118 } else { 119 for (var i = 0; i < centerIndex - currentIndex; ++i) { 120 hourModel.insert(0, hourModel.get(hourModel.count - 1)) 121 hourModel.remove(hourModel.count - 1) 122 } 123 } 124 currentIndex = centerIndex 125 }
What it means

A screenshot of code handling a change to the current index by repeatedly moving items in an hour model until the selected item reaches the center. The joke is the overly manual, loop-based approach to rotating a list, making it relatable to programmers dealing with awkward UI logic or legacy code. EN: A screenshot of code handling a change to the current index by repeatedly moving items in an hour model until the selected item reaches the center. The joke is the overly manual, loop-based approach to rotating a list, making it relatable to programmers dealing with awkward UI logic or legacy code.

Objects
Tags
Source
Type
image
Size
800×367 · 45.7 KiB
Mood
sarcastic, relatable
Language
en
Added