From 0379674bd05fd1b4af87e3a5d883add735f0ad7c Mon Sep 17 00:00:00 2001
From: Jens Bache-Wiig <jensb.bache-wiig@nokia.com>
Date: Wed, 7 Sep 2011 12:06:07 +0200
Subject: [PATCH] Rename QStyleItem to StyleItem

---
 components/Button.qml          |  2 +-
 components/CheckBox.qml        |  2 +-
 components/ChoiceList.qml      |  6 +++---
 components/ComboBox.qml        |  2 +-
 components/Dial.qml            |  2 +-
 components/Frame.qml           |  2 +-
 components/GroupBox.qml        |  2 +-
 components/ProgressBar.qml     |  2 +-
 components/RadioButton.qml     |  2 +-
 components/ScrollArea.qml      |  4 ++--
 components/ScrollBar.qml       |  2 +-
 components/Slider.qml          |  4 ++--
 components/SpinBox.qml         |  6 +++---
 components/SplitterRow.qml     |  4 ++--
 components/Switch.qml          |  4 ++--
 components/TabBar.qml          |  4 ++--
 components/TabFrame.qml        |  2 +-
 components/TableView.qml       | 16 ++++++++--------
 components/TextField.qml       |  4 ++--
 components/ToolBar.qml         |  2 +-
 components/ToolButton.qml      |  4 ++--
 examples/Gallery.qml           |  2 +-
 examples/TableViewGallery.qml  |  2 +-
 src/styleitem/qstyleplugin.cpp |  3 +--
 24 files changed, 42 insertions(+), 43 deletions(-)

