forked from qt-creator/qt-creator
QmlDesigner.PropertyEditor: Refactoring and polishing
I polished and refactored most of the property editor (again) I introduced more custom widgets with expression editing, fixed bugs and polished the visual design
This commit is contained in:
@@ -4,31 +4,26 @@ import Bauhaus 1.0
|
||||
GroupBox {
|
||||
maximumHeight: 240;
|
||||
|
||||
|
||||
finished: finishedNotify;
|
||||
caption: "Image";
|
||||
|
||||
layout: QVBoxLayout {
|
||||
topMargin: 12;
|
||||
bottomMargin: 12;
|
||||
leftMargin: 12;
|
||||
rightMargin: 12;
|
||||
|
||||
layout: VerticalLayout {
|
||||
|
||||
FileWidget {
|
||||
enabled: isBaseState || backendValues.id.value != "";
|
||||
maximumWidth: 250;
|
||||
text: "Source: ";
|
||||
text: "Source";
|
||||
fileName: backendValues.source.value;
|
||||
onFileNameChanged: {
|
||||
backendValues.source.value = fileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IntEditor {
|
||||
id: pixelSize;
|
||||
backendValue: backendValues.border_left;
|
||||
caption: "Border Left: "
|
||||
caption: "Left"
|
||||
baseStateFlag: isBaseState;
|
||||
|
||||
step: 1;
|
||||
@@ -38,7 +33,7 @@ GroupBox {
|
||||
|
||||
IntEditor {
|
||||
backendValue: backendValues.border_right;
|
||||
caption: "Border Right: "
|
||||
caption: "Right"
|
||||
baseStateFlag: isBaseState;
|
||||
|
||||
step: 1;
|
||||
@@ -48,7 +43,7 @@ GroupBox {
|
||||
|
||||
IntEditor {
|
||||
backendValue: backendValues.border_top;
|
||||
caption: "Border Top: "
|
||||
caption: "Top"
|
||||
baseStateFlag: isBaseState;
|
||||
|
||||
step: 1;
|
||||
@@ -58,7 +53,7 @@ GroupBox {
|
||||
|
||||
IntEditor {
|
||||
backendValue: backendValues.border_bottom;
|
||||
caption: "Border Bottom:"
|
||||
caption: "Bottom"
|
||||
baseStateFlag: isBaseState;
|
||||
|
||||
step: 1;
|
||||
|
||||
@@ -35,4 +35,11 @@ QCheckBox { //This is a special CheckBox that does color coding for states
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ExtendedFunctionButton {
|
||||
backendValue: CheckBox.backendValue
|
||||
y: 2
|
||||
x: 0
|
||||
visible: CheckBox.enabled
|
||||
}
|
||||
}
|
||||
|
||||
15
share/qtcreator/qmldesigner/propertyeditor/Qt/ComboBox.qml
Normal file
15
share/qtcreator/qmldesigner/propertyeditor/Qt/ComboBox.qml
Normal file
@@ -0,0 +1,15 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
QComboBox {
|
||||
id: ComboBox
|
||||
|
||||
property var backendValue
|
||||
|
||||
ExtendedFunctionButton {
|
||||
backendValue: ComboBox.backendValue
|
||||
y: 3
|
||||
x: 3
|
||||
visible: CheckBox.enabled
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,9 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
|
||||
QLabel {
|
||||
visible: text != ""
|
||||
id: label;
|
||||
font.bold: true;
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
maximumWidth: 80
|
||||
}
|
||||
|
||||
QDoubleSpinBox {
|
||||
|
||||
@@ -13,6 +13,8 @@ QWidget {
|
||||
|
||||
onActiveChanged: {
|
||||
//text = "";
|
||||
print("active")
|
||||
print(y)
|
||||
if (active) {
|
||||
textEdit.plainText = backendValue.expression
|
||||
textEdit.setFocus();
|
||||
|
||||
@@ -14,10 +14,8 @@ layout: VerticalLayout{
|
||||
QWidget {
|
||||
maximumHeight: 40;
|
||||
layout: HorizontalLayout {
|
||||
QLabel {
|
||||
text: "Effect ";
|
||||
font.bold: true;
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
Label {
|
||||
text: "Effect ";
|
||||
}
|
||||
QComboBox {
|
||||
enabled: isBaseState;
|
||||
|
||||
@@ -74,7 +74,7 @@ QToolButton {
|
||||
QAction {
|
||||
text: "Set Expression";
|
||||
onTriggered: {
|
||||
expressionEdit.globalY = box.globalY;
|
||||
expressionEdit.globalY = ExtendedFunctionButton.globalY;
|
||||
expressionEdit.backendValue = ExtendedFunctionButton.backendValue
|
||||
expressionEdit.show();
|
||||
expressionEdit.raise();
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
GroupBox {
|
||||
id: FontGroupBox
|
||||
caption: "Font";
|
||||
|
||||
layout: VerticalLayout {
|
||||
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
Label {
|
||||
text: "Font"
|
||||
}
|
||||
QFontComboBox {
|
||||
minimumWidth: 200
|
||||
}
|
||||
IntEditor {
|
||||
caption: "Size"
|
||||
slider: false
|
||||
backendValue: backendValues.font_pointSize
|
||||
baseStateFlag: isBaseState;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
Label {
|
||||
text: "Style"
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: "Bold";
|
||||
backendValue: backendValues.font_bold
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
}
|
||||
CheckBox {
|
||||
text: "Italic";
|
||||
backendValue: backendValues.font_italic
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,16 +5,13 @@ GroupBox {
|
||||
id: Geometry;
|
||||
caption: "Geometry";
|
||||
|
||||
maximumHeight: 240;
|
||||
|
||||
layout: VerticalLayout {
|
||||
|
||||
QWidget { // 1
|
||||
layout: HorizontalLayout {
|
||||
|
||||
QLabel {
|
||||
Label {
|
||||
text: "Position"
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
}
|
||||
|
||||
DoubleSpinBox {
|
||||
@@ -48,9 +45,8 @@ GroupBox {
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
|
||||
QLabel {
|
||||
Label {
|
||||
text: "Size"
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
}
|
||||
|
||||
DoubleSpinBox {
|
||||
|
||||
@@ -3,7 +3,7 @@ import Bauhaus 1.0
|
||||
|
||||
QHBoxLayout {
|
||||
id: HorizontalLayout
|
||||
spacing: 20
|
||||
spacing: 10
|
||||
topMargin: 0
|
||||
bottomMargin: 0
|
||||
leftMargin: 0
|
||||
|
||||
@@ -7,15 +7,10 @@ GroupBox {
|
||||
finished: finishedNotify;
|
||||
caption: "Image";
|
||||
|
||||
layout: QVBoxLayout {
|
||||
topMargin: 12;
|
||||
bottomMargin: 12;
|
||||
leftMargin: 2;
|
||||
rightMargin: 2;
|
||||
layout: VerticalLayout {
|
||||
|
||||
FileWidget {
|
||||
enabled: isBaseState || backendValues.id.value != "";
|
||||
maximumWidth: 250;
|
||||
text: "Source: ";
|
||||
fileName: backendValues.source.value;
|
||||
onFileNameChanged: {
|
||||
|
||||
@@ -13,12 +13,12 @@ QWidget {
|
||||
property var minimumValue: 0
|
||||
property var step: 1
|
||||
property bool slider: true
|
||||
property alias alignment: label.alignment
|
||||
|
||||
layout: HorizontalLayout {
|
||||
QLabel {
|
||||
text: caption
|
||||
font.bold: true;
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
Label {
|
||||
id: label
|
||||
text: caption
|
||||
}
|
||||
|
||||
SpinBox {
|
||||
@@ -32,7 +32,6 @@ QWidget {
|
||||
QWidget {
|
||||
visible: IntEditor.slider
|
||||
id: sliderWidget
|
||||
fixedWidth: 100
|
||||
QSlider {
|
||||
y: sliderWidget.height / 2 - 12
|
||||
width: sliderWidget.width
|
||||
|
||||
10
share/qtcreator/qmldesigner/propertyeditor/Qt/Label.qml
Normal file
10
share/qtcreator/qmldesigner/propertyeditor/Qt/Label.qml
Normal file
@@ -0,0 +1,10 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
QLabel {
|
||||
id: Label
|
||||
font.bold: true;
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
//maximumWidth: 80
|
||||
fixedWidth: 80
|
||||
}
|
||||
32
share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml
Normal file
32
share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml
Normal file
@@ -0,0 +1,32 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
QWidget {
|
||||
id: LineEdit
|
||||
|
||||
property var backendValue
|
||||
|
||||
minimumHeight: 24;
|
||||
|
||||
QLineEdit {
|
||||
id: lineEditWidget
|
||||
x: 18
|
||||
width: LineEdit.width - 18
|
||||
height: LineEdit.height
|
||||
|
||||
text: backendValue.value
|
||||
|
||||
onTextEdited: {
|
||||
print("text edited")
|
||||
backendValue.value = text
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
ExtendedFunctionButton {
|
||||
backendValue: LineEdit.backendValue
|
||||
y: 4
|
||||
x: 3
|
||||
visible: LineEdit.enabled
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,8 @@ GroupBox {
|
||||
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
QLabel {
|
||||
Label {
|
||||
text: "Visibility"
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
@@ -29,16 +28,14 @@ GroupBox {
|
||||
backendValue: backendValues.clip === undefined ? false : backendValues.clip;
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
fixedWidth: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
|
||||
QLabel {
|
||||
Label {
|
||||
text: "Opacity"
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
}
|
||||
|
||||
DoubleSpinBox {
|
||||
@@ -66,12 +63,13 @@ GroupBox {
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
|
||||
QLabel {
|
||||
Label {
|
||||
text: "Origin";
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
}
|
||||
QComboBox {
|
||||
ComboBox {
|
||||
minimumWidth: 20
|
||||
|
||||
backendValue: backendValues.transformOrigin
|
||||
items : { [
|
||||
"TopLeft", "Top", "TopRight", "Left", "Center", "Right", "BottomLeft", "Bottom",
|
||||
"BottomRight"
|
||||
@@ -85,18 +83,13 @@ GroupBox {
|
||||
backendValues.transformOrigin.value = currentText;
|
||||
}
|
||||
}
|
||||
QWidget {
|
||||
fixedWidth: 100
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
|
||||
QLabel {
|
||||
Label {
|
||||
text: "Scale"
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
}
|
||||
|
||||
DoubleSpinBox {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
QWidget {
|
||||
id: PlaceHolder
|
||||
fixedWidth: 100
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import Qt 4.6
|
||||
WidgetFrame {
|
||||
id: PropertyFrame;
|
||||
|
||||
minimumWidth: 350;
|
||||
minimumWidth: 320;
|
||||
//maximumWidth: 300;
|
||||
styleSheetFile: "propertyEditor.css";
|
||||
//visible: isBaseState;
|
||||
|
||||
@@ -8,16 +8,25 @@ GroupBox {
|
||||
|
||||
maximumHeight: 340;
|
||||
|
||||
layout: QVBoxLayout {
|
||||
topMargin: 20;
|
||||
bottomMargin: 4;
|
||||
leftMargin: 0;
|
||||
rightMargin: 10;
|
||||
layout: VerticalLayout {
|
||||
|
||||
IntEditor {
|
||||
backendValue: backendValues.radius
|
||||
caption: "Radius"
|
||||
baseStateFlag: isBaseState;
|
||||
step: 1;
|
||||
minimumValue: 0;
|
||||
maximumValue: 100;
|
||||
}
|
||||
|
||||
|
||||
IntEditor {
|
||||
id: borderWidth;
|
||||
backendValue: backendValues.border_width === undefined ? 0 : backendValues.border_width
|
||||
|
||||
caption: "Pen Width"
|
||||
baseStateFlag: isBaseState;
|
||||
|
||||
step: 1;
|
||||
minimumValue: 0;
|
||||
maximumValue: 100;
|
||||
@@ -32,8 +41,9 @@ GroupBox {
|
||||
//modelNode: backendValues.color.modelNode;
|
||||
complexGradientNode: backendValues.color === undefined ? null : backendValues.color.complexNode
|
||||
|
||||
showGradientButton: true;
|
||||
//showGradientButton: true;
|
||||
}
|
||||
|
||||
ColorWidget {
|
||||
text: "Tint color";
|
||||
color: backendValues.tintColor === undefined ? "black" : backendValues.tintColor.value
|
||||
@@ -42,18 +52,6 @@ GroupBox {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IntEditor {
|
||||
id: borderWidth;
|
||||
backendValue: backendValues.border_width === undefined ? 0 : backendValues.border_width
|
||||
|
||||
caption: "Pen Width"
|
||||
baseStateFlag: isBaseState;
|
||||
|
||||
step: 1;
|
||||
minimumValue: 0;
|
||||
maximumValue: 100;
|
||||
}
|
||||
ColorWidget {
|
||||
id: PenColor;
|
||||
text: "Pen Color";
|
||||
|
||||
@@ -4,7 +4,7 @@ import Bauhaus 1.0
|
||||
QWidget {
|
||||
id: SliderWidget
|
||||
visible: IntEditor.slider
|
||||
fixedWidth: 100
|
||||
//fixedWidth: 100
|
||||
|
||||
property alias value: slider.value
|
||||
property alias singleStep: slider.singleStep
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
GroupBox {
|
||||
id: StandardTextGroupBox
|
||||
|
||||
caption: "Text";
|
||||
|
||||
property bool showStyleColor: false;
|
||||
|
||||
layout: VerticalLayout {
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
|
||||
Label {
|
||||
text: "Text"
|
||||
}
|
||||
|
||||
LineEdit {
|
||||
backendValue: backendValues.text
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
fixedWidth: 70
|
||||
baseStateFlag: isBaseState;
|
||||
text: "Wraps";
|
||||
checkable: true;
|
||||
backendValue: backendValues.wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
|
||||
Label {
|
||||
text: "Alignment"
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
items : { ["AlignLeft", "AlignRight", "AlignHCenter"] }
|
||||
currentText: backendValues.horizontalAlignment.value;
|
||||
onItemsChanged: {
|
||||
currentText = backendValues.horizontalAlignment.value;
|
||||
}
|
||||
|
||||
onCurrentTextChanged: {
|
||||
if (count == 3);
|
||||
backendValues.horizontalAlignment.value = currentText;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
items : { ["AlignTop", "AlignBottom", "AlignVCenter"] }
|
||||
currentText: backendValues.verticalAlignment.value;
|
||||
onItemsChanged: {
|
||||
currentText = backendValues.verticalAlignment.value;
|
||||
}
|
||||
|
||||
onCurrentTextChanged: {
|
||||
if (count == 3)
|
||||
backendValues.verticalAlignment.value = currentText;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
ColorWidget {
|
||||
text: "Color:";
|
||||
color: backendValues.color.value;
|
||||
onColorChanged: {
|
||||
backendValues.color.value = strColor;
|
||||
}
|
||||
}
|
||||
ColorWidget {
|
||||
visible: showStyleColor
|
||||
text: "Style color:";
|
||||
color: backendValues.styleColor.value;
|
||||
onColorChanged: {
|
||||
backendValues.styleColor.value = strColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,273 +1,60 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
GroupBox {
|
||||
maximumHeight: 600;
|
||||
|
||||
finished: finishedNotify;
|
||||
caption: "Text Edit";
|
||||
QWidget {
|
||||
id: textSpecifics;
|
||||
|
||||
layout: QVBoxLayout {
|
||||
id: textSpecifics;
|
||||
topMargin: 20;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 4;
|
||||
rightMargin: 4;
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 8;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 0;
|
||||
spacing: 20;
|
||||
QLabel {
|
||||
alignment: "AlignTop";
|
||||
text: "Text:"
|
||||
font.bold: true;
|
||||
}
|
||||
QTextEdit {
|
||||
minimumHeight: 80;
|
||||
property var localText: backendValues.text.value;
|
||||
onLocalTextChanged: {
|
||||
if (localText != plainText)
|
||||
plainText = localText;
|
||||
}
|
||||
topMargin: 0
|
||||
bottomMargin: 0
|
||||
leftMargin: 0
|
||||
rightMargin: 0
|
||||
spacing: 0
|
||||
|
||||
onTextChanged: {
|
||||
backendValues.text.value = plainText;
|
||||
}
|
||||
StandardTextGroupBox {
|
||||
showStyleColor: true
|
||||
finished: finishedNotify;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 2;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
QLabel {
|
||||
text: "wrap:"
|
||||
font.bold: true;
|
||||
}
|
||||
CheckBox {
|
||||
text: "isWrapping";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues.wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FontWidget {
|
||||
text: "Font:";
|
||||
GroupBox {
|
||||
caption: "Text Edit"
|
||||
finished: finishedNotify;
|
||||
layout: VerticalLayout {
|
||||
|
||||
bold: backendValues.font_bold.value;
|
||||
italic: backendValues.font_italic.value;
|
||||
family: backendValues.font_family.value;
|
||||
fontSize: backendValues.font_pointSize.value;
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
Label {
|
||||
text: "Text Format"
|
||||
}
|
||||
ComboBox {
|
||||
minimumHeight: 22;
|
||||
items : { ["PlainText", "RichText", "AutoText"] }
|
||||
currentText: backendValues.textFormat.value;
|
||||
onItemsChanged: {
|
||||
currentText = backendValues.textFormat.value;
|
||||
}
|
||||
|
||||
onDataFontChanged: {
|
||||
if (bold)
|
||||
backendValues.font_bold.value = bold;
|
||||
else
|
||||
backendValues.font_bold.resetValue();
|
||||
|
||||
if (italic)
|
||||
backendValues.font_italic.value = bold;
|
||||
else
|
||||
backendValues.font_italic.resetValue();
|
||||
|
||||
backendValues.font_family.value = family;
|
||||
backendValues.font_pointSize.value = fontSize;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 4;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 6;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 4;
|
||||
bottomMargin: 8;
|
||||
leftMargin: 6;
|
||||
rightMargin: 6;
|
||||
QLabel {
|
||||
text: "Text Format:"
|
||||
font.bold: true;
|
||||
}
|
||||
|
||||
QComboBox {
|
||||
minimumHeight: 22;
|
||||
items : { ["PlainText", "RichText", "AutoText"] }
|
||||
currentText: backendValues.textFormat.value;
|
||||
onItemsChanged: {
|
||||
currentText = backendValues.textFormat.value;
|
||||
}
|
||||
|
||||
onCurrentTextChanged: {
|
||||
if (count == 3)
|
||||
backendValues.textFormat.value = currentText;
|
||||
onCurrentTextChanged: {
|
||||
if (count == 3)
|
||||
backendValues.textFormat.value = currentText;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 4;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 6;
|
||||
rightMargin: 6;
|
||||
QLabel {
|
||||
text: "Horizontal Alignment:"
|
||||
font.bold: true;
|
||||
}
|
||||
|
||||
QComboBox {
|
||||
items : { ["AlignLeft", "AlignRight", "AlignHCenter"] }
|
||||
currentText: backendValues.horizontalAlignment.value;
|
||||
onItemsChanged: {
|
||||
currentText = backendValues.horizontalAlignment.value;
|
||||
}
|
||||
|
||||
onCurrentTextChanged: {
|
||||
if (count == 3)
|
||||
backendValues.horizontalAlignment.value = currentText;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 4;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 6;
|
||||
rightMargin: 6;
|
||||
QLabel {
|
||||
text: "Vertical Alignment:"
|
||||
font.bold: true;
|
||||
}
|
||||
|
||||
QComboBox {
|
||||
items : { ["AlignTop", "AlignBottom", "AlignVCenter"] }
|
||||
currentText: backendValues.verticalAlignment.value;
|
||||
onItemsChanged: {
|
||||
currentText = backendValues.verticalAlignment.value;
|
||||
}
|
||||
|
||||
onCurrentTextChanged: {
|
||||
if (count == 3)
|
||||
backendValues.verticalAlignment.value = currentText;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
|
||||
ColorWidget {
|
||||
minimumHeight: 20;
|
||||
maximumHeight: 20;
|
||||
text: "Color:";
|
||||
color: backendValues.color.value;
|
||||
onColorChanged: {
|
||||
backendValues.color.value = strColor;
|
||||
}
|
||||
}
|
||||
|
||||
ColorWidget {
|
||||
minimumHeight: 20;
|
||||
maximumHeight: 20;
|
||||
text: "Selection Color:";
|
||||
color: backendValues.selectionColor.value;
|
||||
onColorChanged: {
|
||||
backendValues.selectionColor.value = strColor;
|
||||
}
|
||||
}
|
||||
|
||||
ColorWidget {
|
||||
minimumHeight: 20;
|
||||
maximumHeight: 20;
|
||||
text: "Selected Text Color:";
|
||||
color: backendValues.selectedTextColor.value;
|
||||
onColorChanged: {
|
||||
backendValues.selectedTextColor.value = strColor;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 2;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
|
||||
CheckBox {
|
||||
|
||||
text: "Read Only";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues.readOnly;
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: "Cursor Visible";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues.cursorVisible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 2;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
|
||||
CheckBox {
|
||||
text: "Focus On Press";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues. focusOnPress.value;
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: "Persistent Selection";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues.persistentSelection.value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
FontGroupBox {
|
||||
finished: finishedNotify;
|
||||
|
||||
}
|
||||
|
||||
TextInputGroupBox {
|
||||
finished: finishedNotify;
|
||||
}
|
||||
QScrollArea {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
GroupBox {
|
||||
|
||||
id: TextInputGroupBox
|
||||
caption: "Text Input";
|
||||
|
||||
layout: VerticalLayout {
|
||||
|
||||
ColorWidget {
|
||||
text: "Selection Color:";
|
||||
color: backendValues.selectionColor.value;
|
||||
onColorChanged: {
|
||||
backendValues.selectionColor.value = strColor;
|
||||
}
|
||||
}
|
||||
|
||||
ColorWidget {
|
||||
text: "Selected Text Color:";
|
||||
color: backendValues.selectedTextColor.value;
|
||||
onColorChanged: {
|
||||
backendValues.selectedTextColor.value = strColor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
|
||||
CheckBox {
|
||||
|
||||
text: "Read Only";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues.readOnly;
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
|
||||
text: "Cursor Visible";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues.cursorVisible;
|
||||
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: "Focus On Press";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues. focusOnPress;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,176 +1,31 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
GroupBox {
|
||||
maximumHeight: 420;
|
||||
minimumHeight: 420;
|
||||
|
||||
finished: finishedNotify;
|
||||
caption: "Text Input";
|
||||
QWidget {
|
||||
id: textSpecifics;
|
||||
|
||||
layout: QVBoxLayout {
|
||||
id: textSpecifics;
|
||||
topMargin: 12;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 8;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
QLabel {
|
||||
text: "Text:"
|
||||
font.bold: true;
|
||||
}
|
||||
QLineEdit {
|
||||
minimumHeight: 24;
|
||||
text: backendValues.text.value;
|
||||
onTextChanged: {
|
||||
backendValues.text.value = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
topMargin: 0
|
||||
bottomMargin: 0
|
||||
leftMargin: 0
|
||||
rightMargin: 0
|
||||
spacing: 0
|
||||
|
||||
StandardTextGroupBox {
|
||||
showStyleColor: true
|
||||
finished: finishedNotify;
|
||||
|
||||
}
|
||||
|
||||
FontWidget {
|
||||
text: "Font:";
|
||||
FontGroupBox {
|
||||
finished: finishedNotify;
|
||||
|
||||
bold: backendValues.font_bold.value;
|
||||
italic: backendValues.font_italic.value;
|
||||
family: backendValues.font_family.value;
|
||||
fontSize: backendValues.font_pointSize.value;
|
||||
|
||||
onDataFontChanged: {
|
||||
|
||||
if (bold)
|
||||
backendValues.font_bold.value = bold;
|
||||
else
|
||||
backendValues.font_bold.resetValue();
|
||||
|
||||
if (italic)
|
||||
backendValues.font_italic.value = bold;
|
||||
else
|
||||
backendValues.font_italic.resetValue();
|
||||
|
||||
backendValues.font_family.value = family;
|
||||
backendValues.font_pointSize.value = fontSize;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
TextInputGroupBox {
|
||||
finished: finishedNotify;
|
||||
}
|
||||
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 4;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 6;
|
||||
rightMargin: 6;
|
||||
QLabel {
|
||||
text: "Horizontal Alignment:"
|
||||
font.bold: true;
|
||||
}
|
||||
|
||||
QComboBox {
|
||||
items : { ["AlignLeft", "AlignRight", "AlignHCenter"] }
|
||||
currentText: backendValues.horizontalAlignment.value;
|
||||
onItemsChanged: {
|
||||
currentText = backendValues.horizontalAlignment.value;
|
||||
}
|
||||
|
||||
onCurrentTextChanged: {
|
||||
if (count == 3)
|
||||
backendValues.horizontalAlignment.value = currentText;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
|
||||
ColorWidget {
|
||||
minimumHeight: 20;
|
||||
maximumHeight: 20;
|
||||
text: "Color:";
|
||||
color: backendValues.color.value;
|
||||
onColorChanged: {
|
||||
backendValues.color.value = strColor;
|
||||
}
|
||||
}
|
||||
|
||||
ColorWidget {
|
||||
minimumHeight: 20;
|
||||
maximumHeight: 20;
|
||||
text: "Selection Color:";
|
||||
color: backendValues.selectionColor.value;
|
||||
onColorChanged: {
|
||||
backendValues.selectionColor.value = strColor;
|
||||
}
|
||||
}
|
||||
|
||||
ColorWidget {
|
||||
minimumHeight: 20;
|
||||
maximumHeight: 20;
|
||||
text: "Selected Text Color:";
|
||||
color: backendValues.selectedTextColor.value;
|
||||
onColorChanged: {
|
||||
backendValues.selectedTextColor.value = strColor;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 2;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
|
||||
CheckBox {
|
||||
|
||||
text: "Read Only";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues.readOnly;
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
|
||||
text: "Cursor Visible";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues.cursorVisible;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 2;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
|
||||
CheckBox {
|
||||
text: "Focus On Press";
|
||||
baseStateFlag: isBaseState;
|
||||
checkable: true;
|
||||
backendValue: backendValues. focusOnPress;
|
||||
}
|
||||
|
||||
}
|
||||
QScrollArea {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,172 +1,28 @@
|
||||
import Qt 4.6
|
||||
import Bauhaus 1.0
|
||||
|
||||
GroupBox {
|
||||
maximumHeight: 280;
|
||||
|
||||
finished: finishedNotify;
|
||||
caption: "Text";
|
||||
QWidget {
|
||||
id: textSpecifics;
|
||||
|
||||
layout: QVBoxLayout {
|
||||
id: textSpecifics;
|
||||
topMargin: 18;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 4;
|
||||
rightMargin: 4;
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 8;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
QLabel {
|
||||
text: "Text:"
|
||||
font.bold: true;
|
||||
}
|
||||
QLineEdit {
|
||||
minimumHeight: 24;
|
||||
text: backendValues.text.value;
|
||||
onTextChanged: {
|
||||
backendValues.text.value = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 6;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
QLabel {
|
||||
text: "wrap:"
|
||||
font.bold: true;
|
||||
}
|
||||
CheckBox {
|
||||
baseStateFlag: isBaseState;
|
||||
text: "isWrapping";
|
||||
checkable: true;
|
||||
backendValue: backendValues.wrap;
|
||||
}
|
||||
}
|
||||
topMargin: 0
|
||||
bottomMargin: 0
|
||||
leftMargin: 0
|
||||
rightMargin: 0
|
||||
spacing: 0
|
||||
|
||||
StandardTextGroupBox {
|
||||
showStyleColor: true
|
||||
finished: finishedNotify;
|
||||
|
||||
}
|
||||
|
||||
FontWidget {
|
||||
text: "Font:";
|
||||
FontGroupBox {
|
||||
finished: finishedNotify;
|
||||
|
||||
bold: backendValues.font_bold.value;
|
||||
italic: backendValues.font_italic.value;
|
||||
family: backendValues.font_family.value;
|
||||
fontSize: backendValues.font_pointSize.value;
|
||||
|
||||
onDataFontChanged: {
|
||||
|
||||
if (bold)
|
||||
backendValues.font_bold.value = bold;
|
||||
else
|
||||
backendValues.font_bold.resetValue();
|
||||
|
||||
if (italic)
|
||||
backendValues.font_italic.value = bold;
|
||||
else
|
||||
backendValues.font_italic.resetValue();
|
||||
|
||||
backendValues.font_family.value = family;
|
||||
backendValues.font_pointSize.value = fontSize;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 4;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 6;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 4;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 6;
|
||||
QLabel {
|
||||
text: "Horizontal Alignment:"
|
||||
font.bold: true;
|
||||
}
|
||||
|
||||
QComboBox {
|
||||
items : { ["AlignLeft", "AlignRight", "AlignHCenter"] }
|
||||
currentText: backendValues.horizontalAlignment.value;
|
||||
onItemsChanged: {
|
||||
currentText = backendValues.horizontalAlignment.value;
|
||||
}
|
||||
|
||||
onCurrentTextChanged: {
|
||||
if (count == 3);
|
||||
backendValues.horizontalAlignment.value = currentText;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 4;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 6;
|
||||
QLabel {
|
||||
text: "Vertical Alignment:"
|
||||
font.bold: true;
|
||||
}
|
||||
|
||||
QComboBox {
|
||||
items : { ["AlignTop", "AlignBottom", "AlignVCenter"] }
|
||||
currentText: backendValues.verticalAlignment.value;
|
||||
onItemsChanged: {
|
||||
currentText = backendValues.verticalAlignment.value;
|
||||
}
|
||||
|
||||
onCurrentTextChanged: {
|
||||
if (count == 3)
|
||||
backendValues.verticalAlignment.value = currentText;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLine {
|
||||
}
|
||||
QWidget {
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 2;
|
||||
bottomMargin: 2;
|
||||
leftMargin: 10;
|
||||
rightMargin: 10;
|
||||
|
||||
ColorWidget {
|
||||
text: "Color:";
|
||||
color: backendValues.color.value;
|
||||
onColorChanged: {
|
||||
backendValues.color.value = strColor;
|
||||
}
|
||||
}
|
||||
ColorWidget {
|
||||
text: "Style color:";
|
||||
color: backendValues.styleColor.value;
|
||||
onColorChanged: {
|
||||
backendValues.styleColor.value = strColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
QScrollArea {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,51 +5,25 @@ GroupBox {
|
||||
finished: finishedNotify;
|
||||
caption: "Type";
|
||||
|
||||
maximumHeight: 100;
|
||||
minimumWidth: 280;
|
||||
layout: QHBoxLayout {
|
||||
topMargin: 18;
|
||||
bottomMargin: 0;
|
||||
leftMargin: 60;
|
||||
rightMargin: 10;
|
||||
|
||||
|
||||
|
||||
layout: VerticalLayout {
|
||||
QWidget {
|
||||
layout: QVBoxLayout {
|
||||
topMargin: 6;
|
||||
bottomMargin: 0;
|
||||
leftMargin: 10;
|
||||
bottomMargin: 10;
|
||||
|
||||
QLabel {
|
||||
layout: HorizontalLayout {
|
||||
Label {
|
||||
text: "Type";
|
||||
windowTextColor: isBaseState ? "#000000" : "#FF0000";
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
}
|
||||
|
||||
QLabel {
|
||||
font.bold: true;
|
||||
text: "Id";
|
||||
alignment: "Qt::AlignRight | Qt::AlignVCenter"
|
||||
}
|
||||
|
||||
|
||||
} //QVBoxLayout
|
||||
} //QWidget
|
||||
QWidget {
|
||||
|
||||
layout: QVBoxLayout {
|
||||
topMargin: 6;
|
||||
bottomMargin: 0;
|
||||
leftMargin: 10;
|
||||
bottomMargin: 10;
|
||||
|
||||
windowTextColor: isBaseState ? "#000000" : "#FF0000";
|
||||
}
|
||||
QLineEdit {
|
||||
styleSheetFile: "typeLabel.css"
|
||||
text: backendValues.className === undefined ? "" : backendValues.className.value;
|
||||
readOnly :true;
|
||||
}
|
||||
}
|
||||
}
|
||||
QWidget {
|
||||
layout: HorizontalLayout {
|
||||
Label {
|
||||
text: "Id";
|
||||
}
|
||||
|
||||
QLineEdit {
|
||||
id: IdLineEdit;
|
||||
@@ -59,12 +33,8 @@ GroupBox {
|
||||
onEditingFinished: {
|
||||
backendValues.id.value = text;
|
||||
}
|
||||
} //LineEdit
|
||||
|
||||
|
||||
} //QVBoxLayout
|
||||
} //QWidget
|
||||
|
||||
|
||||
} //QHBoxLayout
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user