From 6955a7ebe3c3a0ae2af416fc57ca1f3e9af0ecc3 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 1 Dec 2012 23:30:53 -0600 Subject: [PATCH] Automated update from Qt3 --- src/3rdparty/opentype/ftglue.c | 3 --- src/codecs/ntqjpunicode.h | 3 +++ src/iconview/qiconview.cpp | 5 +++++ src/kernel/ntqnetworkprotocol.h | 4 ++++ src/kernel/ntqstyle.h | 13 +++++++++++++ src/kernel/qapplication_x11.cpp | 4 ++-- src/kernel/qdragobject.cpp | 6 +++--- src/kernel/qeventloop_unix_glib.cpp | 4 +++- src/kernel/qimage.cpp | 1 + src/kernel/qinputcontext.cpp | 9 +++++++++ src/kernel/qinputcontext_x11.cpp | 2 ++ src/kernel/qjpegio.cpp | 2 +- src/kernel/qnetworkprotocol.cpp | 8 ++++++++ src/kernel/qprocess_unix.cpp | 10 +++++++--- src/kernel/qscriptengine_x11.cpp | 12 ++---------- src/network/qdns.cpp | 12 +++++++----- src/sql/ntqsqldatabase.h | 3 +++ src/sql/qsqldatabase.cpp | 6 ++++++ src/styles/qcommonstyle.cpp | 12 ++++++++++++ src/widgets/ntqtooltip.h | 1 + src/widgets/qlistview.cpp | 5 +++++ src/widgets/qpopupmenu.cpp | 1 + src/widgets/qtooltip.cpp | 4 ++++ 23 files changed, 102 insertions(+), 28 deletions(-) diff --git a/src/3rdparty/opentype/ftglue.c b/src/3rdparty/opentype/ftglue.c index c9efb627..5a0a105e 100644 --- a/src/3rdparty/opentype/ftglue.c +++ b/src/3rdparty/opentype/ftglue.c @@ -290,7 +290,6 @@ ftglue_face_goto_table( FT_Face face, if ( face->num_faces > 1 ) { /* deal with TrueType collections */ - FT_ULong offset; LOG(( ">> This is a TrueType Collection\n" )); @@ -298,8 +297,6 @@ ftglue_face_goto_table( FT_Face face, ACCESS_Frame( 4 ) ) goto Exit; - offset = GET_ULong(); - FORGET_Frame(); } diff --git a/src/codecs/ntqjpunicode.h b/src/codecs/ntqjpunicode.h index eb0c8f71..37f6f242 100644 --- a/src/codecs/ntqjpunicode.h +++ b/src/codecs/ntqjpunicode.h @@ -83,6 +83,9 @@ #endif class Q_EXPORT_CODECS_JP TQJpUnicodeConv { +public: + virtual ~TQJpUnicodeConv() {} + public: enum Rules { // "ASCII" is ANSI X.3.4-1986, a.k.a. US-ASCII here. diff --git a/src/iconview/qiconview.cpp b/src/iconview/qiconview.cpp index 8d142212..ee4a0fe3 100644 --- a/src/iconview/qiconview.cpp +++ b/src/iconview/qiconview.cpp @@ -381,6 +381,7 @@ class TQIconViewToolTip : public TQToolTip { public: TQIconViewToolTip( TQWidget *parent, TQIconView *iv ); + virtual ~TQIconViewToolTip(); void maybeTip( const TQPoint &pos ); @@ -393,6 +394,10 @@ TQIconViewToolTip::TQIconViewToolTip( TQWidget *parent, TQIconView *iv ) { } +TQIconViewToolTip::~TQIconViewToolTip() +{ +} + void TQIconViewToolTip::maybeTip( const TQPoint &pos ) { if ( !parentWidget() || !view || view->wordWrapIconText() || !view->showToolTips() ) diff --git a/src/kernel/ntqnetworkprotocol.h b/src/kernel/ntqnetworkprotocol.h index 7ab9327a..2ac7a4d5 100644 --- a/src/kernel/ntqnetworkprotocol.h +++ b/src/kernel/ntqnetworkprotocol.h @@ -63,6 +63,10 @@ template class TQValueList; class Q_EXPORT TQNetworkProtocolFactoryBase { +public: + TQNetworkProtocolFactoryBase(); + virtual ~TQNetworkProtocolFactoryBase(); + public: virtual TQNetworkProtocol *createObject() = 0; diff --git a/src/kernel/ntqstyle.h b/src/kernel/ntqstyle.h index bee3bd20..9121b143 100644 --- a/src/kernel/ntqstyle.h +++ b/src/kernel/ntqstyle.h @@ -290,6 +290,7 @@ class Q_EXPORT TQStyleControlElementData { TQString caption; TQStyleControlElementGenericWidgetData topLevelWidgetData; TQ_UINT32 topLevelWidgetFlags; + TQPixmap paletteBgPixmap; }; class Q_EXPORT TQStyleWidgetActionRequestData { @@ -1070,6 +1071,18 @@ public: // bool - whether or not the upper two button drawing areas should be combined into one SH_ScrollBar_CombineSubLineRegionDrawingAreas, + // TQt::TQRgb - color of the popup menu arrow (active, menuitem enabled) + SH_PopupMenu_SubMenuArrowColorActiveEnabled, + + // TQt::TQRgb - color of the popup menu arrow (active, menuitem disabled) + SH_PopupMenu_SubMenuArrowColorActiveDisabled, + + // TQt::TQRgb - color of the popup menu arrow (inactive, menuitem enabled) + SH_PopupMenu_SubMenuArrowColorInactiveEnabled, + + // TQt::TQRgb - color of the popup menu arrow (active, menuitem disabled) + SH_PopupMenu_SubMenuArrowColorInactiveDisabled, + // do not add any values below/greater than this SH_CustomBase = 0xf0000000 }; diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp index e76dd1d7..8602b562 100644 --- a/src/kernel/qapplication_x11.cpp +++ b/src/kernel/qapplication_x11.cpp @@ -430,7 +430,7 @@ static bool qt_x11EventFilter( XEvent* ev ) //XIM qt_xim = 0; Q_EXPORT XIMStyle qt_xim_style = 0; Q_EXPORT XIMStyle qt_xim_preferred_style = 0; -Q_EXPORT static XIMStyle xim_default_style = XIMPreeditCallbacks | XIMStatusNothing; +static XIMStyle xim_default_style = XIMPreeditCallbacks | XIMStatusNothing; #endif Q_EXPORT int qt_ximComposingKeycode=0; @@ -5889,7 +5889,7 @@ static Bool qt_net_wm_sync_request_scanner(Display*, XEvent* event, XPointer arg { return (event->type == ClientMessage && event->xclient.window == *(Window*)arg && event->xclient.message_type == tqt_wm_protocols - && event->xclient.data.l[ 0 ] == qt_net_wm_sync_request ); + && ((unsigned int)event->xclient.data.l[ 0 ]) == qt_net_wm_sync_request ); } #endif diff --git a/src/kernel/qdragobject.cpp b/src/kernel/qdragobject.cpp index 191b1c09..428000a3 100644 --- a/src/kernel/qdragobject.cpp +++ b/src/kernel/qdragobject.cpp @@ -1749,9 +1749,9 @@ TQColorDrag::TQColorDrag( TQWidget *dragsource, const char *name ) void TQColorDrag::setColor( const TQColor &col ) { - short r = (col.red() << 8) | col.red(); - short g = (col.green() << 8) | col.green(); - short b = (col.blue() << 8) | col.blue(); + unsigned short r = (col.red() << 8) | col.red(); + unsigned short g = (col.green() << 8) | col.green(); + unsigned short b = (col.blue() << 8) | col.blue(); // make sure we transmit data in network order r = htons(r); diff --git a/src/kernel/qeventloop_unix_glib.cpp b/src/kernel/qeventloop_unix_glib.cpp index dc973277..cdf9f03c 100644 --- a/src/kernel/qeventloop_unix_glib.cpp +++ b/src/kernel/qeventloop_unix_glib.cpp @@ -505,7 +505,9 @@ void TQEventLoop::wakeUp() size_t nbytes = 0; char c = 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) { + // Failed! + } } } diff --git a/src/kernel/qimage.cpp b/src/kernel/qimage.cpp index 59ed9f10..0b7b862a 100644 --- a/src/kernel/qimage.cpp +++ b/src/kernel/qimage.cpp @@ -5424,6 +5424,7 @@ static void write_pbm_image( TQImageIO *iio ) class TQImageIOFrameGrabber : public TQImageConsumer { public: TQImageIOFrameGrabber() : framecount(0) { } + virtual ~TQImageIOFrameGrabber() { } TQImageDecoder *decoder; int framecount; diff --git a/src/kernel/qinputcontext.cpp b/src/kernel/qinputcontext.cpp index 654547f2..7d609fa2 100644 --- a/src/kernel/qinputcontext.cpp +++ b/src/kernel/qinputcontext.cpp @@ -477,6 +477,7 @@ bool TQInputContext::isComposing() const */ bool TQInputContext::filterEvent( const TQEvent *event ) { + Q_UNUSED(event); return FALSE; } @@ -679,6 +680,11 @@ void TQInputContext::unsetFocus() */ void TQInputContext::setMicroFocus( int x, int y, int w, int h, TQFont *f ) { + Q_UNUSED(x); + Q_UNUSED(y); + Q_UNUSED(w); + Q_UNUSED(h); + Q_UNUSED(f); } @@ -705,6 +711,9 @@ void TQInputContext::mouseHandler( int x, TQEvent::Type type, TQt::ButtonState button, TQt::ButtonState state ) { + Q_UNUSED(x); + Q_UNUSED(button); + Q_UNUSED(state); // Default behavior for simple ephemeral input contexts. Some // complex input contexts should not be reset here. if ( type == TQEvent::MouseButtonPress || diff --git a/src/kernel/qinputcontext_x11.cpp b/src/kernel/qinputcontext_x11.cpp index 44ebf0f7..38a6ae15 100644 --- a/src/kernel/qinputcontext_x11.cpp +++ b/src/kernel/qinputcontext_x11.cpp @@ -67,6 +67,8 @@ */ bool TQInputContext::x11FilterEvent( TQWidget *keywidget, XEvent *event ) { + Q_UNUSED(keywidget); + Q_UNUSED(event); return FALSE; } diff --git a/src/kernel/qjpegio.cpp b/src/kernel/qjpegio.cpp index 153a3cee..a6503fcb 100644 --- a/src/kernel/qjpegio.cpp +++ b/src/kernel/qjpegio.cpp @@ -80,7 +80,7 @@ void my_error_exit (j_common_ptr cinfo) my_error_mgr* myerr = (my_error_mgr*) cinfo->err; char buffer[JMSG_LENGTH_MAX]; (*cinfo->err->format_message)(cinfo, buffer); - tqWarning(buffer); + tqWarning("%s", buffer); longjmp(myerr->setjmp_buffer, 1); } diff --git a/src/kernel/qnetworkprotocol.cpp b/src/kernel/qnetworkprotocol.cpp index 021636c6..b41dd97b 100644 --- a/src/kernel/qnetworkprotocol.cpp +++ b/src/kernel/qnetworkprotocol.cpp @@ -381,6 +381,14 @@ public: of these values. */ +TQNetworkProtocolFactoryBase::TQNetworkProtocolFactoryBase() { + // +} + +TQNetworkProtocolFactoryBase::~TQNetworkProtocolFactoryBase() { + // +} + /*! Constructor of the network protocol base class. Does some initialization and connecting of signals and slots. diff --git a/src/kernel/qprocess_unix.cpp b/src/kernel/qprocess_unix.cpp index 01eb202d..a1867247 100644 --- a/src/kernel/qprocess_unix.cpp +++ b/src/kernel/qprocess_unix.cpp @@ -379,7 +379,9 @@ void TQProcessManager::sigchldHnd( int fd ) } char tmp; - ::read( fd, &tmp, sizeof(tmp) ); + if (::read( fd, &tmp, sizeof(tmp) ) < 0) { + tqWarning( "Could not read from file descriptor" ); + } #if defined(QT_QPROCESS_DEBUG) tqDebug( "TQProcessManager::sigchldHnd()" ); #endif @@ -562,7 +564,9 @@ QT_SIGNAL_RETTYPE qt_C_sigchldHnd( QT_SIGNAL_ARGS ) return; char a = 1; - ::write( TQProcessPrivate::procManager->sigchldFd[0], &a, sizeof(a) ); + if (::write( TQProcessPrivate::procManager->sigchldFd[0], &a, sizeof(a) ) < 0) { + tqWarning( "Could not write to file descriptor" ); + } } @@ -1131,7 +1135,7 @@ bool TQProcess::canReadLineStderr() const This function always returns immediately. The data you pass to writeToStdin() is copied into an internal memory buffer in TQProcess, and when control goes back to the event loop, TQProcess will - starting transferring data from this buffer to the running process.   + starting transferring data from this buffer to the running process. � Sometimes the data will be transferred in several payloads, depending on how much data is read at a time by the process itself. When TQProcess has transferred all the data from its memory buffer to the running process, it diff --git a/src/kernel/qscriptengine_x11.cpp b/src/kernel/qscriptengine_x11.cpp index fb18aa3e..e01888f5 100644 --- a/src/kernel/qscriptengine_x11.cpp +++ b/src/kernel/qscriptengine_x11.cpp @@ -2725,11 +2725,7 @@ static bool khmer_shape_syllable(TQOpenType *openType, TQShaperItem *item) #ifndef QT_NO_XFTFREETYPE if (openType) { - unsigned short logClusters[16]; - for (int i = 0; i < len; ++i) - logClusters[i] = i; - - uint where[16]; + uint where[16]; for (int i = 0; i < len; ++i) { where[i] = ~(PreSubstProperty @@ -3236,11 +3232,7 @@ static bool myanmar_shape_syllable(TQOpenType *openType, TQShaperItem *item, boo #ifndef QT_NO_XFTFREETYPE if (openType) { - unsigned short logClusters[32]; - for (int i = 0; i < len; ++i) - logClusters[i] = i; - - uint where[32]; + uint where[32]; for (int i = 0; i < len; ++i) { where[i] = ~(PreSubstProperty diff --git a/src/network/qdns.cpp b/src/network/qdns.cpp index 7a693e18..616b3dfd 100644 --- a/src/network/qdns.cpp +++ b/src/network/qdns.cpp @@ -102,11 +102,17 @@ static TQ_UINT32 now() return 0; } +#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 3))) +#define Q_MODERN_RES_API +#else +#endif static TQPtrList * ns = 0; static TQStrList * domains = 0; static bool ipv6support = FALSE; +#if defined(Q_MODERN_RES_API) +#else static int qdns_res_init() { #ifdef Q_OS_MAC @@ -124,6 +130,7 @@ static int qdns_res_init() return 0; // not called at all on Windows. #endif } +#endif class TQDnsPrivate { @@ -2539,11 +2546,6 @@ void TQDns::doSynchronousLookup() } #endif -#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 3))) -#define Q_MODERN_RES_API -#else -#endif - void TQDns::doResInit() { if ( ns ) diff --git a/src/sql/ntqsqldatabase.h b/src/sql/ntqsqldatabase.h index 75aa0ded..2423fd2c 100644 --- a/src/sql/ntqsqldatabase.h +++ b/src/sql/ntqsqldatabase.h @@ -65,6 +65,9 @@ class TQSqlDatabasePrivate; class TQM_EXPORT_SQL TQSqlDriverCreatorBase { +public: + TQSqlDriverCreatorBase(); + virtual ~TQSqlDriverCreatorBase(); public: virtual TQSqlDriver* createObject() = 0; }; diff --git a/src/sql/qsqldatabase.cpp b/src/sql/qsqldatabase.cpp index be51271b..45f4323b 100644 --- a/src/sql/qsqldatabase.cpp +++ b/src/sql/qsqldatabase.cpp @@ -144,6 +144,12 @@ public: TQSqlQuery createQuery() const { return TQSqlQuery( new TQNullResult(this) ); } }; +TQSqlDriverCreatorBase::TQSqlDriverCreatorBase() { +} + +TQSqlDriverCreatorBase::~TQSqlDriverCreatorBase() { +} + typedef TQDict TQDriverDict; class TQSqlDatabaseManager : public TQObject diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp index 41ed19d0..ad866982 100644 --- a/src/styles/qcommonstyle.cpp +++ b/src/styles/qcommonstyle.cpp @@ -347,6 +347,11 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w const TQButton *button = dynamic_cast(widget); if (button) { ceData.text = button->text(); + const TQPixmap* paletteBgPixmap = 0; + paletteBgPixmap = button->paletteBackgroundPixmap(); + if (paletteBgPixmap) { + ceData.paletteBgPixmap = *paletteBgPixmap; + } } } if (ceData.widgetObjectTypes.contains("TQTabBar")) { @@ -3215,6 +3220,13 @@ int TQCommonStyle::styleHint(StyleHint sh, const TQStyleControlElementData &ceDa ret = 0; break; + case SH_PopupMenu_SubMenuArrowColorActiveEnabled: + case SH_PopupMenu_SubMenuArrowColorActiveDisabled: + case SH_PopupMenu_SubMenuArrowColorInactiveEnabled: + case SH_PopupMenu_SubMenuArrowColorInactiveDisabled: + ret = -1; + break; + default: ret = 0; break; diff --git a/src/widgets/ntqtooltip.h b/src/widgets/ntqtooltip.h index 7a325ade..94feb9bf 100644 --- a/src/widgets/ntqtooltip.h +++ b/src/widgets/ntqtooltip.h @@ -92,6 +92,7 @@ class Q_EXPORT TQToolTip: public TQt { public: TQToolTip( TQWidget *, TQToolTipGroup * = 0 ); + virtual ~TQToolTip(); //### add virtual d'tor for 4.0 static void add( TQWidget *, const TQString &); diff --git a/src/widgets/qlistview.cpp b/src/widgets/qlistview.cpp index 37d3b0d2..111e6daf 100644 --- a/src/widgets/qlistview.cpp +++ b/src/widgets/qlistview.cpp @@ -265,6 +265,7 @@ class TQListViewToolTip : public TQToolTip { public: TQListViewToolTip( TQWidget *parent, TQListView *lv ); + virtual ~TQListViewToolTip(); void maybeTip( const TQPoint &pos ); @@ -278,6 +279,10 @@ TQListViewToolTip::TQListViewToolTip( TQWidget *parent, TQListView *lv ) { } +TQListViewToolTip::~TQListViewToolTip() +{ +} + void TQListViewToolTip::maybeTip( const TQPoint &pos ) { if ( !parentWidget() || !view || !view->showToolTips() ) diff --git a/src/widgets/qpopupmenu.cpp b/src/widgets/qpopupmenu.cpp index afff582b..4b129e8e 100644 --- a/src/widgets/qpopupmenu.cpp +++ b/src/widgets/qpopupmenu.cpp @@ -1391,6 +1391,7 @@ void TQPopupMenu::show() performDelayedChanges(); updateSize(TRUE); TQWidget::show(); + updateSize(); popupActive = -1; if(style().styleHint(TQStyle::SH_PopupMenu_SubMenuPopupDelay, this)) d->mouseMoveBuffer = TQRegion(); diff --git a/src/widgets/qtooltip.cpp b/src/widgets/qtooltip.cpp index 924d563d..b6826a81 100644 --- a/src/widgets/qtooltip.cpp +++ b/src/widgets/qtooltip.cpp @@ -824,6 +824,10 @@ TQToolTip::TQToolTip( TQWidget * widget, TQToolTipGroup * group ) TQString::null, g, TQString::null, this, FALSE ); } +TQToolTip::~TQToolTip() +{ +} + /*! Adds a tool tip to \a widget. \a text is the text to be shown in