src/hbcore/gui/hbwidgetbase_p.h
changeset 28 b7da29130b0e
parent 23 e6ad4ef83b23
--- a/src/hbcore/gui/hbwidgetbase_p.h	Thu Sep 02 20:44:51 2010 +0300
+++ b/src/hbcore/gui/hbwidgetbase_p.h	Fri Sep 17 08:32:10 2010 +0300
@@ -90,13 +90,28 @@
             // Does not overlap with values set in attributeToBitIndex(Qt::WidgetAttribute)
             case Hb::InteractionDisabled: bit = 1; break;
         case Hb::InsidePopup: bit = 2; break;
-        case Hb::InputMethodNeutral: bit = 3; break;
-        case Hb::Widget: bit = 4; break;
+        case Hb::Widget: bit = 3; break;
         default: break;
         }
         return bit;
     }
 
+    /*
+        In case when \a newAlign has no set vertical or horizontal part,
+        missing part is replaced with respective part of \a oldAlign.
+     */
+    static inline Qt::Alignment combineAlignment (Qt::Alignment newAlign, Qt::Alignment oldAlign)
+    {
+        newAlign &= Qt::AlignVertical_Mask | Qt::AlignHorizontal_Mask;
+        if ((newAlign & Qt::AlignHorizontal_Mask) == 0) {
+            newAlign |= oldAlign & Qt::AlignHorizontal_Mask;
+        }
+        if ((newAlign & Qt::AlignVertical_Mask) == 0) {
+            newAlign |= oldAlign & Qt::AlignVertical_Mask;
+        }
+        return newAlign;
+    }
+
     quint32 mApiProtectionFlags;
     quint32 attributes : 5;
     HbFontSpec fontSpec;