Expose some QSplitter private classes for added functionality in Trinity

This is not a security risk
pull/1/head
Timothy Pearson 13 years ago
parent 3d0ccc665e
commit 1bd4b1d55d

@ -52,39 +52,9 @@
#include "tqptrlist.h" #include "tqptrlist.h"
#include "tqstyle.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" #include "tqsplitter.tqmoc"
const uint Default = 2; const uint Default = TQT_TQSPLITTER_DEFAULT;
static int mouseOffset; static int mouseOffset;
static int opaqueOldPos = -1; // this assumes that there's only one mouse static int opaqueOldPos = -1; // this assumes that there's only one mouse
@ -180,45 +150,6 @@ void TQSplitterHandle::paintEvent( TQPaintEvent * )
TQStyle::Style_Horizontal : 0) ); 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 \class TQSplitter

@ -48,11 +48,52 @@
#ifndef TQT_NO_SPLITTER #ifndef TQT_NO_SPLITTER
#define TQT_TQSPLITTER_DEFAULT 2
class TQSplitterHandle; class TQSplitterHandle;
class TQSplitterPrivate; class TQSplitterPrivate;
class TQSplitterLayoutStruct; class TQSplitterLayoutStruct;
class TQTextStream; 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 class TQ_EXPORT TQSplitter : public TQFrame
{ {
Q_OBJECT Q_OBJECT
@ -165,6 +206,36 @@ TQ_EXPORT TQTextStream& operator<<( TQTextStream&, const TQSplitter& );
TQ_EXPORT TQTextStream& operator>>( TQTextStream&, TQSplitter& ); TQ_EXPORT TQTextStream& operator>>( TQTextStream&, TQSplitter& );
#endif #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 // TQT_NO_SPLITTER
#endif // TQSPLITTER_H #endif // TQSPLITTER_H

Loading…
Cancel
Save