<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><id>tag:chamildz.blog.co.uk,2009-11-12:/</id><title>chamil</title><link rel="self" href="http://chamildz.blog.co.uk/feed/atom/posts/"/><link rel="alternate" type="text/html" href="http://chamildz.blog.co.uk/"/><generator version="1.0">MokoFeed</generator><updated>2009-11-12T08:47:15+01:00</updated><entry><id>tag:chamildz.blog.co.uk,2007-07-26:/2007/07/26/good_bye_mfc_throwing_mfc_out_of_windows~2704697/</id><title>Good Bye MFC!! (Throwing MFC Out of Windows)</title><link rel="alternate" type="text/html" href="http://chamildz.blog.co.uk/2007/07/26/good_bye_mfc_throwing_mfc_out_of_windows~2704697/"/><author><name>cham1983</name></author><published>2007-07-26T13:04:13+02:00</published><updated>2007-07-26T13:04:13+02:00</updated><content type="html">	
&lt;p&gt;For years, Qt has advertised itself as a better MFC than MFC. Thanks to the Qt 4 Visual Studio Integration, it is now easier than ever for a Windows developer to develop cross-platform, high-performance &lt;span class="i"&gt;C++&lt;/span&gt; graphical user interface applications from his favorite IDE. &lt;/p&gt;
	&lt;p&gt;Qt is a C++ application development framework developed by Trolltech, a Norwegian software company. While Qt mainly focuses on enabing the development of graphical user interfaces, it also provides excellent support for networking, multithreading, &lt;span class="i"&gt;SQL&lt;/span&gt; operations (including &lt;span class="i"&gt;ODBC&lt;/span&gt;), &lt;span class="i"&gt;XML&lt;/span&gt;, and &lt;span class="i"&gt;Unicode.&lt;/span&gt;&lt;/p&gt;
	&lt;p&gt;For Windows developers, Qt offers the following advantages:&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;*&lt;/span&gt;&lt;span class="b"&gt;Enhanced C++performance.&lt;/span&gt; Qt is written in C/C++ (with parts in assembly language) and is highly-optimized to minimize memory usage and maximize speed. Applications based on Qt are native, compiled C++ applications that outperform those applications developed with &lt;span class="i"&gt;Java&lt;/span&gt; and &lt;span class="i"&gt;C#.&lt;/span&gt;&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;*&lt;/span&gt;&lt;span class="b"&gt;Stability.&lt;/span&gt; Since its introduction in 1995, Qt has been actively developed and maintained by Trolltech. The current version, &lt;span class="i"&gt;Qt 4.1,&lt;/span&gt; was released in December 2005 and supports advanced features, such as semi-transparent controls, antialiased drawing, and bidirectional text rendering.&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;*&lt;/span&gt;&lt;span class="b"&gt;Ease of use.&lt;/span&gt; Qt has a clean, object-oriented, C++ design, and provides a powerful &lt;span class="i"&gt;signal and slot&lt;/span&gt; mechanism similar to C#&amp;rsquo; s events and delegates. Signals and slots are flexible, fully object-oriented and implemented in C++ through a separate tool called moc (the meta-object compiler).&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;*&lt;/span&gt;&lt;span class="b"&gt;Portability.&lt;/span&gt; Qt provides a uniform application programming interface for Microsoft Windows, from &lt;span class="i"&gt;Windows 98&lt;/span&gt; to &lt;span class="i"&gt;Windows XP, Mac OS X, Linux, Solaris, HP-UX, IRIX, AIX,&lt;/span&gt; and many other &lt;span class="i"&gt;Unix&lt;/span&gt; variants. Qt&amp;rsquo;s" write once, compile everywhere" philosophy lets you develop applications on Windows and deploy them later on other platforms.&lt;/p&gt;
	&lt;p&gt;Internally, Qt emulates the various platforms&amp;rsquo; controls using platform-specific APIs such as &lt;span class="i"&gt;GDI+&lt;/span&gt; and the Windows XP theming engine. This enables Qt to accurately reproduce the look-and-feel of each supported platform, and allows programmers to extend or customize Qt&amp;rsquo;s built-in controls by re-implementing virtual functions. It&amp;rsquo;s even possible to implement a custom style to give all controls a custom look-and-feel, and to distribute it as a plug-in.&lt;/p&gt;
	&lt;p&gt;Although Qt is cross-platform, it includes a few Windows-specific modules, notably an MFC-to-Qt migration framework and a COM/ActiveX integration (to create and embed ActiveX controls). Today, Qt is used by companies as diverse as AT&amp; T, IBM, NASA and Xerox, and mass-market applications such as Adobe Photoshop Album and Google Earth are developed using it. In addition, the open source edition of Qt is the foundation of KDE, one of the two major Linux/Unix desktop environments.&lt;/p&gt;
	&lt;p class="subhead"&gt;Overview of the Qt 4 Visual Studio Integration&lt;/p&gt;
	&lt;p&gt;The Visual Studio integration, introduced with Qt 4.0, takes advantage of Visual Studio&amp;rsquo;s highly extensible architecture to make C++ application development on Windows faster, easier, and more intuitive than ever before. The integration includes the following features:&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;*&lt;/span&gt;&lt;span class="b"&gt;Fully integrated form editor with layout support.&lt;/span&gt; Since version 2.2, Qt includes a powerful visual user interface design tool called &lt;span class="i"&gt;Qt Designer,&lt;/span&gt; with support for automatic layouts and dynamic, XML-based user interfaces. The integration encapsulates Qt Designer in Visual Studio, with Qt properties displayed in the standard Property Browser (see &lt;span class="i"&gt;Figure One&lt;/span&gt;).&lt;/p&gt;
	
