QT Questions.


[Enter Post Title Here]


1.What is a project file? How can you produce one for your project?
· Projects are described by the contents of project (.pro) files. The information within these is used by qmake to generate a Makefile containing all the commands that are needed to build each project.
· you only need to run qmake [ a project-oriented system for managing the build process for applications, libraries, and other components] on this project file.
· By default, qmake generates a Makefile that you use to build the project, and you can run your platform's make tool to build the project.

2.What does the TEMPLATE variable mean in the qmake project file? What are possible values?

TEMPLATE variable contains the name of the template to use when generating the project. The allowed values are:

# app - Creates a Makefile for building applications (the default).
# lib - Creates a Makefile for building libraries
# subdirs - Creates a Makefile for building targets in subdirectories.
# vcapp - Windows only Creates an application project for Visual Studio.
# vclib - Windows only Creates a library project for Visual Studio

3.What is a Makefile? How can you produce a Makefile for your project?
. C++ applications are generally composed of many source files, header files, and external libraries.Keeping track of all of the parts of such a application requires a mechanism that precisely specifies the input files involved, the tools needed to build, the intermediate targets and their dependencies, and the final executable target.

The most widely used utility for handling the job of building a project is make.
make reads the details of the project specifications and the instructions for the compiler from a Makefile.

With Qt, it is not necessary to write Makefiles. Qt provides a tool called qmake to generate Makefiles.
Depending on the development environment, developers may use variants of make, such as mingw32-make, gmake, or unsermake ,nmake in MS Dev Studio.

4) What are the striking futures of QT?
 Events and EventFilters
Metaobject system-object communication mechanism,dynamic property system
Object properties
Object Trees
Signals and Slots
UIC,MOC
QPointer(Guarded pointers)
String Translation(Internationalization)

5)What is a QPointer?
The QPointer is a template class. QPointer .
QPointer  provides  guarded pointers to QObject.

QPointer label = new QLabel;

 QPointer is automatically set to 0 when the referenced object is destroyed(Normal  C++ pointers, will become "dangling pointers" in such cases).
T must be a subclass of QObject.
6)  Does assignment operators in Qt4 return deep or shallow copy?
Most objects in Qt implement copy-on-write mechanism. That means a shallow copy, this becomes a deep one as soon as you try to change it.



7)what is MVC architecture? How is it organized?

The MVC Architecture
MVC  lies at the core of most of the programming languages.Model, View, Controller architecture, usually just called MVC. 

MVC benefits include:
Isolation of business logic from the user interface
Ease of keeping code DRY
Making it clear where different types of code belong for easier maintenance

 Models
A model represents the information (data) of the application and the rules to manipulate that data, In most cases, one table in your database will correspond to one model in your application. Most of the application’s business logic will be concentrated in the models.
In Qt, the standard interface for model is defined by the QAbstractItemModel class.


Views
Views represent the user interface of your application.
Views handle the job of providing data to the web browser or other tool that is used to make requests from your application.
In Qt, the standard interface for model is defined by the QAbstractItemView class.

The separation of content and presentation is achieved by the use of a standard model interface provided by QAbstractItemModel, a standard view interface provided by QAbstractItemView,


Controllers – in Qt more responsible feature (Delegates)
Controllers provide the “glue” between models and views. Generally controllers are responsible for processing the incoming requests from the web browser, interrogating the models for data, and passing that data on to the views for presentation.
In Qt, the standard interface for controlling delegates is defined in the QAbstractItemDelegate class.