diff --git a/components/Button.qml b/components/Button.qml
index 36345014d..53d56b65d 100644
--- a/components/Button.qml
+++ b/components/Button.qml
@@ -11,7 +11,7 @@ Components.Button {
     property bool defaultbutton
     property string hint
 
-    background: QStyleItem {
+    background: StyleItem {
         id: styleitem
         anchors.fill: parent
         elementType: "button"
diff --git a/components/CheckBox.qml b/components/CheckBox.qml
index bf40d529b..cd4ad29c3 100644
--- a/components/CheckBox.qml
+++ b/components/CheckBox.qml
@@ -10,7 +10,7 @@ Components.CheckBox{
     width: Math.max(110, backgroundItem.textWidth(text) + 40)
     height: 20
 
-    background: QStyleItem {
+    background: StyleItem {
         id:styleitem
         elementType:"checkbox"
         sunken:pressed
diff --git a/components/ChoiceList.qml b/components/ChoiceList.qml
index 1582cc9ff..381db9ee0 100644
--- a/components/ChoiceList.qml
+++ b/components/ChoiceList.qml
@@ -15,7 +15,7 @@ Components.ChoiceList {
     topMargin: 4
     bottomMargin: 4
 
-    background: QStyleItem {
+    background: StyleItem {
         anchors.fill: parent
         elementType: "combobox"
         sunken: pressed
@@ -33,7 +33,7 @@ Components.ChoiceList {
         height: 22
         anchors.left: parent.left
         width: choicelist.width
-        QStyleItem {
+        StyleItem {
             anchors.fill: parent
             elementType: "comboboxitem"
             text: itemText
@@ -41,7 +41,7 @@ Components.ChoiceList {
 
         }
     }
-    popupFrame: QStyleItem {
+    popupFrame: StyleItem {
         property string popupLocation: backgroundItem.styleHint("comboboxpopup") ? "center" : "below"
         property int fw: backgroundItem.pixelMetric("menupanelwidth");
         anchors.leftMargin: backgroundItem.pixelMetric("menuhmargin") + fw
diff --git a/components/ComboBox.qml b/components/ComboBox.qml
index ebc537f3a..3b80b39fc 100644
--- a/components/ComboBox.qml
+++ b/components/ComboBox.qml
@@ -64,7 +64,7 @@ Custom.BasicButton {
     property alias hoveredText: popup.hoveredText
     property string hint
 
-    background: QStyleItem {
+    background: StyleItem {
         anchors.fill: parent
         elementType: "combobox"
         sunken: comboBox.pressed
diff --git a/components/Dial.qml b/components/Dial.qml
index 95560cb86..3e42ccf2d 100644
--- a/components/Dial.qml
+++ b/components/Dial.qml
@@ -3,7 +3,7 @@ import "custom" as Components
 
 // jens: ContainsMouse breaks drag functionality
 
-QStyleItem {
+StyleItem {
     id: dial
 
     width:100
diff --git a/components/Frame.qml b/components/Frame.qml
index 8233c455e..9c9d4aa8f 100644
--- a/components/Frame.qml
+++ b/components/Frame.qml
@@ -6,7 +6,7 @@ Item {
     height: Math.max(100, content.childrenRect.height + 2 * content.frameWidth)
     property alias raised: style.raised
     property alias sunken: style.sunken
-    QStyleItem {
+    StyleItem {
         id: style
         anchors.fill: parent
         elementType: "frame"
diff --git a/components/GroupBox.qml b/components/GroupBox.qml
index 0afcfc476..098bc1c45 100644
--- a/components/GroupBox.qml
+++ b/components/GroupBox.qml
@@ -7,7 +7,7 @@ Components.GroupBox {
     height: contentHeight + sizeHint.height + 4
     property variant sizeHint: backgroundItem.sizeFromContents(0, 24)
     property bool flat: false
-    background : QStyleItem {
+    background : StyleItem {
         id: styleitem
         elementType: "groupbox"
         anchors.fill: parent
diff --git a/components/ProgressBar.qml b/components/ProgressBar.qml
index 9099076c8..676518421 100644
--- a/components/ProgressBar.qml
+++ b/components/ProgressBar.qml
@@ -13,7 +13,7 @@ Components.ProgressBar {
 
     SystemPalette {id: syspal}
 
-    background: QStyleItem {
+    background: StyleItem {
         anchors.fill: parent
         elementType: "progressbar"
         // XXX: since desktop uses int instead of real, the progressbar
diff --git a/components/RadioButton.qml b/components/RadioButton.qml
index 552c9ad8c..8d490c002 100644
--- a/components/RadioButton.qml
+++ b/components/RadioButton.qml
@@ -10,7 +10,7 @@ Components.CheckBox {
     width:110
     height:20
 
-    background: QStyleItem {
+    background: StyleItem {
         elementType:"radiobutton"
         sunken:pressed
         on:checked || pressed
diff --git a/components/ScrollArea.qml b/components/ScrollArea.qml
index 00b01c961..ee0699652 100644
--- a/components/ScrollArea.qml
+++ b/components/ScrollArea.qml
@@ -48,7 +48,7 @@ FocusScope {
         anchors.margins: frameWidth
     }
 
-    QStyleItem {
+    StyleItem {
         id: styleitem
         elementType: "frame"
         onElementTypeChanged: scrollarea.frameWidth = styleitem.pixelMetric("defaultframewidth");
@@ -146,7 +146,7 @@ FocusScope {
         color: syspal.window
     }
 
-    QStyleItem {
+    StyleItem {
         z: 2
         anchors.fill: parent
         anchors.margins: -3
diff --git a/components/ScrollBar.qml b/components/ScrollBar.qml
index 2df691122..e496afab6 100644
--- a/components/ScrollBar.qml
+++ b/components/ScrollBar.qml
@@ -131,7 +131,7 @@ Item {
                 value = minimumValue
         }
 
-        QStyleItem {
+        StyleItem {
             id: styleitem
             anchors.fill:parent
             elementType: "scrollbar"
diff --git a/components/Slider.qml b/components/Slider.qml
index 69f678b22..6c8aa0034 100644
--- a/components/Slider.qml
+++ b/components/Slider.qml
@@ -9,7 +9,7 @@ Components.Slider{
     property bool tickmarksEnabled: true
     property string tickPosition: "Below" // "Above", "Below", "BothSides"
 
-    QStyleItem { id:buttonitem; elementType: "slider" }
+    StyleItem { id:buttonitem; elementType: "slider" }
 
     property variant sizehint: buttonitem.sizeFromContents(23, 23)
     property int orientation: Qt.Horizontal
@@ -18,7 +18,7 @@ Components.Slider{
     width: orientation === Qt.Horizontal ? 200 : sizehint.height
     property string hint;
 
-    groove: QStyleItem {
+    groove: StyleItem {
         anchors.fill:parent
         elementType: "slider"
         sunken: pressed
diff --git a/components/SpinBox.qml b/components/SpinBox.qml
index 525ade6fd..a7cba6bd0 100644
--- a/components/SpinBox.qml
+++ b/components/SpinBox.qml
@@ -16,7 +16,7 @@ Components.SpinBox {
     leftMargin:6
     rightMargin:6
 
-    QStyleItem { id:edititem ; elementType:"edit" ; visible:false }
+    StyleItem { id:edititem ; elementType:"edit" ; visible:false }
     property int buttonHeight:  edititem.sizeFromContents(70, 20).height
     property int buttonWidth: edititem.sizeFromContents(70, 20).width
 
@@ -40,7 +40,7 @@ Components.SpinBox {
             id: focusFrame
             anchors.fill: editBackground
             visible: frameitem.styleHint("focuswidget")
-            QStyleItem {
+            StyleItem {
                 id: frameitem
                 anchors.margins: -6
                 anchors.leftMargin: -6
@@ -63,7 +63,7 @@ Components.SpinBox {
         onWidthChanged: updateRect()
         onHeightChanged: updateRect()
 
-        QStyleItem {
+        StyleItem {
             id: styleitem
             anchors.fill: parent
             elementType: "spinbox"
diff --git a/components/SplitterRow.qml b/components/SplitterRow.qml
index 7477ec82c..783bc23a4 100644
--- a/components/SplitterRow.qml
+++ b/components/SplitterRow.qml
@@ -2,7 +2,7 @@ import QtQuick 1.1
 import "custom" as Components
 
 Components.SplitterRow {
-    handleBackground: QStyleItem {
+    handleBackground: StyleItem {
             id: styleitem
             elementType: "splitter"
             width: pixelMetric("splitterwidth")
@@ -17,7 +17,7 @@ Components.SplitterRow {
                 drag.axis: Qt.YAxis
                 drag.target: handle
 
-                QStyleItem {
+                StyleItem {
                     anchors.fill: parent
                     cursor: "splithcursor"
                 }
diff --git a/components/Switch.qml b/components/Switch.qml
index 08518b13b..45bdfd84e 100644
--- a/components/Switch.qml
+++ b/components/Switch.qml
@@ -6,12 +6,12 @@ Components.Switch {
     minimumWidth:100
     minimumHeight:30
 
-    groove:QStyleItem {
+    groove:StyleItem {
         elementType:"edit"
         sunken: true
     }
 
-    handle: QStyleItem {
+    handle: StyleItem {
         elementType:"button"
         width:widget.width/2
         height:widget.height-4
diff --git a/components/TabBar.qml b/components/TabBar.qml
index 1b78aa653..4a1504575 100644
--- a/components/TabBar.qml
+++ b/components/TabBar.qml
@@ -38,7 +38,7 @@ Item {
         return null;
     }
 
-    QStyleItem {
+    StyleItem {
         visible:false
         id:styleitem
         elementType: "tab"
@@ -75,7 +75,7 @@ Item {
                     height = rect.height
                 }
                 // Component.onCompleted: print("taboverlap" + tabOverlap + " tabbaseoverlap " + tabBaseOverlap + " overlap " +__overlap + " hspace " + tabHSpace)
-                QStyleItem {
+                StyleItem {
                     id: style
                     elementType: "tab"
                     selected: tab.selected
diff --git a/components/TabFrame.qml b/components/TabFrame.qml
index ae3c73c00..841e9659e 100644
--- a/components/TabFrame.qml
+++ b/components/TabFrame.qml
@@ -43,7 +43,7 @@ Item {
             current-=1
     }
 
-    QStyleItem {
+    StyleItem {
         id: frameitem
         z: style == "oxygen" ? 1 : 0
         elementType: "tabframe"
diff --git a/components/TableView.qml b/components/TableView.qml
index 1ca44d934..4549d02f0 100644
--- a/components/TableView.qml
+++ b/components/TableView.qml
@@ -116,7 +116,7 @@ FocusScope{
     Component {
         id: nativeDelegate
         // This gives more native styling, but might be less performant
-        QStyleItem {
+        StyleItem {
             elementType: "item"
             text:   itemValue
             selected: itemSelected
@@ -125,7 +125,7 @@ FocusScope{
 
     Component {
         id: headerDelegate
-        QStyleItem {
+        StyleItem {
             elementType: "header"
             activeControl: itemSort
             raised: true
@@ -137,7 +137,7 @@ FocusScope{
 
     Component {
         id: rowDelegate
-        QStyleItem {
+        StyleItem {
             id: rowstyle
             elementType: "itemrow"
             activeControl: itemAlternateBackground ? "alternate" : ""
@@ -154,7 +154,7 @@ FocusScope{
         anchors.bottomMargin: (!frameAroundContents && hscrollbar.visible ? hscrollbar.height : 0) +frameWidth
     }
 
-    QStyleItem {
+    StyleItem {
         id: frameitem
         elementType: "frame"
         onElementTypeChanged: scrollarea.frameWidth = styleitem.pixelMetric("defaultframewidth");
@@ -457,7 +457,7 @@ FocusScope{
                                 header[index].width = minWidth
                         }
                         onPressedChanged: if(pressed)offset=mouseX
-                        QStyleItem {
+                        StyleItem {
                             anchors.fill: parent
                             cursor: "splithcursor"
                         }
@@ -557,7 +557,7 @@ FocusScope{
         onTriggered:contentY = vscrollbar.value
     }
 
-    QStyleItem {
+    StyleItem {
         z: 2
         anchors.fill: parent
         anchors.margins: -4
@@ -565,13 +565,13 @@ FocusScope{
         elementType: "focusframe"
     }
 
-    QStyleItem {
+    StyleItem {
         id: styleitem
         elementType: "header"
         visible:false
         property int frameoffset: style === "mac" ? -1 : 0
     }
-    QStyleItem {
+    StyleItem {
         id: rowstyleitem
         elementType: "item"
         visible:false
diff --git a/components/TextField.qml b/components/TextField.qml
index 0c0682455..9ff7debf4 100644
--- a/components/TextField.qml
+++ b/components/TextField.qml
@@ -15,7 +15,7 @@ Components.TextField {
     width: 200
     clip: false
 
-    background: QStyleItem {
+    background: StyleItem {
         anchors.fill: parent
         elementType: "edit"
         sunken: true
@@ -28,7 +28,7 @@ Components.TextField {
         anchors.fill: textfield
         parent: textfield
         visible: framestyle.styleHint("focuswidget")
-        QStyleItem {
+        StyleItem {
             id: framestyle
             anchors.margins: -2
             anchors.rightMargin:-4
diff --git a/components/ToolBar.qml b/components/ToolBar.qml
index 6185cc6ca..67fc21d6b 100644
--- a/components/ToolBar.qml
+++ b/components/ToolBar.qml
@@ -1,7 +1,7 @@
 import QtQuick 1.0
 import "custom" as Components
 
-QStyleItem{
+StyleItem{
     id: toolbar
     width: 200
     height: sizeFromContents(32, 32).height
diff --git a/components/ToolButton.qml b/components/ToolButton.qml
index 82593bc55..68a07e97f 100644
--- a/components/ToolButton.qml
+++ b/components/ToolButton.qml
@@ -7,9 +7,9 @@ Components.Button {
     height: 40; //styleitem.sizeFromContents(32, 32).height
     width: 40; //styleitem.sizeFromContents(32, 32).width
 
-    QStyleItem {elementType: "toolbutton"; id:styleitem  }
+    StyleItem {elementType: "toolbutton"; id:styleitem  }
 
-    background: QStyleItem {
+    background: StyleItem {
         anchors.fill: parent
         id: styleitem
         elementType: "toolbutton"
diff --git a/examples/Gallery.qml b/examples/Gallery.qml
index 50af1aa8a..e559a4155 100644
--- a/examples/Gallery.qml
+++ b/examples/Gallery.qml
@@ -205,7 +205,7 @@ Rectangle {
     }
 
     SystemPalette {id: syspal}
-    QStyleItem{ id: styleitem}
+    StyleItem{ id: styleitem}
     color: syspal.window
     ListModel {
         id: choices
diff --git a/examples/TableViewGallery.qml b/examples/TableViewGallery.qml
index 033acf029..41a966c3c 100644
--- a/examples/TableViewGallery.qml
+++ b/examples/TableViewGallery.qml
@@ -36,7 +36,7 @@ Rectangle {
     }
 
     SystemPalette {id: syspal}
-    QStyleItem{ id: styleitem}
+    StyleItem{ id: styleitem}
     color: syspal.window
 
     XmlListModel {
diff --git a/src/styleitem/qstyleplugin.cpp b/src/styleitem/qstyleplugin.cpp
index 7bf9c8461..6a0273af7 100644
--- a/src/styleitem/qstyleplugin.cpp
+++ b/src/styleitem/qstyleplugin.cpp
@@ -79,8 +79,7 @@ public:
 
 void StylePlugin::registerTypes(const char *uri)
 {
-    qDebug() << "register" << uri;
-    qmlRegisterType<QStyleItem>(uri, 0, 1, "QStyleItem");
+    qmlRegisterType<QStyleItem>(uri, 0, 1, "StyleItem");
     qmlRegisterType<QRangeModel>(uri, 0, 1, "RangeModel");
     qmlRegisterType<QGraphicsDropShadowEffect>(uri, 0, 1, "DropShadow");
     qmlRegisterType<QDeclarativeFolderListModel>(uri, 0, 1, "FileSystemModel");
-- 
GitLab