<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Model/View/Presenter and Qt?</title>
	<atom:link href="http://thesmithfam.org/blog/2009/09/27/model-view-presenter-and-qt/feed/" rel="self" type="application/rss+xml" />
	<link>http://thesmithfam.org/blog/2009/09/27/model-view-presenter-and-qt/</link>
	<description>Your blog is probably better than mine.</description>
	<lastBuildDate>Tue, 07 Sep 2010 02:05:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Dave</title>
		<link>http://thesmithfam.org/blog/2009/09/27/model-view-presenter-and-qt/comment-page-1/#comment-101714</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 29 Apr 2010 20:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=407#comment-101714</guid>
		<description>Another failing of this approach is that the presenter is not injectable and therefore not unit testable. In other words, the &quot;ui&quot; instance on which the presenter operates can not be faked in a unit test. This is one of the advantages to using model/view/presenter and Qt fails to make this possible without some serious work on the part of the developer.</description>
		<content:encoded><![CDATA[<p>Another failing of this approach is that the presenter is not injectable and therefore not unit testable. In other words, the &#8220;ui&#8221; instance on which the presenter operates can not be faked in a unit test. This is one of the advantages to using model/view/presenter and Qt fails to make this possible without some serious work on the part of the developer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: skerr</title>
		<link>http://thesmithfam.org/blog/2009/09/27/model-view-presenter-and-qt/comment-page-1/#comment-88634</link>
		<dc:creator>skerr</dc:creator>
		<pubDate>Tue, 29 Sep 2009 23:23:52 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=407#comment-88634</guid>
		<description>If you consider your widget subclass to be part of the view instead of the presenter and add another layer of indirection to be the presenter, then you implement the MVP pattern correctly.</description>
		<content:encoded><![CDATA[<p>If you consider your widget subclass to be part of the view instead of the presenter and add another layer of indirection to be the presenter, then you implement the MVP pattern correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://thesmithfam.org/blog/2009/09/27/model-view-presenter-and-qt/comment-page-1/#comment-88549</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Mon, 28 Sep 2009 18:22:02 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=407#comment-88549</guid>
		<description>Steve,

By your definition of MVC, Qt is definitely closer to MVP. Any updates from the model to the view must go through the widget subclass (what I&#039;m tentatively calling the presenter). You *can* connect signals from the model directly to the view, which is convenient, but it seems that most applications apply a little, ahem, presentation logic to the data first.

For example, if you have a QLabel in your view, and a model signal that emits textChanged(QString), you *can* connect your model&#039;s textChanged() signal directly to your QLabel&#039;s setText() slot. This is super convenient, but in practice, you almost always want to do stuff to the data before displaying it (like trim() it or capitalize it or apply some html formatting to it), necessitating a presentation layer between the model and view.

On another note, I am very interesting in seeing a Qt MVP implementation that has a totally decoupled view and presenter. Qt seems to encourage the two to be tightly coupled and 1:1 instead of 1:N in relationship.

--Dave</description>
		<content:encoded><![CDATA[<p>Steve,</p>
<p>By your definition of MVC, Qt is definitely closer to MVP. Any updates from the model to the view must go through the widget subclass (what I&#8217;m tentatively calling the presenter). You *can* connect signals from the model directly to the view, which is convenient, but it seems that most applications apply a little, ahem, presentation logic to the data first.</p>
<p>For example, if you have a QLabel in your view, and a model signal that emits textChanged(QString), you *can* connect your model&#8217;s textChanged() signal directly to your QLabel&#8217;s setText() slot. This is super convenient, but in practice, you almost always want to do stuff to the data before displaying it (like trim() it or capitalize it or apply some html formatting to it), necessitating a presentation layer between the model and view.</p>
<p>On another note, I am very interesting in seeing a Qt MVP implementation that has a totally decoupled view and presenter. Qt seems to encourage the two to be tightly coupled and 1:1 instead of 1:N in relationship.</p>
<p>&#8211;Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Kerr</title>
		<link>http://thesmithfam.org/blog/2009/09/27/model-view-presenter-and-qt/comment-page-1/#comment-88500</link>
		<dc:creator>Steven Kerr</dc:creator>
		<pubDate>Mon, 28 Sep 2009 03:57:40 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=407#comment-88500</guid>
		<description>If your Model does not know about your View, than you definitely have a Presenter, not a Controller. In the Model/View/Controller pattern, the Controller is a layer of indirection going from your View to your Model. The data flow looks like this: View-&gt;Controller-&gt;Model. But, a change in the Model would notify the view directly: Model-&gt;View. When the Controller also becomes a layer of indirection going from the Model to the View (Model-&gt;Controller-&gt;View), the Controller is then promoted to being a Presenter. Not only does it handle user input, but it now also &quot;presents&quot; data. Some will go so far as to keep their Controller and Presenter as separate classes. I personally have not seen a good enough gain in this to warrant the bloat. 
It looks to me that QT will promote unit testing, which is a big part of the pattern; but, the inability to replace a view without altering the presenter in any way does bring QT&#039;s adherence to the pattern into question for me.</description>
		<content:encoded><![CDATA[<p>If your Model does not know about your View, than you definitely have a Presenter, not a Controller. In the Model/View/Controller pattern, the Controller is a layer of indirection going from your View to your Model. The data flow looks like this: View-&gt;Controller-&gt;Model. But, a change in the Model would notify the view directly: Model-&gt;View. When the Controller also becomes a layer of indirection going from the Model to the View (Model-&gt;Controller-&gt;View), the Controller is then promoted to being a Presenter. Not only does it handle user input, but it now also &#8220;presents&#8221; data. Some will go so far as to keep their Controller and Presenter as separate classes. I personally have not seen a good enough gain in this to warrant the bloat.<br />
It looks to me that QT will promote unit testing, which is a big part of the pattern; but, the inability to replace a view without altering the presenter in any way does bring QT&#8217;s adherence to the pattern into question for me.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
