Merge fixes for building wxQt with Qt 5.3.2
This commit is contained in:
216
configure
vendored
216
configure
vendored
@@ -971,6 +971,8 @@ Xxf86vm_LIBS
|
||||
Xxf86vm_CFLAGS
|
||||
Xinerama_LIBS
|
||||
Xinerama_CFLAGS
|
||||
QT5_LIBS
|
||||
QT5_CFLAGS
|
||||
PANGOFT2_LIBS
|
||||
PANGOFT2_CFLAGS
|
||||
PANGOXFT_LIBS
|
||||
@@ -1375,6 +1377,8 @@ PANGOXFT_CFLAGS
|
||||
PANGOXFT_LIBS
|
||||
PANGOFT2_CFLAGS
|
||||
PANGOFT2_LIBS
|
||||
QT5_CFLAGS
|
||||
QT5_LIBS
|
||||
Xinerama_CFLAGS
|
||||
Xinerama_LIBS
|
||||
Xxf86vm_CFLAGS
|
||||
@@ -2355,6 +2359,8 @@ Some influential environment variables:
|
||||
C compiler flags for PANGOFT2, overriding pkg-config
|
||||
PANGOFT2_LIBS
|
||||
linker flags for PANGOFT2, overriding pkg-config
|
||||
QT5_CFLAGS C compiler flags for QT5, overriding pkg-config
|
||||
QT5_LIBS linker flags for QT5, overriding pkg-config
|
||||
Xinerama_CFLAGS
|
||||
C compiler flags for Xinerama, overriding pkg-config
|
||||
Xinerama_LIBS
|
||||
@@ -25242,15 +25248,208 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
|
||||
if test "$wxUSE_QT" = 1; then
|
||||
TOOLKIT=QT
|
||||
GUIDIST=QT_DIST
|
||||
TOOLKIT_DIR="qt"
|
||||
TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} `pkg-config Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test --cflags` -DQT_WIDGETS_LIB"
|
||||
GUI_TK_LIBRARY="${GUI_TK_LIBRARY} `pkg-config Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test --libs`"
|
||||
if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
|
||||
SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS"
|
||||
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS $TOOLKIT_INCLUDE"
|
||||
|
||||
|
||||
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_PKG_CONFIG+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $PKG_CONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
|
||||
$as_echo "$PKG_CONFIG" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
if test -z "$ac_cv_path_PKG_CONFIG"; then
|
||||
ac_pt_PKG_CONFIG=$PKG_CONFIG
|
||||
# Extract the first word of "pkg-config", so it can be a program name with args.
|
||||
set dummy pkg-config; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $ac_pt_PKG_CONFIG in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
for as_dir in $PATH
|
||||
do
|
||||
IFS=$as_save_IFS
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS=$as_save_IFS
|
||||
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
|
||||
if test -n "$ac_pt_PKG_CONFIG"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
|
||||
$as_echo "$ac_pt_PKG_CONFIG" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$ac_pt_PKG_CONFIG" = x; then
|
||||
PKG_CONFIG=""
|
||||
else
|
||||
case $cross_compiling:$ac_tool_warned in
|
||||
yes:)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
|
||||
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
|
||||
ac_tool_warned=yes ;;
|
||||
esac
|
||||
PKG_CONFIG=$ac_pt_PKG_CONFIG
|
||||
fi
|
||||
else
|
||||
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
|
||||
fi
|
||||
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
_pkg_min_version=0.9.0
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
|
||||
$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
PKG_CONFIG=""
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
pkg_failed=no
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for QT5" >&5
|
||||
$as_echo_n "checking for QT5... " >&6; }
|
||||
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
if test -n "$QT5_CFLAGS"; then
|
||||
pkg_cv_QT5_CFLAGS="$QT5_CFLAGS"
|
||||
else
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_QT5_CFLAGS=`$PKG_CONFIG --cflags "Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test" 2>/dev/null`
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
if test -n "$PKG_CONFIG"; then
|
||||
if test -n "$QT5_LIBS"; then
|
||||
pkg_cv_QT5_LIBS="$QT5_LIBS"
|
||||
else
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_QT5_LIBS=`$PKG_CONFIG --libs "Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test" 2>/dev/null`
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
QT5_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test"`
|
||||
else
|
||||
QT5_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test"`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$QT5_PKG_ERRORS" >&5
|
||||
|
||||
|
||||
as_fn_error $? "Qt5 libraries are not available" "$LINENO" 5
|
||||
|
||||
|
||||
elif test $pkg_failed = untried; then
|
||||
|
||||
as_fn_error $? "Qt5 libraries are not available" "$LINENO" 5
|
||||
|
||||
|
||||
else
|
||||
QT5_CFLAGS=$pkg_cv_QT5_CFLAGS
|
||||
QT5_LIBS=$pkg_cv_QT5_LIBS
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
TOOLKIT=QT
|
||||
GUIDIST=QT_DIST
|
||||
TOOLKIT_DIR="qt"
|
||||
TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} ${QT5_CFLAGS}"
|
||||
GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}"
|
||||
if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
|
||||
SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS"
|
||||
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS $TOOLKIT_INCLUDE"
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
TOOLKIT_DIR=`echo ${TOOLKIT} | tr '[A-Z]' '[a-z]'`
|
||||
|
||||
@@ -40907,3 +41106,4 @@ echo " libmspack ${wxUSE_LIBMSPAC
|
||||
echo " sdl ${wxUSE_LIBSDL}"
|
||||
|
||||
echo ""
|
||||
|
||||
|
30
configure.in
30
configure.in
@@ -3283,16 +3283,26 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
||||
|
||||
|
||||
if test "$wxUSE_QT" = 1; then
|
||||
TOOLKIT=QT
|
||||
GUIDIST=QT_DIST
|
||||
TOOLKIT_DIR="qt"
|
||||
TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} `pkg-config Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test --cflags` -DQT_WIDGETS_LIB"
|
||||
GUI_TK_LIBRARY="${GUI_TK_LIBRARY} `pkg-config Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test --libs`"
|
||||
if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
|
||||
dnl build with position independent code if Qt needs it
|
||||
SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS"
|
||||
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS $TOOLKIT_INCLUDE"
|
||||
fi
|
||||
PKG_PROG_PKG_CONFIG()
|
||||
|
||||
PKG_CHECK_MODULES(QT5,
|
||||
[Qt5Core Qt5Widgets Qt5Gui Qt5OpenGL Qt5Test],
|
||||
[
|
||||
TOOLKIT=QT
|
||||
GUIDIST=QT_DIST
|
||||
TOOLKIT_DIR="qt"
|
||||
TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} ${QT5_CFLAGS}"
|
||||
GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}"
|
||||
if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
|
||||
dnl build with position independent code if Qt needs it
|
||||
SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS"
|
||||
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS $TOOLKIT_INCLUDE"
|
||||
fi
|
||||
],
|
||||
[
|
||||
AC_MSG_ERROR([Qt5 libraries are not available])
|
||||
]
|
||||
)
|
||||
fi
|
||||
dnl the name of the directory where the files for this toolkit live
|
||||
TOOLKIT_DIR=`echo ${TOOLKIT} | tr '[[A-Z]]' '[[a-z]]'`
|
||||
|
@@ -63,8 +63,6 @@ public:
|
||||
|
||||
void HandleDestroyedSignal()
|
||||
{
|
||||
wxLogDebug( wxT("%s was destroyed by Qt. pointer=%p"),
|
||||
QObject::staticMetaObject.className(), this );
|
||||
}
|
||||
|
||||
virtual Handler *GetHandler() const
|
||||
@@ -72,9 +70,6 @@ public:
|
||||
// Only process the signal / event if the wxWindow is not destroyed
|
||||
if ( !wxWindow::QtRetrieveWindowPointer( this ) )
|
||||
{
|
||||
wxLogDebug( wxT("%s win pointer is NULL (wxWindow is deleted)!"),
|
||||
Widget::staticMetaObject.className()
|
||||
);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
@@ -90,9 +85,9 @@ protected:
|
||||
virtual void changeEvent ( QEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::changeEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleChangeEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleChangeEvent(this, event) )
|
||||
Widget::changeEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -102,9 +97,9 @@ protected:
|
||||
virtual void closeEvent ( QCloseEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::closeEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleCloseEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleCloseEvent(this, event) )
|
||||
Widget::closeEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -114,9 +109,9 @@ protected:
|
||||
virtual void contextMenuEvent ( QContextMenuEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::contextMenuEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleContextMenuEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleContextMenuEvent(this, event) )
|
||||
Widget::contextMenuEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -129,9 +124,9 @@ protected:
|
||||
virtual void enterEvent ( QEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::enterEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleEnterEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleEnterEvent(this, event) )
|
||||
Widget::enterEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -141,9 +136,9 @@ protected:
|
||||
virtual void focusInEvent ( QFocusEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::focusInEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleFocusEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleFocusEvent(this, event) )
|
||||
Widget::focusInEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -153,9 +148,9 @@ protected:
|
||||
virtual void focusOutEvent ( QFocusEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::focusOutEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleFocusEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleFocusEvent(this, event) )
|
||||
Widget::focusOutEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -165,9 +160,9 @@ protected:
|
||||
virtual void hideEvent ( QHideEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::hideEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleShowEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleShowEvent(this, event) )
|
||||
Widget::hideEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -177,9 +172,9 @@ protected:
|
||||
virtual void keyPressEvent ( QKeyEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::keyPressEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleKeyEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleKeyEvent(this, event) )
|
||||
Widget::keyPressEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -189,9 +184,9 @@ protected:
|
||||
virtual void keyReleaseEvent ( QKeyEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::keyReleaseEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleKeyEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleKeyEvent(this, event) )
|
||||
Widget::keyReleaseEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -201,9 +196,9 @@ protected:
|
||||
virtual void leaveEvent ( QEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::leaveEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleEnterEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleEnterEvent(this, event) )
|
||||
Widget::leaveEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -213,9 +208,9 @@ protected:
|
||||
virtual void mouseDoubleClickEvent ( QMouseEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::mouseDoubleClickEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
|
||||
Widget::mouseDoubleClickEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -225,9 +220,9 @@ protected:
|
||||
virtual void mouseMoveEvent ( QMouseEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::mouseMoveEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
|
||||
Widget::mouseMoveEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -237,9 +232,9 @@ protected:
|
||||
virtual void mousePressEvent ( QMouseEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::mousePressEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
|
||||
Widget::mousePressEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -249,9 +244,9 @@ protected:
|
||||
virtual void mouseReleaseEvent ( QMouseEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::mouseReleaseEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleMouseEvent(this, event) )
|
||||
Widget::mouseReleaseEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -261,9 +256,9 @@ protected:
|
||||
virtual void moveEvent ( QMoveEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::moveEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleMoveEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleMoveEvent(this, event) )
|
||||
Widget::moveEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -273,9 +268,9 @@ protected:
|
||||
virtual void paintEvent ( QPaintEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::paintEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandlePaintEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandlePaintEvent(this, event) )
|
||||
Widget::paintEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -285,9 +280,9 @@ protected:
|
||||
virtual void resizeEvent ( QResizeEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::resizeEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleResizeEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleResizeEvent(this, event) )
|
||||
Widget::resizeEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -297,9 +292,9 @@ protected:
|
||||
virtual void showEvent ( QShowEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::showEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleShowEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleShowEvent(this, event) )
|
||||
Widget::showEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
@@ -309,9 +304,9 @@ protected:
|
||||
virtual void wheelEvent ( QWheelEvent * event )
|
||||
{
|
||||
if ( !this->GetHandler() )
|
||||
wxLogDebug( wxT("%s::wheelEvent for invalid handler!"),
|
||||
Widget::staticMetaObject.className() );
|
||||
else if ( !this->GetHandler()->QtHandleWheelEvent(this, event) )
|
||||
return;
|
||||
|
||||
if ( !this->GetHandler()->QtHandleWheelEvent(this, event) )
|
||||
Widget::wheelEvent(event);
|
||||
else
|
||||
event->accept();
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/rawbmp.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
|
@@ -119,6 +119,9 @@ wxCheckBoxState wxCheckBox::DoGet3StateValue() const
|
||||
case Qt::PartiallyChecked:
|
||||
return wxCHK_UNDETERMINED;
|
||||
}
|
||||
|
||||
wxFAIL_MSG( "unknown QCheckBox state" );
|
||||
return wxCHK_UNDETERMINED;
|
||||
}
|
||||
|
||||
QCheckBox *wxCheckBox::GetHandle() const
|
||||
|
@@ -409,9 +409,6 @@ void wxQtDCImpl::DoSetDeviceClippingRegion(const wxRegion& region)
|
||||
QTransform qtrans = m_qtPainter->worldTransform();
|
||||
// Reset transofrmation to match device coordinates
|
||||
m_qtPainter->setWorldTransform( QTransform() );
|
||||
wxLogDebug(wxT("wxQtDCImpl::DoSetDeviceClippingRegion rect %d %d %d %d"),
|
||||
qregion.boundingRect().x(), qregion.boundingRect().y(),
|
||||
qregion.boundingRect().width(), qregion.boundingRect().height());
|
||||
// Set QPainter clipping (intersection if not the first one)
|
||||
m_qtPainter->setClipRegion( qregion,
|
||||
m_clipping ? Qt::IntersectClip : Qt::ReplaceClip );
|
||||
|
@@ -102,9 +102,6 @@ wxClientDCImpl::~wxClientDCImpl()
|
||||
{
|
||||
// only force the update of the rect affected by the DC
|
||||
widget->repaint( rect );
|
||||
wxLogDebug( wxT("wxClientDC Repainting %s (%d %d %d %d)"),
|
||||
(const char*) m_window->GetName(),
|
||||
rect.left(), rect.top(), rect.width(), rect.height());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <QtWidgets/QDesktopWidget>
|
||||
#include <QtGui/QScreen>
|
||||
#include <QApplication>
|
||||
#include <QPixmap>
|
||||
|
||||
wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl);
|
||||
|
@@ -13,6 +13,8 @@
|
||||
#endif
|
||||
|
||||
#include <QtTest/QtTestGui>
|
||||
#include <QApplication>
|
||||
#include <QWidget>
|
||||
|
||||
#include "wx/qt/defs.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
@@ -25,6 +27,16 @@
|
||||
using namespace Qt;
|
||||
using namespace QTest;
|
||||
|
||||
// Apparently {mouse,key}Event() functions signature has changed somewhere
|
||||
// between Qt 5.3 and 5.5 as they're documented to take QWidget in the latter
|
||||
// but actually take QWindow in the former, so use this helper to hide the
|
||||
// difference.
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
||||
inline QWidget* argForEvents(QWidget* w) { return w; }
|
||||
#else
|
||||
inline QWindow* argForEvents(QWidget* w) { return w->windowHandle(); }
|
||||
#endif
|
||||
|
||||
static MouseButton ConvertMouseButton( int button )
|
||||
{
|
||||
MouseButton qtButton;
|
||||
@@ -65,7 +77,7 @@ static bool SimulateMouseButton( MouseAction mouseAction, MouseButton mouseButto
|
||||
QPoint mousePosition = QCursor::pos();
|
||||
QWidget *widget = QApplication::widgetAt( mousePosition );
|
||||
if ( widget != NULL )
|
||||
mouseEvent( mouseAction, widget, mouseButton, NoModifier, mousePosition );
|
||||
mouseEvent( mouseAction, argForEvents(widget), mouseButton, NoModifier, mousePosition );
|
||||
|
||||
// If we found a widget then we successfully simulated an event:
|
||||
|
||||
@@ -76,7 +88,7 @@ static bool SimulateKeyboardKey( KeyAction keyAction, Key key )
|
||||
{
|
||||
QWidget *widget = QApplication::focusWidget();
|
||||
if ( widget != NULL )
|
||||
keyEvent( keyAction, widget, key );
|
||||
keyEvent( keyAction, argForEvents(widget), key );
|
||||
|
||||
// If we found a widget then we successfully simulated an event:
|
||||
|
||||
|
@@ -37,6 +37,8 @@
|
||||
#define VERT_SCROLLBAR_POSITION 0, 1
|
||||
#define HORZ_SCROLLBAR_POSITION 1, 0
|
||||
|
||||
#define TRACE_QT_WINDOW "qtwindow"
|
||||
|
||||
// Base Widget helper (no scrollbar, used by wxWindow)
|
||||
|
||||
class wxQtWidget : public wxQtEventSignalHandler< QWidget, wxWindowQt >
|
||||
@@ -188,7 +190,7 @@ wxWindowQt::~wxWindowQt()
|
||||
// Delete only if the qt widget was created or assigned to this base class
|
||||
if (m_qtWindow)
|
||||
{
|
||||
wxLogDebug(wxT("wxWindow::~wxWindow %s m_qtWindow=%p"),
|
||||
wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::~wxWindow %s m_qtWindow=%p"),
|
||||
(const char*)GetName(), m_qtWindow);
|
||||
// Avoid sending further signals (i.e. if deleting the current page)
|
||||
m_qtWindow->blockSignals(true);
|
||||
@@ -200,7 +202,7 @@ wxWindowQt::~wxWindowQt()
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug(wxT("wxWindow::~wxWindow %s m_qtWindow is NULL"),
|
||||
wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::~wxWindow %s m_qtWindow is NULL"),
|
||||
(const char*)GetName());
|
||||
}
|
||||
}
|
||||
@@ -256,7 +258,7 @@ void wxWindowQt::PostCreation(bool generic)
|
||||
// store pointer to the QWidget subclass (to be used in the destructor)
|
||||
m_qtWindow = GetHandle();
|
||||
}
|
||||
wxLogDebug(wxT("wxWindow::Create %s m_qtWindow=%p"),
|
||||
wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Create %s m_qtWindow=%p"),
|
||||
(const char*)GetName(), m_qtWindow);
|
||||
|
||||
// set the background style after creation (not before like in wxGTK)
|
||||
@@ -391,7 +393,7 @@ void wxWindowQt::WarpPointer(int x, int y)
|
||||
|
||||
void wxWindowQt::Update()
|
||||
{
|
||||
wxLogDebug(wxT("wxWindow::Update %s"), (const char*)GetName());
|
||||
wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Update %s"), (const char*)GetName());
|
||||
// send the paint event to the inner widget in scroll areas:
|
||||
if ( QtGetScrollBarsContainer() )
|
||||
{
|
||||
@@ -417,14 +419,14 @@ void wxWindowQt::Refresh( bool WXUNUSED( eraseBackground ), const wxRect *rect )
|
||||
{
|
||||
if ( rect != NULL )
|
||||
{
|
||||
wxLogDebug(wxT("wxWindow::Refresh %s rect %d %d %d %d"),
|
||||
wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Refresh %s rect %d %d %d %d"),
|
||||
(const char*)GetName(),
|
||||
rect->x, rect->y, rect->width, rect->height);
|
||||
widget->update( wxQtConvertRect( *rect ));
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug(wxT("wxWindow::Refresh %s"),
|
||||
wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::Refresh %s"),
|
||||
(const char*)GetName());
|
||||
widget->update();
|
||||
}
|
||||
@@ -1018,13 +1020,6 @@ bool wxWindowQt::QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event )
|
||||
// use the Qt event region:
|
||||
m_updateRegion.QtSetRegion( event->region() );
|
||||
|
||||
if (false)
|
||||
wxLogDebug(wxT("wxWindow::QtHandlePaintEvent %s %s region %d %d %d %d"),
|
||||
(const char*)GetName(),
|
||||
m_qtPicture->isNull() ? "wxPaintDC" : "wxClientDC",
|
||||
m_updateRegion.GetBox().x, m_updateRegion.GetBox().y,
|
||||
m_updateRegion.GetBox().width, m_updateRegion.GetBox().height);
|
||||
|
||||
// Prepare the Qt painter for wxWindowDC:
|
||||
bool ok = false;
|
||||
if ( QtGetScrollBarsContainer() )
|
||||
@@ -1071,7 +1066,7 @@ bool wxWindowQt::QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event )
|
||||
// Ensure DC is cleared if handler didn't and Qt will not do it
|
||||
if ( UseBgCol() && !GetHandle()->autoFillBackground() )
|
||||
{
|
||||
wxLogDebug(wxT("wxWindow::QtHandlePaintEvent %s clearing DC to %s"),
|
||||
wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::QtHandlePaintEvent %s clearing DC to %s"),
|
||||
(const char*)GetName(), GetBackgroundColour().GetAsString()
|
||||
);
|
||||
dc.SetBackground(GetBackgroundColour());
|
||||
@@ -1120,7 +1115,7 @@ bool wxWindowQt::QtHandlePaintEvent ( QWidget *handler, QPaintEvent *event )
|
||||
else
|
||||
{
|
||||
// Painter didn't begun, not handled by wxWidgets:
|
||||
wxLogDebug(wxT("wxWindow::QtHandlePaintEvent %s Qt widget painter begin failed"),
|
||||
wxLogTrace(TRACE_QT_WINDOW, wxT("wxWindow::QtHandlePaintEvent %s Qt widget painter begin failed"),
|
||||
(const char*)GetName() );
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user