<file>button/go-next.png</file>
<file>button/go-show.png</file>
<file>button/go-clear.png</file>
+ <file>button/up_enable.png</file>
+ <file>button/down_enable.png</file>
</qresource>
</RCC>
resize(380,450);
view= new QDeclarativeView();
- view->setSource(QUrl("src/mdictionary/qml/AboutWidget.qml"));
+ view->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/AboutWidget.qml"));
view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
view->setAlignment(Qt::AlignCenter);
view->show();
- /* QDeclarativeView *view2 = new QDeclarativeView();
- view2->setSource(QUrl("src/mdictionary/qml/TranslationView.qml"));
- view2->setResizeMode(QDeclarativeView::SizeRootObjectToView);
- view2->setAlignment(Qt::AlignCenter);
- view2->show();
-*/
mainLayout = new QVBoxLayout;
mainLayout->addWidget(view);
busyTimer=new QTimer;
progressBar = new QDeclarativeView();
- progressBar->setSource(QUrl("src/mdictionary/qml/ProgressBar.qml"));
+ progressBar->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/ProgressBar.qml"));
progressBar->setResizeMode(QDeclarativeView::SizeRootObjectToView);
progressBar->setAlignment(Qt::AlignCenter);
progressBar->hide();
view= new QDeclarativeView();
- view->setSource(QUrl("src/mdictionary/qml/SearchBarWidget.qml"));
+ view->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/SearchBarWidget.qml"));
view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
view->setAlignment(Qt::AlignCenter);
view->show();
qml/TranslationView.qml \
qml/FlickableWebView.qml \
qml/ScrollBar.qml \
- qml/SpinBox.qml \
- qml/Checkbox.qml
+ qml/Checkbox.qml \
+ qml/MySpinBox.qml
target.path = $$BIN_DIR
INSTALLS += target
qmls.files += ./qml/FlickableWebView.qml
qmls.files += ./qml/ScrollBar.qml
qmls.files += ./qml/Checkbox.qml
+ qmls.files += ./qml/MySpinBox.qml
}
INSTALLS += desktop icon64 shared service css css_images qmls
anchors.horizontalCenterOffset: 0
onLinkActivated: linkClicked(link);
}
+
+ MySpinBox {
+ id: test01
+ y:50;
+ x:100;
+ width: 40
+ height: 20;
+ }
+
}
id: rectangle
property alias pathToIcon: image.source;
+ property int iconWidth:rectangle.width;
+ property int iconHeight:rectangle.height;
signal clicked;
radius: 50
id: image
z:4;
anchors.centerIn: parent
- width: rectangle.width;
- height: rectangle.height;
+ width: iconWidth;
+ height: iconHeight;
}
Image {
--- /dev/null
+import Qt 4.7
+
+Rectangle {
+ id: rectangle1
+ radius: 10
+ border.color: "#000666";
+ property int maxValue:500;
+ property int minValue:0;
+ property alias value:text_input1.text
+
+ TextInput {
+ id: text_input1
+ x: 1
+ width: rectangle1.width-15
+ height: rectangle1.height*0.6;
+ text: "0"
+ anchors.centerIn: parent
+ validator: IntValidator{bottom: 0; top: 500;}
+ transformOrigin: Item.Left
+ selectByMouse: true;
+ font.pixelSize: rectangle1.height * .5;
+ onCursorPositionChanged: moveCursorSelection(cursorPosition);
+ focus: rectangle1.focus;
+ /* Keys.onPressed: {
+ if ((event.key == Qt.Key_Enter) || (event.key == Qt.Key_Return))
+ rectangle1.enterPressed(text_input1.text)
+ }
+*/
+ }
+
+ Rectangle {
+ id: shadeDisable
+ anchors.centerIn: parent;
+ radius: parent.radius
+ color: "grey";
+ opacity: 0
+ width: parent.width;
+ height: parent.height;
+ }
+
+ Image {
+ id: imageUp
+ z:4;
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.rightMargin: 2
+ anchors.topMargin: 2
+ width: 11;
+ height: 6;
+
+ source: "qrc:/button/up_enable.png";
+ }
+
+ Image {
+ id: imageDown
+ z:4;
+ width: 11;
+ height: 6;
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.rightMargin: 2
+ anchors.bottomMargin: 2
+ source: "qrc:/button/down_enable.png";
+ }
+
+ MouseArea {
+ id: mouseAreaUp
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.rightMargin: 2
+ anchors.topMargin: 2
+ width: 11;
+ height: rectangle1/2;
+ onClicked: {
+ console.log("t1");
+ //rectangle.clicked();
+ }
+ }
+
+ MouseArea {
+ id: mouseAreaDown
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.rightMargin: 2
+ anchors.topMargin: 2
+ width: 11;
+ height: rectangle1/2;
+ onClicked: {
+ console.log("t2");
+ //rectangle.clicked();
+ }
+
+ }
+
+ states: [
+ State {
+ name: "DisableState"; when: rectangle1.enabled==false;
+ PropertyChanges { target: shadeDisable; z: 3; opacity: 0.5 }
+ }
+ ]
+}
+