RSS
 

Archive for the ‘Qt’ Category

Improving Qt’s properties.

01 Jul

I have known Qt for about 9 years now. My first encounter with Qt was as a normal user who was exploring Linux to find out what the fuss was all about. With KDE I got my first experience of Qt. But I have only very recently started to use Qt as a development tool, and I have been very happy about that. Makes life easy, with Qt being ported to Symbian, Meego the gates are open for developers to make money. Since I like to experiment with all the platforms no matter who they are from, I also played around with Objective-C on iPhone some while ago.

While Qt offers many many nice features which make Objective-C look like from stone age. Objective-C has some nice features as well, one I mentioned in my previous post, which Qt already solves rather nicely and in a better way as one of the commenter pointed out. Objective-C and Qt are quite similar in a sense that they provide improvements on top of an already existing language. Qt with meta object compiler and Obj-C with something similar.

So back to the point, I now use Q_PROPERTY macro in my QObjects based classes a lot:

class Person : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName)

public:
void setName(const QString& aName) { iName = aName; }
QString name() const { return iName; }

private:
QString iName;
};

Now consider this Objective-C code:

// person.h
@interface Person : NSObject
{
NSString* name;
}
@property (nonatomic, retain) NSString* name; // same as Q_OBJECT 

// person.m:
@implementation Person
@synthesize name; // this generates getter/setter in the .m file

// rest of the code ...

So do you see what I see ? In the Objective-C version of the code I don't have to write the getter and setter methods, whereas in Qt i have to. I think all the information to automatically implement the getter and setter functions is already in the Q_PROPERTY macro, may be the moc compiler can go ahead and also generate the getter and setter methods for us ?

 

Developing Maemo5 and MeeGo applications on Windows

21 May

Maemo/Meego devices are like a computer that you can put in your pocket, for example the N900. Before N900 these maemo devices had been slow, but thanks to the iphone the whole computer industry has realized the importance of speed. N900 is not slow, what i like about this phone is the keyboard and the great web browser that it has. Just imagine the scenario, you are reading a web page on your desktop and then when you have to catch the bus, that page opens up when you start the browser on your N900. This is possible with the firefox addon called the Mozilla Weave. N900 is just awesome, it just needs to exercise 4 hours a week to lose some extra fat that it has, but other wise I really like it.

But perhaps the best thing about N900 is that my Qt apps that I write for  Symbian  also work with little modifications on my N900! you dont even need to install some crazy toolchains or use the linux os to do any of this; with the Nokia Qt SDK you can do all of this from your windows computer. Even though its in beta right now; but every thing works; i am using it for a meego/maemo app i am doing and no issues yet

 
 

Two finger scrolling on Windows 7/XP/Vista

30 Jan

The two finger page scrolling on the macbooks is really neat, I think it is a better implementation then using a part of the laptop track pad for scrolling the pages. The newer laptops now have that feature, but what if your laptop doesn’t have multi-touch trackpad ? Well Logitech has released a new free iphone app which lets you use your iphone/ipod as a multi-touch track pad with your laptop.

First you need to install it in your iphone/ipod.  Search for ‘Touch Mouse’  in the app store, install it. Then go to Logitech Touch Mouse Server Web site, and get the server software for what ever your OS is. It seems only Linux is not supported. Sad! . Install the server, then run the app on your iphone/ipod, it will detect your computer and hit connect.

So while this is very neat, not every one has a iphone/ipod ( I have a first generation ipod touch ). It would be really great if there was a similar app for the Symbian phones, Android, WebOS or Maemo phones.

To do that we need to understand the protocol used by the touch mouse server and the client. My investigation just came to the conclusion that its a UDP based protocol, the app also uses bonjour for service discovery. The UDP protocol is very cryptic and it seems this is not a easy task, it would be just great if Logitech can release some documents on this.

 
1 Comment

Posted in Qt, UI, nokia

 

Compiling Qt4.6 with OpenSSL Support on Windows with MingW

01 Dec

The Symbian port of Qt is a blessing, no more head banging. Work will be so much easier. The best thing about using Qt for Symbian development is that you dont need to use Carbide or the Emulator, you can use QtCreator to do most of your work. So I downloaded the 4.6 and before I can use it to continue my QFacebookConnect library, I need to compile it with OpenSSL support enabled. You have to do a lot of googling/binging to get that information. Well here is how you do it:

in the command prompt:
SET LIB=c:\openssl\lib\mingw;%LIB%
SET INCLUDE=c:\openssl\include;%INCLUDE%
SET PATH=c:\openssl;%PATH%

now go to the Qt source folder and execute the configure.exe like so:

configure.exe -openssl

and finally
mingw32-make

and here a nice demo of qt4.6 while it compiles for you.

 
 

porting Facebook Connect for iphone to Qt !

22 Nov

For a past couple of weeks I have been working on porting the facebook connect for iphone to Qt. Since Qt is going to make it big in next few years thanks to both Symbian 4 and Maemo 6 using it as their UI library, it makes a lot of sense to have a facebook  connect library for Qt, but since Facebook cares mostly about the platforms popular in the USA, which are iPhone and may be Android ( though there is no facebook connect for Android ) I took it upon myself to port this to Qt and learn objective-c and sharpen my Qt skills along the way.

the repository is hosted at http://gitorious.org/qfacebookconnect

Currently the project is in copy / paste / compile mode. But once I have all the files compiling I will optimize it for Qt. Please have a look and join if you are interested !

 
4 Comments

Posted in Qt, iphone