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>
This commit is contained in:
parent
ae554cb8c2
commit
d70492d1ee
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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()) {
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user