summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-16 10:35:46 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-16 10:35:46 -0500
commitff2caed1b8e1bea513172d48d07b13f53b73a9de (patch)
treece2d03f47c1844d80276933b3b86dadd69b033df
parent5feb80c8b48a0593d5c08903729ff40ec55dc4f3 (diff)
downloadtqt3-ff2caed1b8e1bea513172d48d07b13f53b73a9de.tar.gz
tqt3-ff2caed1b8e1bea513172d48d07b13f53b73a9de.zip
Automated update from Qt3
-rw-r--r--src/kernel/ntqstyle.h11
-rw-r--r--src/kernel/qapplication_x11.cpp4
-rw-r--r--src/kernel/qstyle.cpp35
3 files changed, 44 insertions, 6 deletions
diff --git a/src/kernel/ntqstyle.h b/src/kernel/ntqstyle.h
index 75a79c79a..b4bb53820 100644
--- a/src/kernel/ntqstyle.h
+++ b/src/kernel/ntqstyle.h
@@ -251,6 +251,10 @@ class TQStyleControlElementData {
TQ_UINT32 comboBoxLineEditFlags;
TQ_UINT32 frameStyle;
TQRect sliderRect;
+ TQPainter* activePainter;
+
+ public:
+ TQStyleControlElementData();
};
class Q_EXPORT TQStyleWidgetActionRequestData {
@@ -260,6 +264,7 @@ class Q_EXPORT TQStyleWidgetActionRequestData {
TQStyleWidgetActionRequestData(TQPalette palette, bool informWidgets = FALSE, const char* className = 0);
TQStyleWidgetActionRequestData(TQFont font, bool informWidgets = FALSE, const char* className = 0);
TQStyleWidgetActionRequestData(TQRect rect);
+ TQStyleWidgetActionRequestData(TQPaintEvent* paintEvent);
~TQStyleWidgetActionRequestData();
public:
bool bool1;
@@ -271,6 +276,7 @@ class Q_EXPORT TQStyleWidgetActionRequestData {
TQRect rect;
const char * cstr;
TQString string;
+ TQPaintEvent * paintEvent;
};
typedef TQStyleWidgetActionRequestData TQStyleApplicationActionRequestData;
@@ -1094,7 +1100,10 @@ public:
WAR_SetBackgroundMode,
WAR_SetBackgroundOrigin,
WAR_SetFont,
- WAR_RepaintAllAccelerators
+ WAR_RepaintAllAccelerators,
+ WAR_SetDefault,
+ WAR_UnSetDefault,
+ WAR_SendPaintEvent
};
typedef bool (*WidgetActionRequestHook)(TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, WidgetActionRequest request, TQStyleWidgetActionRequestData requestData);
diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp
index aba4fcd50..e76dd1d72 100644
--- a/src/kernel/qapplication_x11.cpp
+++ b/src/kernel/qapplication_x11.cpp
@@ -5184,8 +5184,6 @@ bool TQETWidget::translateKeyEventInternal( const XEvent *event, int& count,
tqAddPostRoutine( deleteKeyDicts );
}
- TQWidget* tlw = topLevelWidget();
-
XKeyEvent xkeyevent = event->xkey;
// save the modifier state, we will use the keystate uint later by passing
@@ -5211,7 +5209,6 @@ bool TQETWidget::translateKeyEventInternal( const XEvent *event, int& count,
// Implementation for X11R5 and newer, using XIM
int keycode = event->xkey.keycode;
- Status status;
if ( type == TQEvent::KeyPress ) {
bool mb=FALSE;
@@ -5295,7 +5292,6 @@ bool TQETWidget::translateKeyEventInternal( const XEvent *event, int& count,
// and independent of whether char is signed or not.
textDict->replace( keycode, (void*)(long)(256+ascii) );
}
- tlw = 0;
} else {
key = (int)(long)keyDict->find( keycode );
if ( key )
diff --git a/src/kernel/qstyle.cpp b/src/kernel/qstyle.cpp
index 7aa144091..ef31c25ca 100644
--- a/src/kernel/qstyle.cpp
+++ b/src/kernel/qstyle.cpp
@@ -48,6 +48,7 @@
#include "ntqlayout.h"
#include "ntqlistview.h"
#include "ntqpopupmenu.h"
+#include "ntqpushbutton.h"
#include "ntqobjectlist.h"
#include "ntqwidgetlist.h"
@@ -2165,7 +2166,16 @@ bool TQStyle::eventFilter(TQObject *o, TQEvent *e) {
TQStyle* handler = m_objectEventSourceToHandlerMap[o];
TQStyleControlElementData ceData = m_objectEventSourceDataToHandlerMap[o];
ControlElementFlags elementFlags = m_objectEventSourceFlagsToHandlerMap[o];
- bool ret = handler->objectEventHandler(ceData, elementFlags, o, e);
+ bool ret;
+ TQWidget* w = dynamic_cast<TQWidget*>(o);
+ if ((w) && (e->type() == TQEvent::Paint)) {
+ TQPainter p(w);
+ ceData.activePainter = &p;
+ ret = handler->objectEventHandler(ceData, elementFlags, o, e);
+ }
+ else {
+ ret = handler->objectEventHandler(ceData, elementFlags, o, e);
+ }
if (ret) {
return ret;
}
@@ -2291,6 +2301,21 @@ bool TQStyle::widgetActionRequest( TQStyleControlElementData ceData, ControlElem
}
delete list;
}
+ else if (request == WAR_SetDefault) {
+ TQPushButton *button = dynamic_cast<TQPushButton*>(widget);
+ if (button) {
+ button->setDefault(TRUE);
+ }
+ }
+ else if (request == WAR_UnSetDefault) {
+ TQPushButton *button = dynamic_cast<TQPushButton*>(widget);
+ if (button) {
+ button->setDefault(FALSE);
+ }
+ }
+ else if (request == WAR_SendPaintEvent) {
+ static_cast<TQObject*>(widget)->event(requestData.paintEvent);
+ }
return true;
}
}
@@ -2395,6 +2420,10 @@ TQStyleWidgetActionRequestData::TQStyleWidgetActionRequestData(TQRect param) {
rect = param;
}
+TQStyleWidgetActionRequestData::TQStyleWidgetActionRequestData(TQPaintEvent* param) {
+ paintEvent = param;
+}
+
TQStyleWidgetActionRequestData::~TQStyleWidgetActionRequestData() {
//
}
@@ -2575,4 +2604,8 @@ TQPixmap TQStyle::stylePixmap(StylePixmap sp, const TQWidget *w, const TQStyleOp
\obsolete
*/
+TQStyleControlElementData::TQStyleControlElementData() {
+ activePainter = 0;
+}
+
#endif // QT_NO_STYLE