OSDN Git Service

QAbstractButtonPrivate and QActionGroupPrivate cleanup
authorIvailo Monev <xakepa10@laimg.moc>
Sat, 13 Jul 2019 20:30:51 +0000 (20:30 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Sat, 13 Jul 2019 20:55:12 +0000 (20:55 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/gui/kernel/qactiongroup.cpp
src/gui/widgets/qabstractbutton_p.h

index cfe5c0d..92487ed 100644 (file)
@@ -54,12 +54,12 @@ class QActionGroupPrivate : public QObjectPrivate
 {
     Q_DECLARE_PUBLIC(QActionGroup)
 public:
-    QActionGroupPrivate() : exclusive(1), enabled(1), visible(1)  { }
+    QActionGroupPrivate() : exclusive(true), enabled(true), visible(true)  { }
     QList<QAction *> actions;
     QPointer<QAction> current;
-    uint exclusive : 1;
-    uint enabled : 1;
-    uint visible : 1;
+    bool exclusive;
+    bool enabled;
+    bool visible;
 
 private:
     void _q_actionTriggered();  //private slot
@@ -295,8 +295,8 @@ void QActionGroup::setEnabled(bool b)
 {
     Q_D(QActionGroup);
     d->enabled = b;
-    for(QList<QAction*>::const_iterator it = d->actions.constBegin(); it != d->actions.constEnd(); ++it) {
-        (*it)->setEnabled(b);
+    foreach(QAction* it, d->actions) {
+        it->setEnabled(b);
     }
 }
 
@@ -329,8 +329,8 @@ void QActionGroup::setVisible(bool b)
 {
     Q_D(QActionGroup);
     d->visible = b;
-    for(QList<QAction*>::Iterator it = d->actions.begin(); it != d->actions.end(); ++it) {
-        (*it)->setVisible(b);
+    foreach(QAction* it, d->actions) {
+        it->setVisible(b);
     }
 }
 
index 4a34d53..11be6be 100644 (file)
@@ -45,7 +45,7 @@
 // We mean it.
 //
 
-#include "QtCore/qbasictimer.h"
+#include "qbasictimer.h"
 #include "qwidget_p.h"
 
 QT_BEGIN_NAMESPACE
@@ -63,13 +63,13 @@ public:
     QKeySequence shortcut;
     int shortcutId;
 #endif
-    uint checkable :1;
-    uint checked :1;
-    uint autoRepeat :1;
-    uint autoExclusive :1;
-    uint down :1;
-    uint blockRefresh :1;
-    uint pressed : 1;
+    bool checkable;
+    bool checked;
+    bool autoRepeat;
+    bool autoExclusive;
+    bool down;
+    bool blockRefresh;
+    bool pressed;
 
 #ifndef QT_NO_BUTTONGROUP
     QButtonGroup* group;