<table><tr><td style="">dfaure added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D28675">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
color: #6B748C;
font-style: italic;
margin: 4px 0 12px 0;
padding: 8px 12px;
background-color: #F8F9FC;">
<div style="font-style: normal;
padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D28675#645733" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D28675#645733</a>, <a href="https://phabricator.kde.org/p/ahmadsamir/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@ahmadsamir</a> wrote:</div>
<div style="margin: 0;
padding: 0;
border: 0;
color: rgb(107, 116, 140);"><p>A tooltip isn't good enough here?</p></div>
</blockquote>
<p>I don't know. I don't claim to be a UI expert.<br />
But for instance your lineedit could filter on the comment as well, to help the user locate a mimetype based on a keyword in its description. If it's "hidden" in a tooltip then that doesn't really work.<br />
This allows user to use words in their own language for that search (e.g. "lecteur audio" when looking for x-content/audio-player)<br />
Or imagine looking for "3D Studio" files for instance -- but I can see how finding by extension is the most useful way, users know those are called *.3ds.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>but I haven't set in lines in the sand about that column, bringing it back should be easy.</p></blockquote>
<p>I think filtering *is* a great reason to bring it back.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>it seemed easier (less work :)) to use an existing model rather than sub-classing.</p></blockquote>
<p>Certainly.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>So what you're saying here is that sub-classing QAbstractItemModel is better; I'll try that, but I am curious about why a sub-class is better than using QStandardItemModel (are there any docs/blogs... etc about that?)</p></blockquote>
<p>I'm used to explaining it at length as a professional Qt trainer, but I don't really know all about online resources ;)</p>
<p>Yes, for anything above trivial sizes (like 10 items), subclassing QAbstractItemModel is generally better.<br />
With QStandardItemModel (or Q*WidgetItem) you're *copying* the data into the model. In general that data is then twice in memory, once in the underlying application-specific data structures and once in the model. QStrings are cheap to copy, but when thinking about non-readonly models, it also means the two things need to be kept in sync.</p>
<p>Here the situation is a bit different, though. First it's readonly, and second, the data comes from a temporary QMimeDatabase instance (which reads and converts from a mmaped file, it doesn't *store* QStrings in memory). So the underlying data actually goes away, we don't actually have real duplication in memory.<br />
Therefore this is one case where I cannot argue against QStandardItemModel ;)<br />
It is just slightly more heavy (map of variants) than a simple model that would store 4 strings per node.<br />
But the amount of code required for a custom tree model is, I think, not worth it here.<br />
Let's go with QStandardItemModel. This dialog doesn't even stay in memory very long anyway.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R236 KWidgetsAddons</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28675">https://phabricator.kde.org/D28675</a></div></div><br /><div><strong>To: </strong>ahmadsamir, Frameworks, cfeck, dfaure<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns<br /></div>