瀏覽代碼

Merge branch 'ctkexpandbutton-plugin-and-sizepolicy'

* ctkexpandbutton-plugin-and-sizepolicy:
  Expose ctkExpandButton plugin in CTK widgets plugins
  ctkExpandButton horizontal policy is fixed
Julien Finet 13 年之前
父節點
當前提交
f9c9f10e81
共有 3 個文件被更改,包括 5 次插入2 次删除
  1. 2 0
      Libs/Widgets/Plugins/ctkWidgetsPlugins.h
  2. 1 1
      Libs/Widgets/ctkExpandButton.cpp
  3. 2 1
      Libs/Widgets/ctkExpandButton.h

+ 2 - 0
Libs/Widgets/Plugins/ctkWidgetsPlugins.h

@@ -41,6 +41,7 @@
 #include "ctkDoubleRangeSliderPlugin.h"
 #include "ctkDoubleRangeSliderPlugin.h"
 #include "ctkDoubleSliderPlugin.h"
 #include "ctkDoubleSliderPlugin.h"
 #include "ctkDynamicSpacerPlugin.h"
 #include "ctkDynamicSpacerPlugin.h"
+#include "ctkExpandButtonPlugin.h"
 #include "ctkFittedTextBrowserPlugin.h"
 #include "ctkFittedTextBrowserPlugin.h"
 #include "ctkFontButtonPlugin.h"
 #include "ctkFontButtonPlugin.h"
 #include "ctkMaterialPropertyPreviewLabelPlugin.h"
 #include "ctkMaterialPropertyPreviewLabelPlugin.h"
@@ -88,6 +89,7 @@ public:
             << new ctkDoubleRangeSliderPlugin
             << new ctkDoubleRangeSliderPlugin
             << new ctkDoubleSliderPlugin
             << new ctkDoubleSliderPlugin
             << new ctkDynamicSpacerPlugin
             << new ctkDynamicSpacerPlugin
+            << new ctkExpandButtonPlugin
             << new ctkFittedTextBrowserPlugin
             << new ctkFittedTextBrowserPlugin
             << new ctkFontButtonPlugin
             << new ctkFontButtonPlugin
             << new ctkMaterialPropertyPreviewLabelPlugin
             << new ctkMaterialPropertyPreviewLabelPlugin

+ 1 - 1
Libs/Widgets/ctkExpandButton.cpp

@@ -54,7 +54,7 @@ void ctkExpandButtonPrivate::init()
   Q_Q(ctkExpandButton);
   Q_Q(ctkExpandButton);
   q->setAutoRaise(true);
   q->setAutoRaise(true);
   q->setOrientation(Qt::Horizontal);
   q->setOrientation(Qt::Horizontal);
-  q->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum);
+  q->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
   q->setCheckable(true);
   q->setCheckable(true);
 }
 }
 
 

+ 2 - 1
Libs/Widgets/ctkExpandButton.h

@@ -40,7 +40,8 @@ class ctkExpandButtonPrivate;
 /// we can set the orientation of the icon with setOrientation()
 /// we can set the orientation of the icon with setOrientation()
 /// the widget can also mirror the icon on click if mirrorOnExpand is true.
 /// the widget can also mirror the icon on click if mirrorOnExpand is true.
 
 
-class CTK_WIDGETS_EXPORT  ctkExpandButton : public QToolButton
+class CTK_WIDGETS_EXPORT ctkExpandButton
+  : public QToolButton
 {
 {
   Q_OBJECT
   Q_OBJECT
   Q_PROPERTY(bool mirrorOnExpand READ mirrorOnExpand WRITE setMirrorOnExpand)
   Q_PROPERTY(bool mirrorOnExpand READ mirrorOnExpand WRITE setMirrorOnExpand)