- Provide “DP” unit
- Page transition management
- "Back" to previous page by the hardware back button
- Unified “Drawable” component
- A single component that supports color , image , QML component, simulated nine patch image as input source
- Auto scale image to fit current screen resolution
- Derived StateListDrawable for animated drawable like button
- Drawable Image provider
- Load image resource in Android resource style. (e.g drawable-xxxhdpi)
- Choose the best image according to current resolution automatically.
- Apply a tint of color to image
- Theme / Style Engine
- A set of components with native look and feel on Android
- SystemDispatcher - C++ and Java communication manager.
- Auto conversion between C++ and Java data type. No need to write in JNI.
UI Components
ActionBar , Activity , Application , Drawable , StateListDrawable
MaterialShadow , PopupMenu , Spinner , QuickButton ,
Switch
Utility Components
Dialog , DrawableGrowBehaviour, InverseMouseArea , PopupArea
QueuedSignal , RectToRectMatrix , AnimationLoader ,
Overlay , Ghost
Under Development Components
SwipeViewer , NavigationDrawer
-
Clone this repository / download release and bundle the folder within your source tree.
-
Add this line to your profile file(.pro):
include(quickandroid/quickandroid.pri) # You should modify the path by yourself
-
Modify your main.cpp
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQuickView>
#include "quickandroid.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView view;
/* QuickAndroid Initialization */
view.engine()->addImportPath("qrc:///"); // Add QuickAndroid into the import path
QuickAndroid::registerTypes(); // It must be called before loaded any scene
/* End of QuickAndroid Initialization */
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setSource(QUrl(QStringLiteral("qrc:///splash.qml")));
view.show();
return app.exec();
}
-
Import the package within your QML file by :
import QuickAndroid 0.1
You may get the DP/density value from the global variable "A.dp" after you have called the QuickAndroid::registerTypes()
in your code. However, Qt Creator don't know the value and threfore the UI will be broken. In make it works , you have to declare a dummy data in your project. Check the example code: dummydata/A.qml
An example program is available in the folder of tests/quickandroidexample . You may build it by yourself or download the daily build from drone.io .
Remarks: Daily build for non-master branch may not be working.
The license of this project has been changed to Apache License 2.0
Q. Looking for component that is not supported yet?
Please feel free to submit the request to the wiki. Moreover, you may take a look on other component library:
Q. Looking for iOS Native Component?
Q. Any library for ...?
- Sharing
- bdentino/Qtino.SharingKit