|
2013-04-18
, 16:02
|
|
Posts: 1,986 |
Thanked: 7,698 times |
Joined on Dec 2010
@ Dayton, Ohio
|
#2
|
The Following User Says Thank You to Copernicus For This Useful Post: | ||
|
2013-04-18
, 16:58
|
Posts: 22 |
Thanked: 9 times |
Joined on Jun 2012
|
#3
|
|
2013-04-18
, 18:18
|
|
Posts: 1,986 |
Thanked: 7,698 times |
Joined on Dec 2010
@ Dayton, Ohio
|
#4
|
Actually when i close the feeditem UI 1st time, it causes crashing the DBus service as QDeclarativeView quits the applications when UI is closed and then service registers automatically, application starts again and so on which explain the delay for 2nd time.
Why QDeclarativeView dont work if defined in someother method instead of main() method. Like if i define QDeclarativeView in openFeed(), UI is not loaded when clicking the feeditem.
QDeclarativeView view = new QDeclarativeView(parent);
The Following User Says Thank You to Copernicus For This Useful Post: | ||
|
2013-04-19
, 12:55
|
Posts: 22 |
Thanked: 9 times |
Joined on Jun 2012
|
#5
|
|
2013-04-19
, 13:39
|
|
Posts: 1,986 |
Thanked: 7,698 times |
Joined on Dec 2010
@ Dayton, Ohio
|
#6
|
The only purpose of combining C++ and QML is to load my custom UI when a feeditem is clicked. But the problem now is that quitting the UI quits my application. My requirement is that closing the UI should not quit my application. Is there a way to fix it?
The Following User Says Thank You to Copernicus For This Useful Post: | ||
|
2013-04-19
, 16:00
|
Posts: 22 |
Thanked: 9 times |
Joined on Jun 2012
|
#7
|
|
2013-04-19
, 16:39
|
|
Posts: 1,986 |
Thanked: 7,698 times |
Joined on Dec 2010
@ Dayton, Ohio
|
#8
|
Yes this is the exact requirement of my application. If i don't put "app.exec()" at end of main method, application don't load at all. I am unable to figure out any alternative way.
int main() { while(TRUE) { waitForDBUSRequest(); processDBUSRequest(); } } void waitForDBUSRequest() { // listen for DBUS requests here } void processDBUSRequest() { QApplication app; app.exec(); }
The Following 2 Users Say Thank You to Copernicus For This Useful Post: | ||
|
2013-04-19
, 16:40
|
|
Posts: 368 |
Thanked: 826 times |
Joined on May 2012
@ India
|
#9
|
The Following User Says Thank You to bibek For This Useful Post: | ||
|
2013-04-19
, 21:42
|
Posts: 22 |
Thanked: 9 times |
Joined on Jun 2012
|
#10
|
I am creating an application for Nokia N9 and stuck into a problem with UI opening. In my application, my requirement is to open UI when click the feeditem on home screen. For this i have defined following in main() something like that
int main()
{
QApplication app ();
QDeclarativeView view;
MyApplication application(&view);
registering DBus etc.
return app.exec();
}
In MyApplication, i have a method openFeed() that opens UI when a feeditem is clicked on homescree
void MyApplication:penFeed()
{
here i am loading UI ap like
QString mainQmlFile =
qApp->applicationDirPath() + "/../qml/main.qml";
QDeclarativeComponent component(m_View->engine(),
QUrl::fromLocalFile(mainQmlFile));
if (component.status() == QDeclarativeComponent::Error) {
qDebug() << "Error(s): " << component.errors();
return;
}
QObject * object = component.create();
m_MainItem = qobject_cast<QDeclarativeItem*>(object);
if (m_MainItem == NULL) {
qDebug() << "MainItem is NULL";
return;
}
m_View->scene()->addItem(m_MainItem);
m_View->setGeometry(QApplication::desktop()->screenGeometry());
m_View->showFullScreen();
}
the problem is that when i click the feed item on home screen, 1st time it opens very fast and load my UI. When i close the UI and click someother feeditem, UI takes a long time to load like 15-20sec which is not acceptable.
Can you please help me out of this problem? I will be highly thankful to you.