summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-02-27 12:06:11 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-05 08:56:43 +0000
commitd70492d1eed698aa8ca362a276438c7eab9d63fb (patch)
tree408e832a3b527f6337e3bf5cdd6cec1b50ee9e97 /src
parentae554cb8c2ba41c4285951abb9c9b0bc9a7d47e5 (diff)
Remove debug formatting functions obsoleted by the new debug operator for QFlag<T>.
Change-Id: I6d737eb86b790eeefb537ca5e6a075bf30a3dcfb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qplatformdrag.cpp59
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp64
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h2
4 files changed, 9 insertions, 120 deletions
diff --git a/src/gui/kernel/qplatformdrag.cpp b/src/gui/kernel/qplatformdrag.cpp
index f509408f8f..d789c75d1d 100644
--- a/src/gui/kernel/qplatformdrag.cpp
+++ b/src/gui/kernel/qplatformdrag.cpp
@@ -42,57 +42,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_DRAGANDDROP
#ifdef QDND_DEBUG
-QString dragActionsToString(Qt::DropActions actions)
-{
- QString str;
- if (actions == Qt::IgnoreAction) {
- if (!str.isEmpty())
- str += QLatin1String(" | ");
- str += QLatin1String("IgnoreAction");
- }
- if (actions & Qt::LinkAction) {
- if (!str.isEmpty())
- str += QLatin1String(" | ");
- str += QLatin1String("LinkAction");
- }
- if (actions & Qt::CopyAction) {
- if (!str.isEmpty())
- str += QLatin1String(" | ");
- str += QLatin1String("CopyAction");
- }
- if (actions & Qt::MoveAction) {
- if (!str.isEmpty())
- str += QLatin1String(" | ");
- str += QLatin1String("MoveAction");
- }
- if ((actions & Qt::TargetMoveAction) == Qt::TargetMoveAction ) {
- if (!str.isEmpty())
- str += QLatin1String(" | ");
- str += QLatin1String("TargetMoveAction");
- }
- return str;
-}
-
-QString KeyboardModifiersToString(Qt::KeyboardModifiers modifiers)
-{
- QString str;
- if (modifiers & Qt::ControlModifier) {
- if (!str.isEmpty())
- str += QLatin1String(" | ");
- str += QLatin1String("ControlModifier");
- }
- if (modifiers & Qt::AltModifier) {
- if (!str.isEmpty())
- str += QLatin1String(" | ");
- str += QLatin1String("AltModifier");
- }
- if (modifiers & Qt::ShiftModifier) {
- if (!str.isEmpty())
- str += QLatin1String(" | ");
- str += QLatin1String("ShiftModifier");
- }
- return str;
-}
+# include <QtCore/QDebug>
#endif
QPlatformDropQtResponse::QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction)
@@ -156,8 +106,7 @@ Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,
Qt::KeyboardModifiers modifiers) const
{
#ifdef QDND_DEBUG
- qDebug("QDragManager::defaultAction(Qt::DropActions possibleActions)");
- qDebug("keyboard modifiers : %s", qPrintable(KeyboardModifiersToString(modifiers)));
+ qDebug() << "QDragManager::defaultAction(Qt::DropActions possibleActions)\nkeyboard modifiers : " << modifiers;
#endif
Qt::DropAction default_action = Qt::IgnoreAction;
@@ -183,7 +132,7 @@ Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,
default_action = Qt::LinkAction;
#ifdef QDND_DEBUG
- qDebug("possible actions : %s", qPrintable(dragActionsToString(possibleActions)));
+ qDebug() << "possible actions : " << possibleActions;
#endif
// Check if the action determined is allowed
@@ -199,7 +148,7 @@ Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,
}
#ifdef QDND_DEBUG
- qDebug("default action : %s", qPrintable(dragActionsToString(default_action)));
+ qDebug() << "default action : " << default_action;
#endif
return default_action;
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index af7ecd5834..62df7918c1 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -316,9 +316,9 @@ QWindowsWindowData QWindowsIntegration::createWindowData(QWindow *window) const
<< __FUNCTION__ << '<' << window
<< "\n Requested: " << requested.geometry << "frame incl.: "
<< QWindowsGeometryHint::positionIncludesFrame(window)
- << " Flags=" << QWindowsWindow::debugWindowFlags(requested.flags)
+ << " Flags=" << requested.flags
<< "\n Obtained : " << obtained.geometry << " Margins "<< obtained.frame
- << " Flags=" << QWindowsWindow::debugWindowFlags(obtained.flags)
+ << " Flags=" << obtained.flags
<< " Handle=" << obtained.hwnd << '\n';
if (obtained.hwnd) {
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index b6dbe91ff7..4cf8fcf4da 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -417,7 +417,7 @@ struct WindowCreationData
QDebug operator<<(QDebug debug, const WindowCreationData &d)
{
- debug.nospace() << QWindowsWindow::debugWindowFlags(d.flags)
+ debug.nospace() << d.flags
<< " topLevel=" << d.topLevel << " popup="
<< d.popup << " dialog=" << d.dialog << " desktop=" << d.desktop
<< " embedded=" << d.embedded
@@ -1530,8 +1530,7 @@ void QWindowsWindow::setWindowTitle(const QString &title)
void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
{
qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << this << window() << "\n from: "
- << QWindowsWindow::debugWindowFlags(m_data.flags)
- << "\n to: " << QWindowsWindow::debugWindowFlags(flags);
+ << m_data.flags << "\n to: " << flags;
const QRect oldGeometry = geometryDp();
if (m_data.flags != flags) {
m_data.flags = flags;
@@ -1549,8 +1548,7 @@ void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
handleGeometryChange();
qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << "\n returns: "
- << QWindowsWindow::debugWindowFlags(m_data.flags)
- << " geometry " << oldGeometry << "->" << newGeometry;
+ << m_data.flags << " geometry " << oldGeometry << "->" << newGeometry;
}
QWindowsWindowData QWindowsWindow::setWindowFlags_sys(Qt::WindowFlags wt,
@@ -2202,62 +2200,6 @@ void QWindowsWindow::setEnabled(bool enabled)
setStyle(newStyle);
}
-QByteArray QWindowsWindow::debugWindowFlags(Qt::WindowFlags wf)
-{
- const int iwf = int(wf);
- QByteArray rc = "0x";
- rc += QByteArray::number(iwf, 16);
- rc += " [";
-
- switch ((iwf & Qt::WindowType_Mask)) {
- case Qt::Widget:
- rc += " Widget";
- break;
- case Qt::Window:
- rc += " Window";
- break;
- case Qt::Dialog:
- rc += " Dialog";
- break;
- case Qt::Sheet:
- rc += " Sheet";
- break;
- case Qt::Popup:
- rc += " Popup";
- break;
- case Qt::Tool:
- rc += " Tool";
- break;
- case Qt::ToolTip:
- rc += " ToolTip";
- break;
- case Qt::SplashScreen:
- rc += " SplashScreen";
- break;
- case Qt::Desktop:
- rc += " Desktop";
- break;
- case Qt::SubWindow:
- rc += " SubWindow";
- break;
- }
- if (iwf & Qt::MSWindowsFixedSizeDialogHint) rc += " MSWindowsFixedSizeDialogHint";
- if (iwf & Qt::MSWindowsOwnDC) rc += " MSWindowsOwnDC";
- if (iwf & Qt::FramelessWindowHint) rc += " FramelessWindowHint";
- if (iwf & Qt::WindowTitleHint) rc += " WindowTitleHint";
- if (iwf & Qt::WindowSystemMenuHint) rc += " WindowSystemMenuHint";
- if (iwf & Qt::WindowMinimizeButtonHint) rc += " WindowMinimizeButtonHint";
- if (iwf & Qt::WindowMaximizeButtonHint) rc += " WindowMaximizeButtonHint";
- if (iwf & Qt::WindowContextHelpButtonHint) rc += " WindowContextHelpButtonHint";
- if (iwf & Qt::WindowShadeButtonHint) rc += " WindowShadeButtonHint";
- if (iwf & Qt::WindowStaysOnTopHint) rc += " WindowStaysOnTopHint";
- if (iwf & Qt::CustomizeWindowHint) rc += " CustomizeWindowHint";
- if (iwf & Qt::WindowStaysOnBottomHint) rc += " WindowStaysOnBottomHint";
- if (iwf & Qt::WindowCloseButtonHint) rc += " WindowCloseButtonHint";
- rc += ']';
- return rc;
-}
-
static HICON createHIcon(const QIcon &icon, int xSize, int ySize)
{
if (!icon.isNull()) {
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index b47bd86ab8..f0b04fbc47 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -240,8 +240,6 @@ public:
void setCursor(const QWindowsWindowCursor &c);
void applyCursor();
- static QByteArray debugWindowFlags(Qt::WindowFlags wf);
-
inline bool testFlag(unsigned f) const { return (m_flags & f) != 0; }
inline void setFlag(unsigned f) const { m_flags |= f; }
inline void clearFlag(unsigned f) const { m_flags &= ~f; }