ctkDynamicSpacer.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Library:   CTK
00004  
00005   Copyright (c) 2010  Kitware Inc.
00006 
00007   Licensed under the Apache License, Version 2.0 (the "License");
00008   you may not use this file except in compliance with the License.
00009   You may obtain a copy of the License at
00010 
00011       http://www.commontk.org/LICENSE
00012 
00013   Unless required by applicable law or agreed to in writing, software
00014   distributed under the License is distributed on an "AS IS" BASIS,
00015   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016   See the License for the specific language governing permissions and
00017   limitations under the License.
00018  
00019 =========================================================================*/
00020 
00021 #ifndef __ctkDynamicSpacer_h
00022 #define __ctkDynamicSpacer_h
00023 
00024 // Qt includes
00025 #include <QWidget>
00026 
00027 // CTK includes
00028 #include <ctkPimpl.h>
00029 #include "CTKWidgetsExport.h"
00030 
00031 class ctkDynamicSpacerPrivate;
00032 
00035 class CTK_WIDGETS_EXPORT ctkDynamicSpacer : public QWidget
00036 {
00037   Q_OBJECT
00038   Q_PROPERTY(QSizePolicy activeSizePolicy READ activeSizePolicy WRITE setActiveSizePolicy);
00039   Q_PROPERTY(QSizePolicy inactiveSizePolicy READ inactiveSizePolicy WRITE setInactiveSizePolicy);
00040 
00041 public:
00042   ctkDynamicSpacer(QWidget *parent = 0);
00043   virtual ~ctkDynamicSpacer();
00044 
00045   QSizePolicy activeSizePolicy() const;
00046   void setActiveSizePolicy(QSizePolicy sizePolicy);
00047   inline void setActiveSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical);
00048 
00049   QSizePolicy inactiveSizePolicy() const;
00050   void setInactiveSizePolicy(QSizePolicy sizePolicy);
00051   inline void setInactiveSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical);
00052 
00053 public slots:
00054   void activate(bool enable);
00055 
00056 private:
00057   CTK_DECLARE_PRIVATE(ctkDynamicSpacer);
00058 };
00059 
00060 void ctkDynamicSpacer::setActiveSizePolicy(QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
00061 {
00062   this->setActiveSizePolicy(QSizePolicy(horizontal, vertical));
00063 }
00064 
00065 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 21 May 2010 for CTK by  doxygen 1.6.1