title: How to move rows in Qt (in QTableWidget)
body: <p>It's really a shame that Qt devs skipped this really important part of a table... <strong>moving rows</strong> (probably the selected ones) with checks for collision and support for selections with gaps - now one has to implement it himself.</p>
  
  <p>Luckily I spent pretty much the whole day creating such, <strong>self-contained function</strong> that can be easily modified to move anything related to tables/lists (currently it moves <strong><em>selected items</em></strong> - second line). And a more interesting part, I was able to easily (with about 3 lines more) add support for a direction argument instead of a separate function.</p>
  
  <p>I haven't thought about it, but moving by more than 1 item at a time could be possible aswell - though I have no need for that.</p>
  
  <p>Any suggestions and bug-testing is appreciated <em>~~enjoy</em>.</p>