&lt;span class="callout"&gt;FIGURE ONE:&lt;/span&gt; &lt;span class="caption"&gt;The integrated form editor&lt;/span&gt;
&lt;a href="http://www.linux-mag.com/images/2006-12/qt/vs_14.jpg" class="story_image"&gt;&lt;img class="story_image" src="http://www.linux-mag.com/images/2006-12/qt/vs_14.jpg" alt="" width="440" height="308"&gt;&lt;/a&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;*&lt;/span&gt;&lt;span class="b"&gt;Wizards for creating new Qt projects.&lt;/span&gt; The wizards let you specify the Qt modules you want to use and generate skeleton classes to get you started (see Figure 2).&lt;/p&gt;
	
&lt;span class="callout"&gt;FIGURE TWO:&lt;/span&gt; &lt;span class="caption"&gt;The Qt Application wizard&lt;/span&gt;
&lt;a href="http://www.linux-mag.com/images/2006-12/qt/vs_03.jpg" class="story_image"&gt;&lt;img class="story_image" src="http://www.linux-mag.com/images/2006-12/qt/vs_03.jpg" alt="" width="440" height="313"&gt;&lt;/a&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;*&lt;/span&gt;&lt;span class="b"&gt;Automated build setup for Qt-specific build steps.&lt;/span&gt; Qt includes three tools that generate C++ code behind the scenes: &lt;span class="i"&gt;moc&lt;/span&gt; (the meta-object compiler), &lt;span class="i"&gt;uic&lt;/span&gt; (the user interface compiler), and &lt;span class="i"&gt;rcc&lt;/span&gt; (the resource compiler). These are invoked automatically by the integration when necessary.&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;*&lt;/span&gt;&lt;span class="b"&gt;An integrated resource management system.&lt;/span&gt; Adding new resources to a Qt project is comparable to adding resources to a standard C++ project. The main difference is that cross-platform &lt;span class="i"&gt;.qrc&lt;/span&gt; files (Qt resource files) are used rather than Windows &lt;span class="i"&gt;.rc&lt;/span&gt; files.&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;*&lt;/span&gt;Integrated Qt documentation. Qt&amp;rsquo;s comprehensive API documentation is integrated with the Visual Studio online help (see &lt;span class="i"&gt;Figure Three&lt;/span&gt;).&lt;/p&gt;
	
&lt;span class="callout"&gt;FIGURE THREE:&lt;/span&gt; &lt;span class="caption"&gt;The Qt reference documentation&lt;/span&gt;
&lt;a href="http://www.linux-mag.com/images/2006-12/qt/vs_12.jpg" class="story_image"&gt;&lt;img class="story_image" src="http://www.linux-mag.com/images/2006-12/qt/vs_12.jpg" alt="" width="400" height="293"&gt;&lt;/a&gt;
	&lt;p class="subhead"&gt;A Regular Expression Tester&lt;/p&gt;
	&lt;p&gt;To illustrate how the Visual Studio integration works, let&amp;rsquo;s create a very small application to let the user try a regular expression against a string. The application, depicted in &lt;span class="i"&gt;Figure Four,&lt;/span&gt; is a dialog box with three &lt;span class="i"&gt;QLabels,&lt;/span&gt; three &lt;span class="i"&gt;QLineEdits,&lt;/span&gt; and two &lt;span class="i"&gt;QPushButtons.&lt;/span&gt; The user can enter a regular expression pattern and some text on which the regular expression is run; the part of the text that matches is shown in the bottom-most QLineEdit.&lt;/p&gt;
	
