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 | 1bd4b1d55d15b8b5f6ee2517d45d1ded47786cd3 (patch) | |
tree | 319de6acd8169e8852fc3e04ecad419b14c46781 /tqtinterface | |
parent | 3d0ccc665e549aabfd375b5a45e3b63b0fc547bc (diff) | |
download | experimental-1bd4b1d55d15b8b5f6ee2517d45d1ded47786cd3.tar.gz experimental-1bd4b1d55d15b8b5f6ee2517d45d1ded47786cd3.zip |
Expose some QSplitter private classes for added functionality in Trinity
This is not a security risk
Diffstat (limited to 'tqtinterface')
-rw-r--r-- | tqtinterface/qt4/src/widgets/tqsplitter.cpp | 71 | ||||
-rw-r--r-- | tqtinterface/qt4/src/widgets/tqsplitter.h | 71 |
2 files changed, 72 insertions, 70 deletions
diff --git a/tqtinterface/qt4/src/widgets/tqsplitter.cpp b/tqtinterface/qt4/src/widgets/tqsplitter.cpp index 2750a45..57c9d68 100644 --- a/tqtinterface/qt4/src/widgets/tqsplitter.cpp +++ b/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/tqtinterface/qt4/src/widgets/tqsplitter.h b/tqtinterface/qt4/src/widgets/tqsplitter.h index b9d536d..6c7409e 100644 --- a/tqtinterface/qt4/src/widgets/tqsplitter.h +++ b/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 |