Thursday, February 24, 2011

You might have confusion that how to handle mutiple views in QT?, for example you are in an inbox widget and you will switch to message widget. How to handle this sort of situations? you may think that hiding the inbox widget and going to message widget or delete the inbox widget and recreate it after coming back from message widget.But this could be a temporary solution not the better approach,the better approch is to use Qt Stackedwidget.

The concept is very simple, when you are in one widget and you will switch to another widget just push the current widget into stack and proceed to next widget, when you are coming back to the previous widget just delete the current widget and pop up the previous widget from the stack.

Most of Qt apps will have a Mainwindow and formed with multiple widgets, Mainwindow has menubar,when you switch to any widget just delete the current menu actions form window and load it with the new actions from widget. so if you do like this then, you always have a single class which is derived from "Qmainwindow" thought the application.

In mainwindow itself, you need to handle all the possibalities like when setting back menu,setting exit or is exit required throught application and many other things depending on your requirements.

Here is the simple example i have created which demonstrate how to use stackedwidget in QT.
in this i would like to explain few mainwindow functions which may be usefull.

"Qt_Stackwidget::activeWidgetChanged(int index)"--->; This gets called when the new widget is created with index of it, so clear the window menu bar and load it with new menus assosiated with new widget

"Qt_Stackwidget::changeCBA(QBaseWidget* current)"--->; This is for adding the back or exit based on the widget type, for example in first widget you should keep exit or else back would be preffered.

"Qt_Stackwidget::activatePerviousView()"--->;This is for activating the previous view by deleting the current one when you hit back menu.

Here is the simple source code, i have created widgets & view switching logic in the single file itself ,you can split it to multiple and use it accordingly.

Thursday, February 10, 2011

There is a pertinent story about a man who was working on an oil platform in the North Sea. He woke up one night from a loud explosion, which suddenly set his entire oil platform on fire. In mere moments, he was surrounded by flames. Through the smoke and heat, he barely made his way out of the chaos to the platform's edge. When he looked down over the edge, all he could see were the dark, cold, foreboding Atlantic waters.

As the fire approached him, the man had mere seconds to react. He could stand on the platform, and inevitably be consumed by the burning flames. Or, he could plunge 30 meters in to the freezing waters. The man was standing upon a "burning platform," and he needed to make a choice.

He decided to jump. It was unexpected. In ordinary circumstances, the man would never consider plunging into icy waters. But these were not ordinary times - his platform was on fire. The man survived the fall and the waters. After he was rescued, he noted that a "burning platform" caused a radical change in his behaviour.

We too, are standing on a "burning platform," and we must decide how we are going to change our behaviour.

Over the past few months, I've shared with you what I've heard from our shareholders, operators, developers, suppliers and from you. Today, I'm going to share what I've learned and what I have come to believe.

I have learned that we are standing on a burning platform.

And, we have more than one explosion - we have multiple points of scorching heat that are fuelling a blazing fire around us.

For example, there is intense heat coming from our competitors, more rapidly than we ever expected. Apple disrupted the market by redefining the smartphone and attracting developers to a closed, but very powerful ecosystem.

In 2008, Apple's market share in the $300+ price range was 25 percent; by 2010 it escalated to 61 percent. They are enjoying a tremendous growth trajectory with a 78 percent earnings growth year over year in Q4 2010. Apple demonstrated that if designed well, consumers would buy a high-priced phone with a great experience and developers would build applications. They changed the game, and today, Apple owns the high-end range.

And then, there is Android. In about two years, Android created a platform that attracts application developers, service providers and hardware manufacturers. Android came in at the high-end, they are now winning the mid-range, and quickly they are going downstream to phones under €100. Google has become a gravitational force, drawing much of the industry's innovation to its core.

Let's not forget about the low-end price range. In 2008, MediaTek supplied complete reference designs for phone chipsets, which enabled manufacturers in the Shenzhen region of China to produce phones at an unbelievable pace. By some accounts, this ecosystem now produces more than one third of the phones sold globally - taking share from us in emerging markets.

While competitors poured flames on our market share, what happened at Nokia? We fell behind, we missed big trends, and we lost time. At that time, we thought we were making the right decisions; but, with the benefit of hindsight, we now find ourselves years behind.

The first iPhone shipped in 2007, and we still don't have a product that is close to their experience. Android came on the scene just over 2 years ago, and this week they took our leadership position in smartphone volumes. Unbelievable.

We have some brilliant sources of innovation inside Nokia, but we are not bringing it to market fast enough. We thought MeeGo would be a platform for winning high-end smartphones. However, at this rate, by the end of 2011, we might have only one MeeGo product in the market.

At the midrange, we have Symbian. It has proven to be non-competitive in leading markets like North America. Additionally, Symbian is proving to be an increasingly difficult environment in which to develop to meet the continuously expanding consumer requirements, leading to slowness in product development and also creating a disadvantage when we seek to take advantage of new hardware platforms. As a result, if we continue like before, we will get further and further behind, while our competitors advance further and further ahead.

At the lower-end price range, Chinese OEMs are cranking out a device much faster than, as one Nokia employee said only partially in jest, "the time that it takes us to polish a PowerPoint presentation." They are fast, they are cheap, and they are challenging us.

And the truly perplexing aspect is that we're not even fighting with the right weapons. We are still too often trying to approach each price range on a device-to-device basis.

The battle of devices has now become a war of ecosystems, where ecosystems include not only the hardware and software of the device, but developers, applications, ecommerce, advertising, search, social applications, location-based services, unified communications and many other things. Our competitors aren't taking our market share with devices; they are taking our market share with an entire ecosystem. This means we're going to have to decide how we either build, catalyse or join an ecosystem.

This is one of the decisions we need to make. In the meantime, we've lost market share, we've lost mind share and we've lost time.

On Tuesday, Standard & Poor's informed that they will put our A long term and A-1 short term ratings on negative credit watch. This is a similar rating action to the one that Moody's took last week. Basically it means that during the next few weeks they will make an analysis of Nokia, and decide on a possible credit rating downgrade. Why are these credit agencies contemplating these changes? Because they are concerned about our competitiveness.

Consumer preference for Nokia declined worldwide. In the UK, our brand preference has slipped to 20 percent, which is 8 percent lower than last year. That means only 1 out of 5 people in the UK prefer Nokia to other brands. It's also down in the other markets, which are traditionally our strongholds: Russia, Germany, Indonesia, UAE, and on and on and on.

How did we get to this point? Why did we fall behind when the world around us evolved?

This is what I have been trying to understand. I believe at least some of it has been due to our attitude inside Nokia. We poured gasoline on our own burning platform. I believe we have lacked accountability and leadership to align and direct the company through these disruptive times. We had a series of misses. We haven't been delivering innovation fast enough. We're not collaborating internally.

Nokia, our platform is burning.

We are working on a path forward -- a path to rebuild our market leadership. When we share the new strategy on February 11, it will be a huge effort to transform our company. But, I believe that together, we can face the challenges ahead of us. Together, we can choose to define our future.

The burning platform, upon which the man found himself, caused the man to shift his behavior, and take a bold and brave step into an uncertain future. He was able to tell his story. Now, we have a great opportunity to do the same.

Monday, December 27, 2010

Qt menu bar has two menu items, as you would have seen by default left side of the key is “Options” and the right side is “Exit”.
Today we shall see how to change the text of it.
The left key is “Positive Soft key” & the right key is “Negative soft key”. We need to create an action with the positive and negative soft key role and insert to the window, so the keys will get changed.
Ex: For positive soft key:(Left side key)