&lt;span class="callout"&gt;FIGURE FOUR:&lt;/span&gt; &lt;span class="caption"&gt;RegExpTester application&lt;/span&gt;
&lt;a href="http://www.linux-mag.com/images/2006-12/qt/vs_11.jpg" class="story_image"&gt;&lt;img class="story_image" src="http://www.linux-mag.com/images/2006-12/qt/vs_11.jpg" alt="" width="213" height="149"&gt;&lt;/a&gt;
	&lt;p&gt;The first step is to create a skeleton project. Invoke the New Project dialog in Visual Studio and click the Qt Projects folder (see &lt;span class="i"&gt;Figure Five&lt;/span&gt;). Next, select the Qt Application item and type" RegExpTexter" as the project name. This pops up the wizard shown in &lt;span class="i"&gt;Figure Two.&lt;/span&gt;&lt;/p&gt;
	
&lt;span class="callout"&gt;FIGURE FIVE:&lt;/span&gt; &lt;span class="caption"&gt;Creating a new Qt project&lt;/span&gt;
&lt;a href="http://www.linux-mag.com/images/2006-12/qt/vs_01.jpg" class="story_image"&gt;&lt;img class="story_image" src="http://www.linux-mag.com/images/2006-12/qt/vs_01.jpg" alt="" width="440" height="319"&gt;&lt;/a&gt;
	&lt;p&gt;The wizard includes a page to specify which Qt modules you want to link against, followed by a page that enables you to specify the name of the skeleton class to be generated by the wizard. For this example, change the base class of the generated class so that it&amp;rsquo;s QDialog, not QMainWindow, because the application is a simple dialog-style application with no menus or toolbars.&lt;/p&gt;
	&lt;p&gt;We&amp;rsquo;ll now design the dialog using the integrated Qt Designer form editor. To invoke the form editor, we click on the regexptester.ui file in the Visual Studio Solution Explorer. Then we drag the controls we need from the Qt Toolbox onto the form and position them approximately as shown in Figure 6. (Qt&amp;rsquo;s layout system will lay them out precisely later on.)&lt;/p&gt;
	
&lt;span class="callout"&gt;FIGURE SIX:&lt;/span&gt; &lt;span class="caption"&gt;Placing controls on a form&lt;/span&gt;
&lt;a href="http://www.linux-mag.com/images/2006-12/qt/vs_04.jpg" class="story_image"&gt;&lt;img class="story_image" src="http://www.linux-mag.com/images/2006-12/qt/vs_04.jpg" alt="" width="440" height="322"&gt;&lt;/a&gt;
	&lt;p&gt;The next step is to edit the controls&amp;rsquo; properties using the Property Browser. &lt;span class="i"&gt;Table One&lt;/span&gt; lists the properties that need to be set.&lt;/p&gt;
	
&lt;span class="callout"&gt;TABLE ONE:&lt;/span&gt; &lt;span class="caption"&gt;Setting the controls&amp;rsquo; properties&lt;/span&gt;
	


Control
	Property
	Value

	
First label
	ObjectName
	&amp;ldquo;patternLabel&amp;rdquo;

	
 
	Text
	&amp;ldquo;Pattern:&amp;rdquo;

	
Second label
	ObjectName
	&amp;ldquo;textLabel&amp;rdquo;

	
 
	Text
	&amp;ldquo;Text:&amp;rdquo;

	
Third label
	ObjectName
	&amp;ldquo;resultLabel&amp;rdquo;

	
 
	Text
	&amp;ldquo;Result:&amp;rdquo;

	
First line edit
	ObjectName
	&amp;ldquo;patternLineEdit&amp;rdquo;

	
Second line edit
	ObjectName
	&amp;ldquo;textLineEdit&amp;rdquo;

	
Third line edit
	ObjectName
	&amp;ldquo;resultLineEdit&amp;rdquo;

	
 
	Editable
	false

	
