具有QML的全屏桌面应用程序
我有使用Flex和AS3开发丰富的用户界面应用程序的经验.但是,问题在于,很难在这些flex应用程序中使用现有的c ++业务逻辑.随着QML的到来,我很好奇是否有可能将Q ++的c ++业务逻辑重用于丰富的UI应用程序.
I have experience with developing rich user interface application with flex and AS3. However the issue is its very hard to use existing c++ business logic with these flex apps. With the advent of QML, I am curious whether its possible to reuse the c++ business logic with QT for rich UI apps.
我想知道是否有可能为台式机开发全屏的,丰富的用户界面应用程序(尤其是在移动设备中,这种情况越来越普遍).例如( http://blog.flexexamples.com/2007/08/07/creating-full-screen-flex-applications/)Adobe具有Flash Player,可以在全屏模式下使用它并运行以AS3编写的内容.是否可以使用QT/QML编写类似的应用程序?
I want to know whether its possible to develop full screen rich user interface applications(which are becoming more and more common especially in mobile devices) for the desktop. For example(http://blog.flexexamples.com/2007/08/07/creating-full-screen-flex-applications/) Adobe has the Flash Player which can be used in full screen mode and runs content written in AS3. Is it possible to write similar applications using QT/QML?
如果您想使用用C ++和某些QML用户界面编写的业务逻辑,则可以在应用程序内部使用QDeclarativeView
.它只是一个常规的Qt小部件,因此具有方法showFullScreen()
.实际上,此类类似于应用程序内部的qmlviewer".
If you would like to use business logic written on C++ and some QML user interface you can use QDeclarativeView
inside your application. It's just a regular Qt widget so it has method showFullScreen()
. Actually this class is like "qmlviewer inside your application".
所以您会得到类似这样的信息:
So you'll get something like this:
#include <QtGui/QApplication>
#include <QtDeclarative/QDeclarativeView>
#include <QtCore/QUrl>
int main(int _argc, char * _argv[])
{
QApplication app(_argc, _argv);
QDeclarativeView view;
view.setSource(QUrl("qrc:/MyGui.qml")); // if your QML files are inside
// application resources
view.showFullScreen(); // here we show our view in fullscreen
return app.exec();
}
您可以在此处找到更多信息.
You can find more information here.