Automated update from Qt3

pull/1/head
Timothy Pearson 13 years ago
parent 43db215f60
commit b6053b1b40

@ -63,26 +63,26 @@ class TQStyleOption {
public: public:
enum StyleOptionDefault { Default }; enum StyleOptionDefault { Default };
TQStyleOption(StyleOptionDefault=Default) : def(TRUE), tb(NULL) {} TQStyleOption(StyleOptionDefault=Default) : def(TRUE), tb(NULL), cli(NULL) {}
// Note: we don't use default arguments since that is unnecessary // Note: we don't use default arguments since that is unnecessary
// initialization. // initialization.
TQStyleOption(int in1) : TQStyleOption(int in1) :
def(FALSE), tb(NULL), i1(in1) {} def(FALSE), tb(NULL), i1(in1), cli(NULL) {}
TQStyleOption(int in1, int in2) : TQStyleOption(int in1, int in2) :
def(FALSE), tb(NULL), i1(in1), i2(in2) {} def(FALSE), tb(NULL), i1(in1), i2(in2), cli(NULL) {}
TQStyleOption(int in1, int in2, int in3, int in4) : TQStyleOption(int in1, int in2, int in3, int in4) :
def(FALSE), tb(NULL), i1(in1), i2(in2), i3(in3), i4(in4) {} def(FALSE), tb(NULL), i1(in1), i2(in2), i3(in3), i4(in4), cli(NULL) {}
TQStyleOption(TQMenuItem* m) : def(FALSE), mi(m), tb(NULL) {} TQStyleOption(TQMenuItem* m) : def(FALSE), mi(m), tb(NULL), cli(NULL) {}
TQStyleOption(TQMenuItem* m, int in1) : def(FALSE), mi(m), tb(NULL), i1(in1) {} TQStyleOption(TQMenuItem* m, int in1) : def(FALSE), mi(m), tb(NULL), i1(in1), cli(NULL) {}
TQStyleOption(TQMenuItem* m, int in1, int in2) : def(FALSE), mi(m), tb(NULL), i1(in1), i2(in2) {} TQStyleOption(TQMenuItem* m, int in1, int in2) : def(FALSE), mi(m), tb(NULL), i1(in1), i2(in2), cli(NULL) {}
TQStyleOption(const TQColor& c) : def(FALSE), tb(NULL), cl(&c) {} TQStyleOption(const TQColor& c) : def(FALSE), tb(NULL), cl(&c), cli(NULL) {}
TQStyleOption(TQTab* t) : def(FALSE), tb(t) {} TQStyleOption(TQTab* t) : def(FALSE), tb(t), cli(NULL) {}
TQStyleOption(TQListViewItem* i) : def(FALSE), tb(NULL), li(i) {} TQStyleOption(TQListViewItem* i) : def(FALSE), tb(NULL), li(i), cli(NULL) {}
TQStyleOption(TQCheckListItem* i) : def(FALSE), tb(NULL), cli(i) {} TQStyleOption(TQCheckListItem* i) : def(FALSE), tb(NULL), cli(i) {}
TQStyleOption(TQt::ArrowType a) : def(FALSE), tb(NULL), i1((int)a) {} TQStyleOption(TQt::ArrowType a) : def(FALSE), tb(NULL), i1((int)a), cli(NULL) {}
TQStyleOption(const TQRect& r) : def(FALSE), tb(NULL), i1(r.x()), i2(r.y()), i3(r.width()),i4(r.height()){} TQStyleOption(const TQRect& r) : def(FALSE), tb(NULL), i1(r.x()), i2(r.y()), i3(r.width()), i4(r.height()), cli(NULL) {}
TQStyleOption(TQWidget *w) : def(FALSE), tb(NULL), p1((void*)w) {} TQStyleOption(TQWidget *w) : def(FALSE), tb(NULL), cli(NULL), p1((void*)w) {}
bool isDefault() const { return def; } bool isDefault() const { return def; }
@ -134,6 +134,14 @@ class TQStyleControlElementPopupMenuData {
// //
}; };
class TQStyleControlElementCheckListItemData {
public:
bool dataValid;
bool enabled;
bool hasParent;
int height;
};
class TQStyleControlElementTabBarData { class TQStyleControlElementTabBarData {
public: public:
int tabCount; int tabCount;
@ -176,6 +184,7 @@ class TQStyleControlElementGenericWidgetData {
TQStringList widgetObjectTypes; TQStringList widgetObjectTypes;
bool allDataPopulated; bool allDataPopulated;
TQt::WFlags wflags; TQt::WFlags wflags;
TQt::WindowState windowState;
TQPixmap bgPixmap; TQPixmap bgPixmap;
TQBrush bgBrush; TQBrush bgBrush;
TQColor bgColor; TQColor bgColor;
@ -196,6 +205,7 @@ class TQStyleControlElementData {
TQStringList widgetObjectTypes; TQStringList widgetObjectTypes;
bool allDataPopulated; bool allDataPopulated;
TQt::WFlags wflags; TQt::WFlags wflags;
TQt::WindowState windowState;
TQPixmap bgPixmap; TQPixmap bgPixmap;
TQBrush bgBrush; TQBrush bgBrush;
TQColor bgColor; TQColor bgColor;
@ -237,12 +247,13 @@ class TQStyleControlElementData {
TQStyleControlElementGenericWidgetData viewportData; TQStyleControlElementGenericWidgetData viewportData;
TQStyleControlElementListViewData listViewData; TQStyleControlElementListViewData listViewData;
TQStyleControlElementTabBarData tabBarData; TQStyleControlElementTabBarData tabBarData;
TQStyleControlElementCheckListItemData checkListItemData;
TQ_UINT32 comboBoxLineEditFlags; TQ_UINT32 comboBoxLineEditFlags;
TQ_UINT32 frameStyle; TQ_UINT32 frameStyle;
TQRect sliderRect; TQRect sliderRect;
}; };
class TQStyleWidgetActionRequestData { class Q_EXPORT TQStyleWidgetActionRequestData {
public: public:
TQStyleWidgetActionRequestData(); TQStyleWidgetActionRequestData();
TQStyleWidgetActionRequestData(int metric1, int metric2=0); TQStyleWidgetActionRequestData(int metric1, int metric2=0);
@ -326,7 +337,12 @@ public:
virtual void polish( TQPalette & ); virtual void polish( TQPalette & );
virtual void polishPopupMenu( TQPopupMenu* ) = 0; // Old API
// DEPRECATED
virtual void polishPopupMenu( TQPopupMenu* );
// New API
virtual void polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ) = 0;
virtual TQRect itemRect( TQPainter *p, const TQRect &r, virtual TQRect itemRect( TQPainter *p, const TQRect &r,
int flags, bool enabled, int flags, bool enabled,
@ -445,7 +461,7 @@ public:
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags flags = Style_Default, SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const = 0; const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
virtual void drawPrimitive( PrimitiveElement pe, virtual void drawPrimitive( PrimitiveElement pe,
@ -500,7 +516,7 @@ public:
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags how = Style_Default, SFlags how = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const = 0; const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
virtual void drawControl( ControlElement element, virtual void drawControl( ControlElement element,
@ -519,7 +535,7 @@ public:
TQPainter *p, TQPainter *p,
const TQWidget *widget, const TQWidget *widget,
const TQRect &r, const TQRect &r,
const TQStyleOption& = TQStyleOption::Default ) const = 0; const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
virtual void drawControlMask( ControlElement element, virtual void drawControlMask( ControlElement element,
@ -572,7 +588,7 @@ public:
// Old API // Old API
// DEPRECATED // DEPRECATED
virtual TQRect subRect( SubRect r, const TQWidget *widget ) const = 0; virtual TQRect subRect( SubRect r, const TQWidget *widget ) const;
// New API // New API
virtual TQRect subRect( SubRect r, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget ) const = 0; virtual TQRect subRect( SubRect r, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget ) const = 0;
@ -653,7 +669,7 @@ public:
SCFlags sub = (uint)SC_All, SCFlags sub = (uint)SC_All,
#endif #endif
SCFlags subActive = SC_None, SCFlags subActive = SC_None,
const TQStyleOption& = TQStyleOption::Default ) const = 0; const TQStyleOption& = TQStyleOption::Default ) const;
virtual void drawComplexControl( ComplexControl control, virtual void drawComplexControl( ComplexControl control,
TQPainter *p, TQPainter *p,
@ -677,7 +693,7 @@ public:
TQPainter *p, TQPainter *p,
const TQWidget *widget, const TQWidget *widget,
const TQRect &r, const TQRect &r,
const TQStyleOption& = TQStyleOption::Default ) const = 0; const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
virtual void drawComplexControlMask( ComplexControl control, virtual void drawComplexControlMask( ComplexControl control,
@ -693,7 +709,7 @@ public:
virtual TQRect querySubControlMetrics( ComplexControl control, virtual TQRect querySubControlMetrics( ComplexControl control,
const TQWidget *widget, const TQWidget *widget,
SubControl sc, SubControl sc,
const TQStyleOption& = TQStyleOption::Default ) const = 0; const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
virtual TQRect querySubControlMetrics( ComplexControl control, virtual TQRect querySubControlMetrics( ComplexControl control,
@ -708,7 +724,7 @@ public:
virtual SubControl querySubControl( ComplexControl control, virtual SubControl querySubControl( ComplexControl control,
const TQWidget *widget, const TQWidget *widget,
const TQPoint &pos, const TQPoint &pos,
const TQStyleOption& = TQStyleOption::Default ) const = 0; const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
virtual SubControl querySubControl( ComplexControl control, virtual SubControl querySubControl( ComplexControl control,
@ -790,7 +806,7 @@ public:
// Old API // Old API
// DEPRECATED // DEPRECATED
virtual int pixelMetric( PixelMetric metric, virtual int pixelMetric( PixelMetric metric,
const TQWidget *widget = 0 ) const = 0; const TQWidget *widget = 0 ) const;
// New API // New API
virtual int pixelMetric( PixelMetric metric, virtual int pixelMetric( PixelMetric metric,
@ -828,7 +844,7 @@ public:
virtual TQSize sizeFromContents( ContentsType contents, virtual TQSize sizeFromContents( ContentsType contents,
const TQWidget *widget, const TQWidget *widget,
const TQSize &contentsSize, const TQSize &contentsSize,
const TQStyleOption& = TQStyleOption::Default ) const = 0; const TQStyleOption& = TQStyleOption::Default ) const;
virtual TQSize sizeFromContents( ContentsType contents, virtual TQSize sizeFromContents( ContentsType contents,
TQStyleControlElementData ceData, TQStyleControlElementData ceData,
@ -992,7 +1008,7 @@ public:
const TQWidget *widget = 0, const TQWidget *widget = 0,
const TQStyleOption& = TQStyleOption::Default, const TQStyleOption& = TQStyleOption::Default,
TQStyleHintReturn* returnData = 0 TQStyleHintReturn* returnData = 0
) const = 0; ) const;
// New API // New API
virtual int styleHint( StyleHint stylehint, virtual int styleHint( StyleHint stylehint,
@ -1025,7 +1041,7 @@ public:
// DEPRECATED // DEPRECATED
virtual TQPixmap stylePixmap( StylePixmap stylepixmap, virtual TQPixmap stylePixmap( StylePixmap stylepixmap,
const TQWidget *widget = 0, const TQWidget *widget = 0,
const TQStyleOption& = TQStyleOption::Default ) const = 0; const TQStyleOption& = TQStyleOption::Default ) const;
virtual TQPixmap stylePixmap( StylePixmap stylepixmap, virtual TQPixmap stylePixmap( StylePixmap stylepixmap,
TQStyleControlElementData ceData, TQStyleControlElementData ceData,
@ -1061,6 +1077,8 @@ public:
WAR_RepaintRect, WAR_RepaintRect,
WAR_EnableMouseTracking, WAR_EnableMouseTracking,
WAR_DisableMouseTracking, WAR_DisableMouseTracking,
WAR_SetCheckable,
WAR_UnSetCheckable,
WAR_FrameSetStyle, WAR_FrameSetStyle,
WAR_FrameSetLineWidth, WAR_FrameSetLineWidth,
WAR_SetLayoutMargin, WAR_SetLayoutMargin,

@ -4445,7 +4445,9 @@ bool TQETWidget::translateXinputEvent( const XEvent *ev )
TQPair<int, int> tId; TQPair<int, int> tId;
XEvent xinputMotionEvent; XEvent xinputMotionEvent;
XEvent mouseMotionEvent; XEvent mouseMotionEvent;
#if defined (Q_OS_IRIX)
XDevice *dev; XDevice *dev;
#endif
const XDeviceMotionEvent *motion = 0; const XDeviceMotionEvent *motion = 0;
XDeviceButtonEvent *button = 0; XDeviceButtonEvent *button = 0;
TQEvent::Type t; TQEvent::Type t;
@ -4501,18 +4503,14 @@ bool TQETWidget::translateXinputEvent( const XEvent *ev )
#else #else
if ( ev->type == xinput_motion ) { if ( ev->type == xinput_motion ) {
if ( motion->deviceid == devStylus->device_id ) { if ( motion->deviceid == devStylus->device_id ) {
dev = devStylus;
deviceType = TQTabletEvent::Stylus; deviceType = TQTabletEvent::Stylus;
} else if ( motion->deviceid == devEraser->device_id ) { } else if ( motion->deviceid == devEraser->device_id ) {
dev = devEraser;
deviceType = TQTabletEvent::Eraser; deviceType = TQTabletEvent::Eraser;
} }
} else { } else {
if ( button->deviceid == devStylus->device_id ) { if ( button->deviceid == devStylus->device_id ) {
dev = devStylus;
deviceType = TQTabletEvent::Stylus; deviceType = TQTabletEvent::Stylus;
} else if ( button->deviceid == devEraser->device_id ) { } else if ( button->deviceid == devEraser->device_id ) {
dev = devEraser;
deviceType = TQTabletEvent::Eraser; deviceType = TQTabletEvent::Eraser;
} }
} }

@ -505,7 +505,11 @@ void TQEventLoop::wakeUp()
size_t nbytes = 0; size_t nbytes = 0;
char c = 0; char c = 0;
if ( ::ioctl( d->thread_pipe[0], FIONREAD, (char*)&nbytes ) >= 0 && nbytes == 0 ) { if ( ::ioctl( d->thread_pipe[0], FIONREAD, (char*)&nbytes ) >= 0 && nbytes == 0 ) {
::write( d->thread_pipe[1], &c, 1 ); if (::write( d->thread_pipe[1], &c, 1 ) < 0) {
#if defined(QT_CHECK_RANGE)
tqWarning( "TQEventLoop: Internal error (failed thread pipe write)" );
#endif
}
} }
} }

@ -813,7 +813,9 @@ bool TQProcess::start( TQStringList *env )
::dup2( STDOUT_FILENO, STDERR_FILENO ); ::dup2( STDOUT_FILENO, STDERR_FILENO );
} }
#ifndef QT_NO_DIR #ifndef QT_NO_DIR
::chdir( workingDir.absPath().latin1() ); if (::chdir( workingDir.absPath().latin1() ) < 0) {
tqWarning( "Could not chdir" );
}
#endif #endif
if ( fd[0] ) if ( fd[0] )
::close( fd[0] ); ::close( fd[0] );
@ -890,7 +892,9 @@ bool TQProcess::start( TQStringList *env )
} }
if ( fd[1] ) { if ( fd[1] ) {
char buf = 0; char buf = 0;
::write( fd[1], &buf, 1 ); if (::write( fd[1], &buf, 1 ) < 0) {
tqWarning( "Could not write to file descriptor" );
}
::close( fd[1] ); ::close( fd[1] );
} }
::_exit( -1 ); ::_exit( -1 );

@ -46,6 +46,8 @@
#include "ntqpixmapcache.h" #include "ntqpixmapcache.h"
#include "ntqframe.h" #include "ntqframe.h"
#include "ntqlayout.h" #include "ntqlayout.h"
#include "ntqlistview.h"
#include "ntqpopupmenu.h"
#include "ntqobjectlist.h" #include "ntqobjectlist.h"
#include "ntqwidgetlist.h" #include "ntqwidgetlist.h"
@ -592,7 +594,18 @@ void TQStyle::polish( TQPalette&)
(\l{TQPopupMenu::setMouseTracking()}) and whether the menu is (\l{TQPopupMenu::setMouseTracking()}) and whether the menu is
checkable by default (\l{TQPopupMenu::setCheckable()}). checkable by default (\l{TQPopupMenu::setCheckable()}).
*/ */
void TQStyle::polishPopupMenu( TQPopupMenu *) void TQStyle::polishPopupMenu( TQPopupMenu *pm ) {
TQStyleControlElementData ceData = populateControlElementDataFromWidget(pm, TQStyleOption());
unPolish(ceData, getControlElementFlagsForObject(pm, ceData.widgetObjectTypes, TQStyleOption()), pm);
}
/*!
Polishes the popup menu according to the GUI style. This usually
means setting the mouse tracking
(\l{TQPopupMenu::setMouseTracking()}) and whether the menu is
checkable by default (\l{TQPopupMenu::setCheckable()}).
*/
void TQStyle::polishPopupMenu( TQStyleControlElementData, ControlElementFlags, void * )
{ {
} }
@ -2204,6 +2217,18 @@ bool TQStyle::widgetActionRequest( TQStyleControlElementData ceData, ControlElem
else if (request == WAR_DisableMouseTracking) { else if (request == WAR_DisableMouseTracking) {
widget->setMouseTracking(FALSE); widget->setMouseTracking(FALSE);
} }
else if (request == WAR_SetCheckable) {
TQPopupMenu *pm = dynamic_cast<TQPopupMenu*>(widget);
if (pm) {
pm->setCheckable(TRUE);
}
}
else if (request == WAR_UnSetCheckable) {
TQPopupMenu *pm = dynamic_cast<TQPopupMenu*>(widget);
if (pm) {
pm->setCheckable(FALSE);
}
}
else if (request == WAR_FrameSetStyle) { else if (request == WAR_FrameSetStyle) {
TQFrame* frame = dynamic_cast<TQFrame*>(widget); TQFrame* frame = dynamic_cast<TQFrame*>(widget);
if (frame) { if (frame) {
@ -2265,6 +2290,10 @@ bool TQStyle::widgetActionRequest( TQStyleControlElementData ceData, ControlElem
} }
void TQStyle::acceleratorKeypressEventMonitor( TQObject *o, TQEvent *e ) { void TQStyle::acceleratorKeypressEventMonitor( TQObject *o, TQEvent *e ) {
// RAJA FIXME
// Also, SH_HideUnderlineAcceleratorWhenAltUp should probably be set to 1 in the TQWindowsStyle::styleHint overridden method
// Additionally, the common styleHint code in TDE (that controls popupmenu settings and such via configuration files) needs to be modified to add a config option for this new style hint
if (styleHint(SH_HideUnderlineAcceleratorWhenAltUp, TQStyleControlElementData(), CEF_None, TQStyleOption::Default, NULL, NULL) != 0) { if (styleHint(SH_HideUnderlineAcceleratorWhenAltUp, TQStyleControlElementData(), CEF_None, TQStyleOption::Default, NULL, NULL) != 0) {
TQWidget *widget = dynamic_cast<TQWidget*>(o); TQWidget *widget = dynamic_cast<TQWidget*>(o);
if (widget) { if (widget) {
@ -2324,6 +2353,167 @@ TQStyleWidgetActionRequestData::~TQStyleWidgetActionRequestData() {
// //
} }
// ============================================================================================
// Interface methods
// ============================================================================================
void TQStyle::drawPrimitive( PrimitiveElement pe,
TQPainter *p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
const TQStyleOption& opt ) const
{
const TQWidget* widget = 0;
// Determine if the request needs widget information and set widget appropriately
// FIXME
if ((pe == PE_CheckListController) || (pe == PE_CheckListExclusiveIndicator) || (pe == PE_CheckListIndicator)) {
TQCheckListItem *item = opt.checkListItem();
if (item) {
TQListView *lv = item->listView();
widget = dynamic_cast<TQWidget*>(lv);
}
}
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
drawPrimitive(pe, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), r, cg, flags, opt);
}
void TQStyle::drawControl( ControlElement element,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
const TQStyleOption& opt ) const
{
#if defined(QT_CHECK_STATE)
if (!widget) {
tqWarning("TQStyle::drawControl: widget parameter cannot be zero!");
return;
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, opt);
drawControl(element, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, opt), r, cg, flags, opt, widget);
}
void TQStyle::drawControlMask( ControlElement control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQStyleOption& opt ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, opt);
drawControlMask(control, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, opt), r, opt, widget);
}
TQRect TQStyle::subRect(SubRect r, const TQWidget *widget) const
{
#if defined(QT_CHECK_STATE)
if (! widget) {
tqWarning("TQStyle::subRect: widget parameter cannot be zero!");
return TQRect();
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
return subRect(r, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), widget);
}
void TQStyle::drawComplexControl( ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
SCFlags controls,
SCFlags active,
const TQStyleOption& opt ) const
{
#if defined(QT_CHECK_STATE)
if (! widget) {
tqWarning("TQStyle::drawComplexControl: widget parameter cannot be zero!");
return;
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
drawComplexControl(control, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), r, cg, flags, controls, active, opt, widget);
}
void TQStyle::drawComplexControlMask( ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQStyleOption& opt ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
drawComplexControlMask(control, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), r, opt, widget);
}
TQRect TQStyle::querySubControlMetrics( ComplexControl control,
const TQWidget *widget,
SubControl sc,
const TQStyleOption &opt ) const
{
#if defined(QT_CHECK_STATE)
if (! widget) {
tqWarning("TQStyle::querySubControlMetrics: widget parameter cannot be zero!");
return TQRect();
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption(), false);
return querySubControlMetrics(control, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), sc, opt, widget);
}
TQStyle::SubControl TQStyle::querySubControl(ComplexControl control,
const TQWidget *widget,
const TQPoint &pos,
const TQStyleOption& opt ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, opt);
return querySubControl(control, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, opt), pos, opt, widget);
}
int TQStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
return pixelMetric(m, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), widget);
}
TQSize TQStyle::sizeFromContents(ContentsType contents,
const TQWidget *widget,
const TQSize &contentsSize,
const TQStyleOption& opt ) const
{
TQSize sz(contentsSize);
#if defined(QT_CHECK_STATE)
if (! widget) {
tqWarning("TQStyle::sizeFromContents: widget parameter cannot be zero!");
return sz;
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
return sizeFromContents(contents, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), contentsSize, opt, widget);
}
int TQStyle::styleHint(StyleHint sh, const TQWidget * w, const TQStyleOption &so, TQStyleHintReturn *shr) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(w, TQStyleOption(), false);
return styleHint(sh, ceData, getControlElementFlagsForObject(w, ceData.widgetObjectTypes, TQStyleOption(), false), so, shr, w);
}
TQPixmap TQStyle::stylePixmap(StylePixmap sp, const TQWidget *w, const TQStyleOption &so) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(w, TQStyleOption());
return stylePixmap(sp, ceData, getControlElementFlagsForObject(w, ceData.widgetObjectTypes, TQStyleOption()), so, w);
}
/*! /*!
\fn int TQStyle::defaultFrameWidth() const \fn int TQStyle::defaultFrameWidth() const
\obsolete \obsolete

@ -55,15 +55,6 @@ public:
TQCommonStyle(); TQCommonStyle();
~TQCommonStyle(); ~TQCommonStyle();
// Old API
// DEPRECATED
void drawPrimitive( PrimitiveElement pe,
TQPainter *p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
void drawPrimitive( PrimitiveElement pe, void drawPrimitive( PrimitiveElement pe,
TQPainter *p, TQPainter *p,
@ -74,16 +65,6 @@ public:
SFlags flags = Style_Default, SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const; const TQStyleOption& = TQStyleOption::Default ) const;
// Old API
// DEPRECATED
void drawControl( ControlElement element,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags how = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
void drawControl( ControlElement element, void drawControl( ControlElement element,
TQPainter *p, TQPainter *p,
@ -95,14 +76,6 @@ public:
const TQStyleOption& = TQStyleOption::Default, const TQStyleOption& = TQStyleOption::Default,
const TQWidget *widget = 0 ) const; const TQWidget *widget = 0 ) const;
// Old API
// DEPRECATED
void drawControlMask( ControlElement element,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
void drawControlMask( ControlElement element, void drawControlMask( ControlElement element,
TQPainter *p, TQPainter *p,
@ -112,29 +85,9 @@ public:
const TQStyleOption& = TQStyleOption::Default, const TQStyleOption& = TQStyleOption::Default,
const TQWidget *widget = 0 ) const; const TQWidget *widget = 0 ) const;
// Old API
// DEPRECATED
TQRect subRect( SubRect r, const TQWidget *widget ) const;
// New API // New API
TQRect subRect( SubRect r, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget ) const; TQRect subRect( SubRect r, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget ) const;
// Old API
// DEPRECATED
void drawComplexControl( ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags how = Style_Default,
#ifdef Q_QDOC
SCFlags sub = SC_All,
#else
SCFlags sub = (uint)SC_All,
#endif
SCFlags subActive = SC_None,
const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
void drawComplexControl( ComplexControl control, void drawComplexControl( ComplexControl control,
TQPainter *p, TQPainter *p,
@ -152,14 +105,6 @@ public:
const TQStyleOption& = TQStyleOption::Default, const TQStyleOption& = TQStyleOption::Default,
const TQWidget *widget = 0 ) const; const TQWidget *widget = 0 ) const;
// Old API
// DEPRECATED
void drawComplexControlMask( ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
void drawComplexControlMask( ComplexControl control, void drawComplexControlMask( ComplexControl control,
TQPainter *p, TQPainter *p,
@ -169,13 +114,6 @@ public:
const TQStyleOption& = TQStyleOption::Default, const TQStyleOption& = TQStyleOption::Default,
const TQWidget *widget = 0 ) const; const TQWidget *widget = 0 ) const;
// Old API
// DEPRECATED
TQRect querySubControlMetrics( ComplexControl control,
const TQWidget *widget,
SubControl sc,
const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
TQRect querySubControlMetrics( ComplexControl control, TQRect querySubControlMetrics( ComplexControl control,
TQStyleControlElementData ceData, TQStyleControlElementData ceData,
@ -184,13 +122,6 @@ public:
const TQStyleOption& = TQStyleOption::Default, const TQStyleOption& = TQStyleOption::Default,
const TQWidget *widget = 0 ) const; const TQWidget *widget = 0 ) const;
// Old API
// DEPRECATED
SubControl querySubControl( ComplexControl control,
const TQWidget *widget,
const TQPoint &pos,
const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
SubControl querySubControl( ComplexControl control, SubControl querySubControl( ComplexControl control,
TQStyleControlElementData ceData, TQStyleControlElementData ceData,
@ -199,20 +130,9 @@ public:
const TQStyleOption& = TQStyleOption::Default, const TQStyleOption& = TQStyleOption::Default,
const TQWidget *widget = 0 ) const; const TQWidget *widget = 0 ) const;
// Old API
// DEPRECATED
int pixelMetric( PixelMetric m, const TQWidget *widget = 0 ) const;
// New API // New API
int pixelMetric( PixelMetric m, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQWidget *widget = 0 ) const; int pixelMetric( PixelMetric m, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQWidget *widget = 0 ) const;
// Old API
// DEPRECATED
TQSize sizeFromContents( ContentsType s,
const TQWidget *widget,
const TQSize &contentsSize,
const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
TQSize sizeFromContents( ContentsType s, TQSize sizeFromContents( ContentsType s,
TQStyleControlElementData ceData, TQStyleControlElementData ceData,
@ -221,19 +141,9 @@ public:
const TQStyleOption& = TQStyleOption::Default, const TQStyleOption& = TQStyleOption::Default,
const TQWidget *widget = 0 ) const; const TQWidget *widget = 0 ) const;
// Old API
// DEPRECATED
int styleHint(StyleHint sh, const TQWidget *, const TQStyleOption &, TQStyleHintReturn *) const;
// New API // New API
int styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &, TQStyleHintReturn *, const TQWidget * w) const; int styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &, TQStyleHintReturn *, const TQWidget * w) const;
// Old API
// DEPRECATED
TQPixmap stylePixmap( StylePixmap sp,
const TQWidget *widget = 0,
const TQStyleOption& = TQStyleOption::Default ) const;
// New API // New API
TQPixmap stylePixmap( StylePixmap sp, TQPixmap stylePixmap( StylePixmap sp,
TQStyleControlElementData ceData, TQStyleControlElementData ceData,

@ -70,7 +70,7 @@ public:
void polish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); void polish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * );
void applicationPolish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * ); void applicationPolish( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * );
void polishPopupMenu( TQPopupMenu* ); void polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * );
// new style API // new style API
void drawPrimitive( PrimitiveElement pe, void drawPrimitive( PrimitiveElement pe,

@ -69,7 +69,7 @@ public:
void polish( TQPalette & ); void polish( TQPalette & );
virtual void polishPopupMenu( TQPopupMenu* ); virtual void polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void * );
// new stuff // new stuff
void drawPrimitive( PrimitiveElement pe, void drawPrimitive( PrimitiveElement pe,

@ -184,7 +184,6 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
if (button) { if (button) {
if (button->isDown()) cef = cef | TQStyle::CEF_IsDown; if (button->isDown()) cef = cef | TQStyle::CEF_IsDown;
if (button->isOn()) cef = cef | TQStyle::CEF_IsOn; if (button->isOn()) cef = cef | TQStyle::CEF_IsOn;
if (button->isEnabled()) cef = cef | TQStyle::CEF_IsEnabled;
if (button->isToggleButton()) cef = cef | TQStyle::CEF_BiState; if (button->isToggleButton()) cef = cef | TQStyle::CEF_BiState;
} }
} }
@ -223,6 +222,7 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
// Generic flags // Generic flags
const TQWidget* widget = dynamic_cast<const TQWidget*>(object); const TQWidget* widget = dynamic_cast<const TQWidget*>(object);
if (widget) { if (widget) {
if (widget->isEnabled()) cef = cef | TQStyle::CEF_IsEnabled;
if (widget->parentWidget()) cef = cef | TQStyle::CEF_HasParentWidget; if (widget->parentWidget()) cef = cef | TQStyle::CEF_HasParentWidget;
if (widget->focusProxy()) cef = cef | TQStyle::CEF_HasFocusProxy; if (widget->focusProxy()) cef = cef | TQStyle::CEF_HasFocusProxy;
if (widget->hasFocus()) cef = cef | TQStyle::CEF_HasFocus; if (widget->hasFocus()) cef = cef | TQStyle::CEF_HasFocus;
@ -254,6 +254,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData.bgBrush = widget->backgroundBrush(); ceData.bgBrush = widget->backgroundBrush();
} }
ceData.wflags = widget->getWFlags(); ceData.wflags = widget->getWFlags();
if (populateReliantFields) {
ceData.windowState = (TQt::WindowState)(widget->windowState());
}
ceData.bgColor = widget->eraseColor(); ceData.bgColor = widget->eraseColor();
ceData.bgOffset = widget->backgroundOffset(); ceData.bgOffset = widget->backgroundOffset();
ceData.backgroundMode = widget->backgroundMode(); ceData.backgroundMode = widget->backgroundMode();
@ -419,10 +422,10 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
const TQTitleBar *tb = dynamic_cast<const TQTitleBar*>(widget); const TQTitleBar *tb = dynamic_cast<const TQTitleBar*>(widget);
if (tb) { if (tb) {
ceData.titleBarData.hasWindow = !!(tb->window()); ceData.titleBarData.hasWindow = !!(tb->window());
if (populateReliantFields) {
if (ceData.titleBarData.hasWindow) { if (ceData.titleBarData.hasWindow) {
ceData.titleBarData.windowState = tb->window()->windowState(); ceData.titleBarData.windowState = (TQt::WindowState)(tb->window()->windowState());
} }
if (populateReliantFields) {
ceData.titleBarData.usesActiveColor = tb->usesActiveColor(); ceData.titleBarData.usesActiveColor = tb->usesActiveColor();
} }
ceData.titleBarData.visibleText = tb->visibleText(); ceData.titleBarData.visibleText = tb->visibleText();
@ -455,6 +458,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData.viewportData.bgBrush = viewport->backgroundBrush(); ceData.viewportData.bgBrush = viewport->backgroundBrush();
} }
ceData.viewportData.wflags = viewport->getWFlags(); ceData.viewportData.wflags = viewport->getWFlags();
if (populateReliantFields) {
ceData.viewportData.windowState = (TQt::WindowState)(widget->windowState());
}
ceData.viewportData.bgColor = viewport->eraseColor(); ceData.viewportData.bgColor = viewport->eraseColor();
ceData.viewportData.bgOffset = viewport->backgroundOffset(); ceData.viewportData.bgOffset = viewport->backgroundOffset();
ceData.viewportData.backgroundMode = viewport->backgroundMode(); ceData.viewportData.backgroundMode = viewport->backgroundMode();
@ -502,6 +508,9 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData.parentWidgetData.bgBrush = parentWidget->backgroundBrush(); ceData.parentWidgetData.bgBrush = parentWidget->backgroundBrush();
} }
ceData.parentWidgetData.wflags = parentWidget->getWFlags(); ceData.parentWidgetData.wflags = parentWidget->getWFlags();
if (populateReliantFields) {
ceData.parentWidgetData.windowState = (TQt::WindowState)(widget->windowState());
}
ceData.parentWidgetData.bgColor = parentWidget->eraseColor(); ceData.parentWidgetData.bgColor = parentWidget->eraseColor();
ceData.parentWidgetData.bgOffset = parentWidget->backgroundOffset(); ceData.parentWidgetData.bgOffset = parentWidget->backgroundOffset();
ceData.parentWidgetData.backgroundMode = parentWidget->backgroundMode(); ceData.parentWidgetData.backgroundMode = parentWidget->backgroundMode();
@ -531,33 +540,20 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData.dwData.closeEnabled = dw->isCloseEnabled(); ceData.dwData.closeEnabled = dw->isCloseEnabled();
} }
} }
}
return ceData;
}
/*! \reimp */
void TQCommonStyle::drawPrimitive( PrimitiveElement pe,
TQPainter *p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
const TQStyleOption& opt ) const
{
const TQWidget* widget = 0;
// Determine if the request needs widget information and set widget appropriately
// FIXME
if ((pe == PE_CheckListController) || (pe == PE_CheckListExclusiveIndicator) || (pe == PE_CheckListIndicator)) {
TQCheckListItem *item = opt.checkListItem(); TQCheckListItem *item = opt.checkListItem();
if (item) { if (item) {
TQListView *lv = item->listView(); ceData.checkListItemData.dataValid = true;
widget = dynamic_cast<TQWidget*>(lv); ceData.checkListItemData.enabled = item->isEnabled();
ceData.checkListItemData.hasParent = ( item->parent() && (item->parent()->rtti() == 1) && (((TQCheckListItem*) item->parent())->type() == TQCheckListItem::Controller) );
ceData.checkListItemData.height = item->height();
}
else {
ceData.checkListItemData.dataValid = false;
} }
} }
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption()); return ceData;
drawPrimitive(pe, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), r, cg, flags, opt);
} }
/*! \reimp */ /*! \reimp */
@ -578,8 +574,7 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe,
p->drawPixmap(r, TQPixmap((const char **)check_list_controller_xpm)); p->drawPixmap(r, TQPixmap((const char **)check_list_controller_xpm));
break; } break; }
case PE_CheckListExclusiveIndicator: { case PE_CheckListExclusiveIndicator: {
TQCheckListItem *item = opt.checkListItem(); if(!ceData.checkListItemData.dataValid)
if(!item)
return; return;
int x = r.x(), y = r.y(); int x = r.x(), y = r.y();
#define TQCOORDARRLEN(x) sizeof(x)/(sizeof(TQCOORD)*2) #define TQCOORDARRLEN(x) sizeof(x)/(sizeof(TQCOORD)*2)
@ -630,8 +625,7 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe,
} }
break; } break; }
case PE_CheckListIndicator: { case PE_CheckListIndicator: {
TQCheckListItem *item = opt.checkListItem(); if(!ceData.checkListItemData.dataValid)
if(!item)
return; return;
int x = r.x(), y = r.y(), w = r.width(), h = r.width(), marg = ceData.listViewData.itemMargin; int x = r.x(), y = r.y(), w = r.width(), h = r.width(), marg = ceData.listViewData.itemMargin;
@ -640,14 +634,10 @@ void TQCommonStyle::drawPrimitive( PrimitiveElement pe,
else else
p->setPen( TQPen( ceData.palette.color( TQPalette::Disabled, TQColorGroup::Text ), p->setPen( TQPen( ceData.palette.color( TQPalette::Disabled, TQColorGroup::Text ),
2 ) ); 2 ) );
bool parentControl = FALSE; if ( flags & Style_Selected && !ceData.listViewData.rootDecorated && !ceData.checkListItemData.hasParent ) {
if ( item->parent() && item->parent()->rtti() == 1 && p->fillRect( 0, 0, x + marg + w + 4, ceData.checkListItemData.height,
((TQCheckListItem*) item->parent())->type() == TQCheckListItem::Controller )
parentControl = TRUE;
if ( flags & Style_Selected && !ceData.listViewData.rootDecorated && !parentControl ) {
p->fillRect( 0, 0, x + marg + w + 4, item->height(),
cg.brush( TQColorGroup::Highlight ) ); cg.brush( TQColorGroup::Highlight ) );
if ( item->isEnabled() ) if ( ceData.checkListItemData.enabled )
p->setPen( TQPen( cg.highlightedText(), 2 ) ); p->setPen( TQPen( cg.highlightedText(), 2 ) );
} }
@ -1044,26 +1034,6 @@ void qt_style_erase_region(TQPainter* p, const TQRegion& region, TQStyleControlE
return; return;
} }
/*! \reimp */
void TQCommonStyle::drawControl( ControlElement element,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
const TQStyleOption& opt ) const
{
#if defined(QT_CHECK_STATE)
if (!widget) {
tqWarning("TQCommonStyle::drawControl: widget parameter cannot be zero!");
return;
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, opt);
drawControl(element, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, opt), r, cg, flags, opt, widget);
}
/*! \reimp */ /*! \reimp */
void TQCommonStyle::drawControl( ControlElement element, void TQCommonStyle::drawControl( ControlElement element,
TQPainter *p, TQPainter *p,
@ -1544,16 +1514,6 @@ void TQCommonStyle::drawControl( ControlElement element,
activePainter = 0; activePainter = 0;
} }
void TQCommonStyle::drawControlMask( ControlElement control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQStyleOption& opt ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, opt);
drawControlMask(control, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, opt), r, opt, widget);
}
/*! \reimp */ /*! \reimp */
void TQCommonStyle::drawControlMask( ControlElement control, void TQCommonStyle::drawControlMask( ControlElement control,
TQPainter *p, TQPainter *p,
@ -1592,20 +1552,6 @@ void TQCommonStyle::drawControlMask( ControlElement control,
activePainter = 0; activePainter = 0;
} }
/*! \reimp */
TQRect TQCommonStyle::subRect(SubRect r, const TQWidget *widget) const
{
#if defined(QT_CHECK_STATE)
if (! widget) {
tqWarning("TQCommonStyle::subRect: widget parameter cannot be zero!");
return TQRect();
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
return subRect(r, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), widget);
}
/*! \reimp */ /*! \reimp */
TQRect TQCommonStyle::subRect(SubRect r, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget) const TQRect TQCommonStyle::subRect(SubRect r, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget) const
{ {
@ -1933,28 +1879,6 @@ static int qPositionFromValue( TQStyleControlElementData ceData, int logical_val
} }
#endif // QT_NO_RANGECONTROL #endif // QT_NO_RANGECONTROL
/*! \reimp */
void TQCommonStyle::drawComplexControl( ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
SCFlags controls,
SCFlags active,
const TQStyleOption& opt ) const
{
#if defined(QT_CHECK_STATE)
if (! widget) {
tqWarning("TQCommonStyle::drawComplexControl: widget parameter cannot be zero!");
return;
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
drawComplexControl(control, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), r, cg, flags, controls, active, opt, widget);
}
/*! \reimp */ /*! \reimp */
void TQCommonStyle::drawComplexControl( ComplexControl control, void TQCommonStyle::drawComplexControl( ComplexControl control,
TQPainter *p, TQPainter *p,
@ -2357,17 +2281,6 @@ void TQCommonStyle::drawComplexControl( ComplexControl control,
activePainter = 0; activePainter = 0;
} }
/*! \reimp */
void TQCommonStyle::drawComplexControlMask( ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQStyleOption& opt ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
drawComplexControlMask(control, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), r, opt, widget);
}
/*! \reimp */ /*! \reimp */
void TQCommonStyle::drawComplexControlMask( ComplexControl control, void TQCommonStyle::drawComplexControlMask( ComplexControl control,
TQPainter *p, TQPainter *p,
@ -2386,23 +2299,6 @@ void TQCommonStyle::drawComplexControlMask( ComplexControl control,
p->fillRect(r, color1); p->fillRect(r, color1);
} }
/*! \reimp */
TQRect TQCommonStyle::querySubControlMetrics( ComplexControl control,
const TQWidget *widget,
SubControl sc,
const TQStyleOption &opt ) const
{
#if defined(QT_CHECK_STATE)
if (! widget) {
tqWarning("TQCommonStyle::querySubControlMetrics: widget parameter cannot be zero!");
return TQRect();
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption(), false);
return querySubControlMetrics(control, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), sc, opt, widget);
}
/*! \reimp */ /*! \reimp */
TQRect TQCommonStyle::querySubControlMetrics( ComplexControl control, TQRect TQCommonStyle::querySubControlMetrics( ComplexControl control,
TQStyleControlElementData ceData, TQStyleControlElementData ceData,
@ -2637,17 +2533,6 @@ TQRect TQCommonStyle::querySubControlMetrics( ComplexControl control,
return TQRect(); return TQRect();
} }
/*! \reimp */
TQStyle::SubControl TQCommonStyle::querySubControl(ComplexControl control,
const TQWidget *widget,
const TQPoint &pos,
const TQStyleOption& opt ) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, opt);
return querySubControl(control, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, opt), pos, opt, widget);
}
/*! \reimp */ /*! \reimp */
TQStyle::SubControl TQCommonStyle::querySubControl(ComplexControl control, TQStyle::SubControl TQCommonStyle::querySubControl(ComplexControl control,
TQStyleControlElementData ceData, TQStyleControlElementData ceData,
@ -2724,14 +2609,6 @@ TQStyle::SubControl TQCommonStyle::querySubControl(ComplexControl control,
return ret; return ret;
} }
/*! \reimp */
int TQCommonStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
return pixelMetric(m, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), widget);
}
/*! \reimp */ /*! \reimp */
int TQCommonStyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQWidget *widget) const int TQCommonStyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQWidget *widget) const
{ {
@ -2952,25 +2829,6 @@ int TQCommonStyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData,
return ret; return ret;
} }
/*! \reimp */
TQSize TQCommonStyle::sizeFromContents(ContentsType contents,
const TQWidget *widget,
const TQSize &contentsSize,
const TQStyleOption& opt ) const
{
TQSize sz(contentsSize);
#if defined(QT_CHECK_STATE)
if (! widget) {
tqWarning("TQCommonStyle::sizeFromContents: widget parameter cannot be zero!");
return sz;
}
#endif
TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption());
return sizeFromContents(contents, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), contentsSize, opt, widget);
}
/*! \reimp */ /*! \reimp */
TQSize TQCommonStyle::sizeFromContents(ContentsType contents, TQSize TQCommonStyle::sizeFromContents(ContentsType contents,
TQStyleControlElementData ceData, TQStyleControlElementData ceData,
@ -3142,13 +3000,6 @@ TQSize TQCommonStyle::sizeFromContents(ContentsType contents,
return sz; return sz;
} }
/*! \reimp */
int TQCommonStyle::styleHint(StyleHint sh, const TQWidget * w, const TQStyleOption &so, TQStyleHintReturn *shr) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(w, TQStyleOption(), false);
return styleHint(sh, ceData, getControlElementFlagsForObject(w, ceData.widgetObjectTypes, TQStyleOption(), false), so, shr, w);
}
/*! \reimp */ /*! \reimp */
int TQCommonStyle::styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &, TQStyleHintReturn *, const TQWidget * w) const int TQCommonStyle::styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &, TQStyleHintReturn *, const TQWidget * w) const
{ {
@ -3232,13 +3083,6 @@ int TQCommonStyle::styleHint(StyleHint sh, TQStyleControlElementData ceData, Con
return ret; return ret;
} }
/*! \reimp */
TQPixmap TQCommonStyle::stylePixmap(StylePixmap sp, const TQWidget *w, const TQStyleOption &so) const
{
TQStyleControlElementData ceData = populateControlElementDataFromWidget(w, TQStyleOption());
return stylePixmap(sp, ceData, getControlElementFlagsForObject(w, ceData.widgetObjectTypes, TQStyleOption()), so, w);
}
/*! \reimp */ /*! \reimp */
TQPixmap TQCommonStyle::stylePixmap(StylePixmap, TQStyleControlElementData, ControlElementFlags, const TQStyleOption&, const TQWidget *) const TQPixmap TQCommonStyle::stylePixmap(StylePixmap, TQStyleControlElementData, ControlElementFlags, const TQStyleOption&, const TQWidget *) const
{ {

@ -1907,11 +1907,12 @@ TQRect TQMotifStyle::subRect( SubRect r, TQStyleControlElementData ceData, Contr
/*! \reimp /*! \reimp
*/ */
void TQMotifStyle::polishPopupMenu( TQPopupMenu* p) void TQMotifStyle::polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr )
{ {
#ifndef QT_NO_POPUPMENU #ifndef QT_NO_POPUPMENU
if ( !p->testWState( WState_Polished ) ) if ( !(ceData.windowState & WState_Polished ) ) {
p->setCheckable( FALSE ); widgetActionRequest(ceData, elementFlags, ptr, WAR_SetCheckable);
}
#endif #endif
} }

@ -1155,11 +1155,12 @@ TQSize TQWindowsStyle::sizeFromContents( ContentsType contents,
/*! \reimp /*! \reimp
*/ */
void TQWindowsStyle::polishPopupMenu( TQPopupMenu* p) void TQWindowsStyle::polishPopupMenu( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void *ptr )
{ {
#ifndef QT_NO_POPUPMENU #ifndef QT_NO_POPUPMENU
if ( !p->testWState( WState_Polished ) ) if ( !(ceData.windowState & WState_Polished ) ) {
p->setCheckable( TRUE ); widgetActionRequest(ceData, elementFlags, ptr, WAR_SetCheckable);
}
#endif #endif
} }

Loading…
Cancel
Save