First button
	ObjectName
	&amp;ldquo;resetButton&amp;rdquo;

	
 
	Text
	&amp;ldquo;Reset&amp;rdquo;

	
Second button
	ObjectName
	&amp;ldquo;closeButton&amp;rdquo;

	
 
	Text
	&amp;ldquo;Close&amp;rdquo;




	&lt;p&gt;You need to add layouts to the form to make it look better and to make it resizable. First, add a horizontal layout to position the Reset and Close buttons side by side. You also need a spacer to push the buttons to the right of the layout. To add a spacer, drag the Vertical Spacer item from the Qt Toolbox onto the form, next to the push buttons. Then select the spacer and the buttons and click Form Editor|Layout Horizontally from the Qt entry in the menu bar.&lt;/p&gt;
	&lt;p&gt;The entire window also needs a layout that will take care of positioning the other controls as well as the button sub-layout. To add this layout, select the labels, the line edits, and the button layout, then click Form Editor&amp; gt; Layout in a Grid. This gives the form shown in &lt;span class="i"&gt;Figure Seven.&lt;/span&gt;&lt;/p&gt;
	
&lt;span class="callout"&gt;FIGURE SEVEN:&lt;/span&gt; &lt;span class="caption"&gt;The form with layouts&lt;/span&gt;
&lt;a href="http://www.linux-mag.com/images/2006-12/qt/vs_07.jpg" class="story_image"&gt;&lt;img class="story_image" src="http://www.linux-mag.com/images/2006-12/qt/vs_07.jpg" alt="" width="214" height="123"&gt;&lt;/a&gt;
	&lt;p&gt;Qt&amp;rsquo;s layouts automatically assign reasonable positions and sizes to the controls they are responsible for, based on their needs. This is especially useful in internationalized applications: With fixed sizes and positions, the translation text is often truncated; with layouts, the child widgets are automatically resized. Layouts can also run right-to-left, to accommodate languages such as Arabic and Hebrew.&lt;/p&gt;
	&lt;p&gt;You can click Form Editor&amp; gt; Preview Form at any time to preview the form without compiling it. If you build the application now, the result is the dialog depicted in &lt;span class="i"&gt;Figure Four.&lt;/span&gt;&lt;/p&gt;
	&lt;p&gt;However, the dialog is inoperative. Let&amp;rsquo;s start by making the Close button work. You can connect the button&amp;rsquo;s &lt;span class="c"&gt;clicked()&lt;/span&gt; signal to the form&amp;rsquo;s &lt;span class="c"&gt;accept()&lt;/span&gt; slot. This can be done through the form editor.&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;1.&lt;/span&gt;Click the Edit Connections toolbar button to enter the connection mode.&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;2.&lt;/span&gt;Click the form&amp;rsquo;s Close button and hold the left mouse button pressed, then move the cursor to an empty area of the form and release the mouse button (see &lt;span class="i"&gt;Figure Eight&lt;/span&gt;). This invokes the Configure Connection dialog, which lists the available signals and slots.&lt;/p&gt;
	&lt;p&gt;&lt;span class="enumeration"&gt;3.&lt;/span&gt;Choose the &lt;span class="c"&gt;clicked()&lt;/span&gt; signal and the &lt;span class="c"&gt;accept()&lt;/span&gt; slot and click OK.&lt;/p&gt;
	
