diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-08-06 01:36:40 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-08-06 01:36:40 -0500 |
commit | 816f448426fd8d4013c7b35c568ec1b4ef94d228 (patch) | |
tree | cf391a3a093126ac02b848b752c31c69c18f13a3 /experimental/tqtinterface/qt4/src | |
parent | a4b5d4c84503cf44885d0aafd18c3583410fd63a (diff) | |
download | tde-816f448426fd8d4013c7b35c568ec1b4ef94d228.tar.gz tde-816f448426fd8d4013c7b35c568ec1b4ef94d228.zip |
Expose some QSplitter private classes for added functionality in Trinity
This is not a security risk
Diffstat (limited to 'experimental/tqtinterface/qt4/src')
-rw-r--r-- | experimental/tqtinterface/qt4/src/widgets/tqsplitter.cpp | 71 | ||||
-rw-r--r-- | experimental/tqtinterface/qt4/src/widgets/tqsplitter.h | 71 |
2 files changed, 72 insertions, 70 deletions
diff --git a/experimental/tqtinterface/qt4/src/widgets/tqsplitter.cpp b/experimental/tqtinterface/qt4/src/widgets/tqsplitter.cpp index 2750a4591..57c9d6840 100644 --- a/experimental/tqtinterface/qt4/src/widgets/tqsplitter.cpp +++ b/experimental/tqtinterface/qt4/src/widgets/tqsplitter.cpp @@ -52,39 +52,9 @@ #include "tqptrlist.h" #include "tqstyle.h" -class TQSplitterHandle : public TQWidget -{ - TQ_OBJECT -public: - TQSplitterHandle( Qt::Orientation o, - TQSplitter *tqparent, const char* name=0 ); - void setOrientation( Qt::Orientation o ); - Qt::Orientation orientation() const { return orient; } - - bool opaque() const { return s->opaqueResize(); } - - TQSize tqsizeHint() const; - - int id() const { return myId; } // d->list.at(id())->wid == this - void setId( int i ) { myId = i; } - -protected: - void paintEvent( TQPaintEvent * ); - void mouseMoveEvent( TQMouseEvent * ); - void mousePressEvent( TQMouseEvent * ); - void mouseReleaseEvent( TQMouseEvent * ); - -private: - Qt::Orientation orient; - bool opaq; - int myId; - - TQSplitter *s; -}; - #include "tqsplitter.tqmoc" -const uint Default = 2; +const uint Default = TQT_TQSPLITTER_DEFAULT; static int mouseOffset; static int opaqueOldPos = -1; // this assumes that there's only one mouse @@ -180,45 +150,6 @@ void TQSplitterHandle::paintEvent( TQPaintEvent * ) TQStyle::Style_Horizontal : 0) ); } -class TQSplitterLayoutStruct : public TQt -{ -public: - TQCOORD sizer; - uint isHandle : 1; - uint collapsible : 2; - uint resizeMode : 2; - TQWidget *wid; - - TQSplitterLayoutStruct() - : sizer( -1 ), collapsible( Default ) { } - TQCOORD getSizer( Qt::Orientation orient ); -}; - -TQCOORD TQSplitterLayoutStruct::getSizer( Qt::Orientation orient ) -{ - if ( sizer == -1 ) { - TQSize s = wid->tqsizeHint(); - if ( !s.isValid() || wid->testWState(WState_Resized) ) - s = wid->size(); - sizer = ( orient == Qt::Horizontal ) ? s.width() : s.height(); - } - return sizer; -} - -class TQSplitterPrivate -{ -public: - TQSplitterPrivate() - : opaque( FALSE ), firstShow( TRUE ), tqchildrenCollapsible( TRUE ), - handleWidth( 0 ) { } - - TQPtrList<TQSplitterLayoutStruct> list; - bool opaque : 8; - bool firstShow : 8; - bool tqchildrenCollapsible : 8; - int handleWidth; -}; - /*! \class TQSplitter diff --git a/experimental/tqtinterface/qt4/src/widgets/tqsplitter.h b/experimental/tqtinterface/qt4/src/widgets/tqsplitter.h index b9d536df7..6c7409e61 100644 --- a/experimental/tqtinterface/qt4/src/widgets/tqsplitter.h +++ b/experimental/tqtinterface/qt4/src/widgets/tqsplitter.h @@ -48,11 +48,52 @@ #ifndef TQT_NO_SPLITTER +#define TQT_TQSPLITTER_DEFAULT 2 + class TQSplitterHandle; class TQSplitterPrivate; class TQSplitterLayoutStruct; class TQTextStream; +class TQSplitterPrivate +{ +public: + TQSplitterPrivate() + : opaque( FALSE ), firstShow( TRUE ), tqchildrenCollapsible( TRUE ), + handleWidth( 0 ) { } + + TQPtrList<TQSplitterLayoutStruct> list; + bool opaque : 8; + bool firstShow : 8; + bool tqchildrenCollapsible : 8; + int handleWidth; +}; + +class TQSplitterLayoutStruct : public TQt +{ +public: + TQCOORD sizer; + uint isHandle : 1; + uint collapsible : 2; + uint resizeMode : 2; + TQWidget *wid; + + TQSplitterLayoutStruct() + : sizer( -1 ), collapsible( Default ) { } + TQCOORD getSizer( Qt::Orientation orient ); +}; + +TQCOORD TQSplitterLayoutStruct::getSizer( Qt::Orientation orient ) +{ + if ( sizer == -1 ) { + TQSize s = wid->tqsizeHint(); + if ( !s.isValid() || wid->testWState(WState_Resized) ) + s = wid->size(); + sizer = ( orient == Qt::Horizontal ) ? s.width() : s.height(); + } + return sizer; +} + class TQ_EXPORT TQSplitter : public TQFrame { Q_OBJECT @@ -165,6 +206,36 @@ TQ_EXPORT TQTextStream& operator<<( TQTextStream&, const TQSplitter& ); TQ_EXPORT TQTextStream& operator>>( TQTextStream&, TQSplitter& ); #endif +class TQSplitterHandle : public TQWidget +{ + TQ_OBJECT +public: + TQSplitterHandle( Qt::Orientation o, + TQSplitter *tqparent, const char* name=0 ); + void setOrientation( Qt::Orientation o ); + Qt::Orientation orientation() const { return orient; } + + bool opaque() const { return s->opaqueResize(); } + + TQSize tqsizeHint() const; + + int id() const { return myId; } // d->list.at(id())->wid == this + void setId( int i ) { myId = i; } + +protected: + void paintEvent( TQPaintEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + +private: + Qt::Orientation orient; + bool opaq; + int myId; + + TQSplitter *s; +}; + #endif // TQT_NO_SPLITTER #endif // TQSPLITTER_H |