You Are Here:

Community: Wiki

This page was last modified on 24 November 2009, at 09:04.

Q OBJECT in Qt for Symbian

From Forum Nokia Wiki

(Redirected from Q OBJECT)
Reviewer Approved   


ID Creation date 29 December 2008
Platform S60 3rd Edition, S60 5th Edition Tested on devices Emulator
Category Qt for Symbian Subcategory


Keywords (APIs, classes, methods, functions): Q_OBJECT

Introduction

The Q_OBJECT macro at the beginning of the class definition is necessary for all classes that define signals, slots or uses a service provided by the meta-object system.

The QObject class is the base class for the object that uses the meta-object system (like signals and slots). Q_OBJECT enables the meta-object feature and it must be written without ';' at the end of line.

Forgetting Q_OBJECT is a common error among beginners. The class will not compile, and the compiler shows some errors about some methods missing in the table.

Preconditions

  • Download and Install latest version Qt for Symbian - Installation packages which has links on how to install the latest version.
  • The header file must included in the headers section of the .pro file otherwise linker errors will be result.

Code Snippet

#include <QObject>
class Counter: public QObject
{
Q_OBJECT
//some code here
};

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fHowE5ftoE5fuseE5fE51StringE5finE5fE51tE5fforE5fSymbianX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZE71tQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxE71tX qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