&lt;span class="callout"&gt;FIGURE EIGHT:&lt;/span&gt; &lt;span class="caption"&gt;Connecting a signal to a slot visually&lt;/span&gt;
&lt;a href="http://www.linux-mag.com/images/2006-12/qt/vs_09.jpg" class="story_image"&gt;&lt;img class="story_image" src="http://www.linux-mag.com/images/2006-12/qt/vs_09.jpg" alt="" width="215" height="123"&gt;&lt;/a&gt; &lt;a href="http://www.linux-mag.com/images/2006-12/qt/vs_10.jpg" class="story_image"&gt;&lt;img class="story_image" src="http://www.linux-mag.com/images/2006-12/qt/vs_10.jpg" alt="" width="386" height="221"&gt;&lt;/a&gt;
	&lt;p&gt;Qt controls emit" signals" when state changes take place, for example when the text changes in a line edit, or when a new item is selected in a list box. These signals can be" connected" to slots (member functions), so that when a signal is emitted, any slots it is connected to are called. Controls that are connected to one another are independent components since they don&amp;rsquo;t need to know anything about each other.&lt;/p&gt;
	&lt;p&gt;If you build and run the application now, the Close button closes the window and causes the application to terminate.&lt;/p&gt;
	&lt;p class="subhead"&gt;More Fun With Dialogs&lt;/p&gt;
	&lt;p&gt;Let&amp;rsquo;s continue and implement the rest of the dialog functionality. The contents of the Result line need to be updated whenever the user edits the text in one of the two other line edits. This is achieved by adding a slot called &lt;span class="c"&gt;updateResult()&lt;/span&gt; to the form and by connecting the two line edits&amp;rsquo; &lt;span class="c"&gt;textChanged()&lt;/span&gt; signals to that slot. The signals are emitted whenever the text changes; the connection ensures that the slot is invoked to recompute the Result line edit&amp;rsquo;s contents based on the new text in the Pattern and Text fields.&lt;/p&gt;
	&lt;p&gt;For that, you must edit the &lt;span class="i"&gt;regexptester.h&lt;/span&gt; and &lt;span class="i"&gt;regexptester.cpp&lt;/span&gt; files that were generated by the Qt Application wizard. &lt;span class="i"&gt;Listing One&lt;/span&gt; shows the header file after adding the slot declaration. Notice the particular syntax for declaring a slot; this is Qt-specific and is converted into standard C++ by the C++ preprocessor.&lt;/p&gt;
	
&lt;span class="callout"&gt;LISTING ONE:&lt;/span&gt; &lt;span class="caption"&gt;The form&amp;rsquo;s header file&lt;/span&gt;
#ifndef REGEXPTESTER_H&lt;br&gt;#define REGEXPTESTER_H&lt;/p&gt;
	&lt;p&gt;#include &lt;br&gt;#include "ui_regexptester.h"&lt;/p&gt;
	&lt;p&gt;class RegExpTester : public QDialog&lt;br&gt;{&lt;br&gt;Q_OBJECT&lt;/p&gt;
	&lt;p&gt;public:&lt;br&gt;RegExpTester(QWidget *parent = 0, Qt::WFlags flags = 0);&lt;br&gt;~RegExpTester();&lt;/p&gt;
	&lt;p&gt;private slots:&lt;br&gt;void updateResult();&lt;/p&gt;
	&lt;p&gt;private:&lt;br&gt;Ui::RegExpTesterClass ui;&lt;br&gt;};&lt;/p&gt;
	&lt;p&gt;#endif // REGEXPTESTER_H
	&lt;p&gt;The &lt;span class="c"&gt;RegExpTester&lt;/span&gt; class inherits from &lt;span class="c"&gt;QDialog&lt;/span&gt; (the class you specified in the project wizard) and represents the entire dialog.&lt;/p&gt;
	&lt;p&gt;The first unusual thing to notice about the class definition is the &lt;span class="c"&gt;Q_OBJECT&lt;/span&gt; macro. This signifies that the class has some Qt extensions to C++ that will be discussed shortly. The private slots are private member functions that can also be called by Qt&amp;rsquo;s signals and slots mechanism.&lt;/p&gt;
	&lt;p&gt;The header file includes a file called &lt;span class="i"&gt;ui_regexptester.h.&lt;/span&gt; That file is generated by the &lt;span class="i"&gt;uic&lt;/span&gt; program based on the &lt;span class="i"&gt;regexptester.ui,&lt;/span&gt; an XML file that stores the form we designed using the form editor. The &lt;span class="i"&gt;uic-&lt;/span&gt; generated &lt;span class="i"&gt;ui_regexptester.h&lt;/span&gt; file declares a class called &lt;span class="c"&gt;Ui::RegExpTester&lt;/span&gt;. In the private section of the &lt;span class="c"&gt;RegExpTester&lt;/span&gt; class, there is a member variable of type &lt;span class="c"&gt;Ui::RegExpTester&lt;/span&gt; called &lt;span class="c"&gt;ui&lt;/span&gt;.&lt;/p&gt;
	&lt;p&gt;The updateResult() slot needs to be implemented and connected to the Pattern and Text line edit&amp;rsquo;s textChanged() signals. This is done in the regexptester.cpp file, listed in &lt;span class="i"&gt;Listing Two.&lt;/span&gt; Again, the code that needs to be added to the wizard-generated skeleton is shown in bold.&lt;/p&gt;
	
