phim xxx

indian girls

Archive for May, 2007

Container plugin

Just checked Qt 4.3rc1 for a containter extensions support. Still doesn’t work, even for their own containerextension example. Tough luck…

Overwhelmed

I’m soooo overwhelmed with work today… I’m working all day since morning and I feel like as far from my goal as I was few hours earlier…

What do you feel? Do you feel having enough time for your hobbies and other free time activities?

John Higgins – World Snooker Champion 2007

John Higgins has just won the World Snooker Championship for the second time. Hurray!

John Higgins

UIC problems with custom container widgets

 

Recently I’ve been spending much time developing “wwWidgets” – my set of custom widgets for Qt4. Among others, the set contains widgets that are multipage container widgets that have to be treated in a special way – by providing an extension to Designer that tells it how to add or remove new pages to the widget.

Unfortunately Designer seems to be having much trouble with that currently. I could even call it the biggest misdesign in Qt4 (at least the biggest I’m aware of). Container widgets need to be handled on two levels – first Designer has to save some information about the custom widget in the UI file and the UIC has to process the file and generate C++ code that does the widget layout. The problem is that Designer doesn’t provide enough information for UIC to generate code that adds pages to multipage container widgets. The “misdesign” is that currently UIC checks the class name of the container widget and if it is a subclass of QTabWidget, it calls addTab(child, label), if it is a subclass of QStackedWidget, it calls addWidget, but for all other widgets it ignores the multipage nature of the widget and just makes a parent-child relationship between the container and its pages. As one might expect it leads to unpredicted and unwanted behaviour.

I contacted Trolltech about it and they said they were working on it and it should already be solved in Qt4.3 beta. Unfortunately class and method names are still hardcoded into UIC. For the time being I suspended dealing with the problem as I don’t want to reinvent the wheel trying to come up with a fix if Trolls are already working on it (it means I’m giving them a chance to improve the design).

However this doesn’t mean I’m not thinking about possible solutions or temporary workarounds and I came up with three possible fixes.

Method 1

The first (and probably the best) idea is to somehow store the signatures of methods needed by the widget to manipulate its pages in the xml description of the custom widget added to each UI file using the widget. Then UIC could use that information to generate code that would call a proper method to add pages to widgets. The only question is, how to retrieve such data. According to me there are two possibilities. First involves the custom widget interface that accompaniates each widget plugin. There is a reserved method codeTemplate which was probably intended to do exactly the thing needed here – provide a template code to be used by UIC. The second possiblity is to use Q_CLASSINFO() macro to embed such information directly in the widget itself in a simmilar manner.

Method 2

The second method is somewhat simpler – let’s just assume the method to add new page has to follow some well known naming scheme or that the container widget has to implement some interface which serves the purpose of letting UIC use well known (hardcoded) method names to manipulate widget pages.

Method 3

The last method is merely a workaround that can be applied with existing Qt versions without the need to patch any Qt code. Qt objects receive a special event (QChildEvent) that informs that a child was added or removed from the object. It could be used to intercept the pages inserted with the faulty behaviour of UIC so that the widget itself could incorporate the child as its page. Of course it means it wouldn’t be possible to add child widgets to the widget “the traditional way” as all widget children would be treated as pages.

Comments on Qt Centre programming contest

Today I posted a note to QtCentre regarding upcoming closing of the contest registration period and I’d like to write a few words of comment and thoughts regarding the contest.

First of all I am surprised by the total lack of entries in the “Mobile Application”. Given the fact that you can win a magnificent device (belive me, I played with it last year) worth probably about $1000 (Trolltech sells it for $700 but it’s less than the Greenphone market value) that can actually run your application (assuming you don’t already have such a device) I expected a flood of entries in this category (I’d take part in the competition myself if I could).

Second of all right after the contest has been announced there has been a little wave of comments suggesting some kind of con or enourmously strict rules of the contest (for example look here). I will only say that such aqusations are unfair. You can read my detailed opinion directly on Dot.

Third of all I’m surprised only three entries have been submitted to the “Development Tool” category. Knowing that at least three IDE projects exist for Qt4 (and not all entries in the category are IDE applications) and there are surely more initiatives related to development (wizards, documentation tools, parsers, frontends, etc.) it is weird that none of them entered the competition.

Fourth of all while organizing the competition we managed to extend our contacts in Qt world. At last I don’t feel like walking blindly in Qt world, so this is an obvious benefit of the whole initiative for me. Hopefully one day Qt community may benefit from that.

There are still almost two weeks remaining for people to register their apps so hopefully all my worries will prove wrong, but for now all makes me wonder why the situation looks like this. I don’t think it’s because of poor prizes as, you must admit, these are great and honestly I don’t know if sponsors will be willing to donate such great prizes next year (if we decide to organize it) if they’re not satisfied with the interest in the event this year.

The bottom line is – if you have written a Qt4 application that doesn’t violate rules of engagement (it’s open source and portable), enter the competition. You don’t lose anything and you can gain quite much.

xnxx indian