Designing cool, interactive interfaces. DuoDuoZhijiao came up with a much better answer for QtQuick1QREncode: QWidgets QML
,
a Widget And a declarative language perfect for designing UIs (and much more).
Here's a sample of how QtQuick1QREncode Plugin For QML looks like:
- You should install those plugin to Qt SDK path like :make install or Use qtcreator's install command
//QML2 code
import QtQuick 2.3
import com.duoduo.component 1.0
QtQuick2QREncode{
id:qr
width: 128
height: 128
qrSize: Qt.size(width,width)
anchors.centerIn: parent
qrData:"duoduozhijiao" //encode contents
qrForeground: "#29aee1" //encode color
qrBackground: "white"
qrMargin: 2
qrMode: QtQuick1QREncode.MODE_8 //encode model
qrLevel: QtQuick1QREncode.LEVEL_Q // encode level
qrLogo: "qrc:/256.png" //or local path or qrc path but not network url
onQrSaveFileChanged: {
console.log("We get save file path is :"+qrfilepath)
}
}
//qml1 Code:
import QtQuick 1.0 //notice here
import com.ddui.qmlcomponents 1.0
Item {
width: 256
height: width
visible: true
QtQuick1QREncode{
id:qr
anchors.fill: parent
qrSize: Qt.size(width,width)
qrData:"www.heilqt.com" //encode contents
qrForeground: "#29aee1" //encode color
qrBackground: "white"
qrMargin: 4
qrMode: QtQuick1QREncode.MODE_8 //encode model
qrLevel: QtQuick1QREncode.LEVEL_Q // encode level
qrLogo: "qrc:/Apple.png" //or local path or qrc path but not network url
onQrSaveFileChanged: {
console.log("We get save file path is :"+qrfilepath)
}
onQrSizeChanged:{
console.log("Size get save file path is :"+qrsize.width)
}
}
onWidthChanged: {
if(width>height){
qr.setQrSize(Qt.size(height,height))
}else{
qr.setQrSize(Qt.size(width,width))
}
}
}
//this is a widgets Code
#include <QApplication>
#include "dduiqrwidgets.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
DDuiQRWidgets w;
w.resize(400,100);
w.show();
w.setQrSaveFile("xxx.png");
return app.exec();
}
This project aims at bringing the power of QtQuick1QREncode to qml designer UI and widgets.
Git clone it. Build it
make clean(mingw32-make clean)
qmake
make (mingw32-make mingw) | nmake(vc)
sudo make install (*unix)
You may use qtcreator to build it.
Note that for the following, you need to have Qt SDK
for Qt4.7 or later installed.
You can use QtQuick1QREncode to encode your QtQuick1QREncode UI.
Implemented a QML Extension module that:
- qrData (QtQuick1QREncode data show)
- qrLogo (QtQuick1QREncode middle logo)
- qrSize (QtQuick1QREncode size)
- qrMode (mode )
- qrLevel (level )
- qrCasesen (casesen upper)
- qrMargin (margin)
- qrPercent (percent)
- qrForeground (qrForeground)
- qrBackground (qrBackground)
- Above all signals
- all Above slots
- setQrSaveFile(const QString& filePath) //can sava current QtQuick1QREncode to file
Implemented a QWidget Extension module that:
- Refer to how to build share libary
- qrData (QtQuick1QREncode data show)
- qrLogo (QtQuick1QREncode middle logo)
- qrSize (QtQuick1QREncode size)
- qrMode (mode )
- qrLevel (level )
- qrCasesen (casesen upper)
- qrMargin (margin)
- qrPercent (percent)
- qrForeground (qrForeground)
- qrBackground (qrBackground)
- Above all signals
- all Above slots
- setQrSaveFile(const QString& filePath) //can sava current QtQuick1QREncode to file
- qrSize is set update size and repaint
Contact information
- Email(373955953#qq.com, Change#to@)
- QQ: 39559539234
- QQ Group:312125701
- github: 寒山-居士
https://github.com/penk/terrarium-app
var duoduozhijiao = {
nickName : "寒山-居士",
site : "http://www.heilqt.com",
blog : "http://blog.heilqt.com"
}