&lt;span class="callout"&gt;LISTING TWO:&lt;/span&gt; &lt;span class="caption"&gt;The form&amp;rsquo;s source file&lt;/span&gt;
#include "regexptester.h"&lt;/p&gt;
	&lt;p&gt;RegExpTester::RegExpTester(QWidget *parent, Qt::WFlags flags)&lt;br&gt;: QDialog(parent, flags)&lt;br&gt;{&lt;br&gt;ui.setupUi(this);&lt;br&gt;connect(ui.patternLineEdit, SIGNAL(textChanged(QString)),&lt;br&gt;this, SLOT(updateResult()));&lt;br&gt;connect(ui.textLineEdit, SIGNAL(textChanged(QString)),&lt;br&gt;this, SLOT(updateResult()));&lt;br&gt;}&lt;/p&gt;
	&lt;p&gt;RegExpTester::~RegExpTester()&lt;br&gt;{&lt;br&gt;}&lt;/p&gt;
	&lt;p&gt;void RegExpTester::updateResult()&lt;br&gt;{&lt;br&gt;QRegExp regExp(ui.patternLineEdit-&gt;text());&lt;br&gt;if (regExp.indexIn(ui.textLineEdit-&gt;text()) != -1)&lt;br&gt;ui.resultLineEdit-&gt;setText(regExp.cap(0));&lt;br&gt;else&lt;br&gt;ui.resultLineEdit-&gt;setText("");&lt;br&gt;}
	&lt;p&gt;The constructor calls &lt;span class="c"&gt;setupUi()&lt;/span&gt; on the &lt;span class="c"&gt;Ui::RegExpTester&lt;/span&gt; object to create the form&amp;rsquo;s controls and layouts. Then, the Pattern line edit&amp;rsquo;s &lt;span class="c"&gt;textChanged()&lt;/span&gt; signal is connected to the &lt;span class="c"&gt;updateResult()&lt;/span&gt; slot. The same is done with the Text line edit.&lt;/p&gt;
	&lt;p&gt;In the &lt;span class="c"&gt;updateResult()&lt;/span&gt; slot, the regular expression pattern is applied to the specified text. If the regular expression matches, the matched text is shown in the Result line edit; otherwise, it shows"&amp; lt;no match&amp; gt;".&lt;/p&gt;
	&lt;p&gt;The dialog is almost fully functional. The only remaining issue is that the Reset button still does nothing. The solution is to add a &lt;span class="c"&gt;reset()&lt;/span&gt; slot and connect it to the Reset button&amp;rsquo;s &lt;span class="c"&gt;clicked()&lt;/span&gt; signal in the constructor. The slot is implemented as follows:&lt;/p&gt;
void RegExpTester::reset()&lt;br&gt;&lt;br&gt;{&lt;br&gt;&lt;br&gt;   ui.patternLineEdit-&gt;clear();&lt;br&gt;&lt;br&gt;   ui.textLineEdit-&gt;clear();&lt;br&gt;&lt;br&gt;   updateResult();&lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;br&gt;	&lt;p&gt;This completes the small sample application. But what about &lt;span class="c"&gt;Q_OBJECT&lt;/span&gt;, private slots, and other Qt keywords? The C preprocessor turns them all into pure C++ so the compiler never sees them. The machinery to handle Qt&amp;rsquo;s extensions is generated behind the scenes by &lt;span class="i"&gt;moc&lt;/span&gt;, which reads your source files and generates some additional source files to implement what we&amp;rsquo;ve used.&lt;/p&gt;
	&lt;p class="subhead"&gt;Goodbye, MFC&lt;/p&gt;
	&lt;p&gt;Microsoft is giving up MFC and is preparing to replace its successor, Windows Forms, with the Avalon framework. The uncertainty surrounding these three APIs has alienated many Windows developers, who are now looking at Qt as a more stable alternative.&lt;/p&gt;
	&lt;p&gt;With the Qt 4 Visual Studio Integration, a Windows developer can easily leverage his or her existing C++ skills to develop cross-platform, high-performance object-oriented, GUI applications&lt;/p&gt;

&lt;p&gt; &lt;small&gt; &lt;a href="http://chamildz.blog.co.uk/2007/07/26/good_bye_mfc_throwing_mfc_out_of_windows~2704697/#comments"&gt;Comments&lt;/a&gt; &lt;/small&gt; &lt;/p&gt;</content></entry></feed>
