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 /main/dependencies | |
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 'main/dependencies')
-rw-r--r-- | main/dependencies/qt3/src/widgets/qsplitter.cpp | 71 | ||||
-rw-r--r-- | main/dependencies/qt3/src/widgets/qsplitter.h | 73 |
2 files changed, 73 insertions, 71 deletions
diff --git a/main/dependencies/qt3/src/widgets/qsplitter.cpp b/main/dependencies/qt3/src/widgets/qsplitter.cpp index 481091177..efbe8709d 100644 --- a/main/dependencies/qt3/src/widgets/qsplitter.cpp +++ b/main/dependencies/qt3/src/widgets/qsplitter.cpp @@ -52,39 +52,9 @@ #include "qptrlist.h" #include "qstyle.h" -class QSplitterHandle : public QWidget -{ - Q_OBJECT -public: - QSplitterHandle( Orientation o, - QSplitter *parent, const char* name=0 ); - void setOrientation( Orientation o ); - Orientation orientation() const { return orient; } - - bool opaque() const { return s->opaqueResize(); } - - QSize sizeHint() const; - - int id() const { return myId; } // d->list.at(id())->wid == this - void setId( int i ) { myId = i; } - -protected: - void paintEvent( QPaintEvent * ); - void mouseMoveEvent( QMouseEvent * ); - void mousePressEvent( QMouseEvent * ); - void mouseReleaseEvent( QMouseEvent * ); - -private: - Orientation orient; - bool opaq; - int myId; - - QSplitter *s; -}; - #include "qsplitter.moc" -const uint Default = 2; +const uint Default = QT_QSPLITTER_DEFAULT; static int mouseOffset; static int opaqueOldPos = -1; // this assumes that there's only one mouse @@ -180,45 +150,6 @@ void QSplitterHandle::paintEvent( QPaintEvent * ) QStyle::Style_Horizontal : 0) ); } -class QSplitterLayoutStruct : public Qt -{ -public: - QCOORD sizer; - uint isHandle : 1; - uint collapsible : 2; - uint resizeMode : 2; - QWidget *wid; - - QSplitterLayoutStruct() - : sizer( -1 ), collapsible( Default ) { } - QCOORD getSizer( Orientation orient ); -}; - -QCOORD QSplitterLayoutStruct::getSizer( Orientation orient ) -{ - if ( sizer == -1 ) { - QSize s = wid->sizeHint(); - if ( !s.isValid() || wid->testWState(WState_Resized) ) - s = wid->size(); - sizer = ( orient == Horizontal ) ? s.width() : s.height(); - } - return sizer; -} - -class QSplitterPrivate -{ -public: - QSplitterPrivate() - : opaque( FALSE ), firstShow( TRUE ), childrenCollapsible( TRUE ), - handleWidth( 0 ) { } - - QPtrList<QSplitterLayoutStruct> list; - bool opaque : 8; - bool firstShow : 8; - bool childrenCollapsible : 8; - int handleWidth; -}; - /*! \class QSplitter diff --git a/main/dependencies/qt3/src/widgets/qsplitter.h b/main/dependencies/qt3/src/widgets/qsplitter.h index 97b95adb6..c159e0ff6 100644 --- a/main/dependencies/qt3/src/widgets/qsplitter.h +++ b/main/dependencies/qt3/src/widgets/qsplitter.h @@ -48,11 +48,52 @@ #ifndef QT_NO_SPLITTER +#define QT_QSPLITTER_DEFAULT 2 + class QSplitterHandle; class QSplitterPrivate; class QSplitterLayoutStruct; class QTextStream; +class QSplitterPrivate +{ +public: + QSplitterPrivate() + : opaque( FALSE ), firstShow( TRUE ), childrenCollapsible( TRUE ), + handleWidth( 0 ) { } + + QPtrList<QSplitterLayoutStruct> list; + bool opaque : 8; + bool firstShow : 8; + bool childrenCollapsible : 8; + int handleWidth; +}; + +class QSplitterLayoutStruct : public Qt +{ +public: + QCOORD sizer; + uint isHandle : 1; + uint collapsible : 2; + uint resizeMode : 2; + QWidget *wid; + + QSplitterLayoutStruct() + : sizer( -1 ), collapsible( QT_QSPLITTER_DEFAULT ) { } + QCOORD getSizer( Orientation orient ); +}; + +QCOORD QSplitterLayoutStruct::getSizer( Orientation orient ) +{ + if ( sizer == -1 ) { + QSize s = wid->sizeHint(); + if ( !s.isValid() || wid->testWState(WState_Resized) ) + s = wid->size(); + sizer = ( orient == Horizontal ) ? s.width() : s.height(); + } + return sizer; +} + class Q_EXPORT QSplitter : public QFrame { Q_OBJECT @@ -111,7 +152,7 @@ protected: virtual void setRubberband( int ); void getRange( int id, int *, int * ); -private: +public: //private: enum { DefaultResizeMode = 3 }; void init(); @@ -164,6 +205,36 @@ Q_EXPORT QTextStream& operator<<( QTextStream&, const QSplitter& ); Q_EXPORT QTextStream& operator>>( QTextStream&, QSplitter& ); #endif +class QSplitterHandle : public QWidget +{ + Q_OBJECT +public: + QSplitterHandle( Orientation o, + QSplitter *parent, const char* name=0 ); + void setOrientation( Orientation o ); + Orientation orientation() const { return orient; } + + bool opaque() const { return s->opaqueResize(); } + + QSize sizeHint() const; + + int id() const { return myId; } // d->list.at(id())->wid == this + void setId( int i ) { myId = i; } + +protected: + void paintEvent( QPaintEvent * ); + void mouseMoveEvent( QMouseEvent * ); + void mousePressEvent( QMouseEvent * ); + void mouseReleaseEvent( QMouseEvent * ); + +public: // private: + Orientation orient; + bool opaq; + int myId; + + QSplitter *s; +}; + #endif // QT_NO_SPLITTER #endif // QSPLITTER_H |