ソースを参照

Add ctkConsole::ScrollBarPolicy property

Jean-Christophe Fillion-Robin 14 年 前
コミット
ab271f3bb9
共有2 個のファイルを変更した22 個の追加0 個の削除を含む
  1. 14 0
      Libs/Widgets/ctkConsole.cpp
  2. 8 0
      Libs/Widgets/ctkConsole.h

+ 14 - 0
Libs/Widgets/ctkConsole.cpp

@@ -628,6 +628,20 @@ CTK_GET_CPP(ctkConsole, ctkConsole::EditorHints, editorHints, EditorHints);
 CTK_SET_CPP(ctkConsole, const ctkConsole::EditorHints&, setEditorHints, EditorHints);
 CTK_SET_CPP(ctkConsole, const ctkConsole::EditorHints&, setEditorHints, EditorHints);
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
+Qt::ScrollBarPolicy ctkConsole::scrollBarPolicy()const
+{
+  Q_D(const ctkConsole);
+  return d->verticalScrollBarPolicy();
+}
+
+//-----------------------------------------------------------------------------
+void ctkConsole::setScrollBarPolicy(const Qt::ScrollBarPolicy& newScrollBarPolicy)
+{
+  Q_D(ctkConsole);
+  d->setVerticalScrollBarPolicy(newScrollBarPolicy);
+}
+
+//-----------------------------------------------------------------------------
 void ctkConsole::executeCommand(const QString& command)
 void ctkConsole::executeCommand(const QString& command)
 {
 {
   qWarning() << "ctkConsole::executeCommand not implemented !";
   qWarning() << "ctkConsole::executeCommand not implemented !";

+ 8 - 0
Libs/Widgets/ctkConsole.h

@@ -76,6 +76,8 @@ class CTK_WIDGETS_EXPORT ctkConsole : public QWidget
   Q_PROPERTY(QString ps2 READ ps2 WRITE setPs2)
   Q_PROPERTY(QString ps2 READ ps2 WRITE setPs2)
   Q_FLAGS(EditorHint EditorHints)
   Q_FLAGS(EditorHint EditorHints)
   Q_PROPERTY(EditorHints editorHints READ editorHints WRITE setEditorHints)
   Q_PROPERTY(EditorHints editorHints READ editorHints WRITE setEditorHints)
+  Q_ENUMS(Qt::ScrollBarPolicy)
+  Q_PROPERTY(Qt::ScrollBarPolicy scrollBarPolicy READ scrollBarPolicy WRITE setScrollBarPolicy)
   
   
 public:
 public:
 
 
@@ -128,6 +130,12 @@ public:
 
 
   /// \sa editorHints()
   /// \sa editorHints()
   void setEditorHints(const EditorHints& newEditorHints);
   void setEditorHints(const EditorHints& newEditorHints);
+
+  Qt::ScrollBarPolicy scrollBarPolicy()const;
+
+  /// \sa scrollBarPolicy()
+  void setScrollBarPolicy(const Qt::ScrollBarPolicy& newScrollBarPolicy);
+
   /// Prints text on the console
   /// Prints text on the console
   void printMessage(const QString& message, const QColor& color);
   void printMessage(const QString& message, const QColor& color);