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
|
#ifndef QT_NO_DRAGANDDROP
|
||||||
#ifdef QDND_DEBUG
|
#ifdef QDND_DEBUG
|
||||||
QString dragActionsToString(Qt::DropActions actions)
|
# include <QtCore/QDebug>
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QPlatformDropQtResponse::QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction)
|
QPlatformDropQtResponse::QPlatformDropQtResponse(bool accepted, Qt::DropAction acceptedAction)
|
||||||
@ -156,8 +106,7 @@ Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,
|
|||||||
Qt::KeyboardModifiers modifiers) const
|
Qt::KeyboardModifiers modifiers) const
|
||||||
{
|
{
|
||||||
#ifdef QDND_DEBUG
|
#ifdef QDND_DEBUG
|
||||||
qDebug("QDragManager::defaultAction(Qt::DropActions possibleActions)");
|
qDebug() << "QDragManager::defaultAction(Qt::DropActions possibleActions)\nkeyboard modifiers : " << modifiers;
|
||||||
qDebug("keyboard modifiers : %s", qPrintable(KeyboardModifiersToString(modifiers)));
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Qt::DropAction default_action = Qt::IgnoreAction;
|
Qt::DropAction default_action = Qt::IgnoreAction;
|
||||||
@ -183,7 +132,7 @@ Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,
|
|||||||
default_action = Qt::LinkAction;
|
default_action = Qt::LinkAction;
|
||||||
|
|
||||||
#ifdef QDND_DEBUG
|
#ifdef QDND_DEBUG
|
||||||
qDebug("possible actions : %s", qPrintable(dragActionsToString(possibleActions)));
|
qDebug() << "possible actions : " << possibleActions;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check if the action determined is allowed
|
// Check if the action determined is allowed
|
||||||
@ -199,7 +148,7 @@ Qt::DropAction QPlatformDrag::defaultAction(Qt::DropActions possibleActions,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QDND_DEBUG
|
#ifdef QDND_DEBUG
|
||||||
qDebug("default action : %s", qPrintable(dragActionsToString(default_action)));
|
qDebug() << "default action : " << default_action;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return default_action;
|
return default_action;
|
||||||
|
@ -316,9 +316,9 @@ QWindowsWindowData QWindowsIntegration::createWindowData(QWindow *window) const
|
|||||||
<< __FUNCTION__ << '<' << window
|
<< __FUNCTION__ << '<' << window
|
||||||
<< "\n Requested: " << requested.geometry << "frame incl.: "
|
<< "\n Requested: " << requested.geometry << "frame incl.: "
|
||||||
<< QWindowsGeometryHint::positionIncludesFrame(window)
|
<< QWindowsGeometryHint::positionIncludesFrame(window)
|
||||||
<< " Flags=" << QWindowsWindow::debugWindowFlags(requested.flags)
|
<< " Flags=" << requested.flags
|
||||||
<< "\n Obtained : " << obtained.geometry << " Margins "<< obtained.frame
|
<< "\n Obtained : " << obtained.geometry << " Margins "<< obtained.frame
|
||||||
<< " Flags=" << QWindowsWindow::debugWindowFlags(obtained.flags)
|
<< " Flags=" << obtained.flags
|
||||||
<< " Handle=" << obtained.hwnd << '\n';
|
<< " Handle=" << obtained.hwnd << '\n';
|
||||||
|
|
||||||
if (obtained.hwnd) {
|
if (obtained.hwnd) {
|
||||||
|
@ -417,7 +417,7 @@ struct WindowCreationData
|
|||||||
|
|
||||||
QDebug operator<<(QDebug debug, const WindowCreationData &d)
|
QDebug operator<<(QDebug debug, const WindowCreationData &d)
|
||||||
{
|
{
|
||||||
debug.nospace() << QWindowsWindow::debugWindowFlags(d.flags)
|
debug.nospace() << d.flags
|
||||||
<< " topLevel=" << d.topLevel << " popup="
|
<< " topLevel=" << d.topLevel << " popup="
|
||||||
<< d.popup << " dialog=" << d.dialog << " desktop=" << d.desktop
|
<< d.popup << " dialog=" << d.dialog << " desktop=" << d.desktop
|
||||||
<< " embedded=" << d.embedded
|
<< " embedded=" << d.embedded
|
||||||
@ -1530,8 +1530,7 @@ void QWindowsWindow::setWindowTitle(const QString &title)
|
|||||||
void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
|
void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
|
||||||
{
|
{
|
||||||
qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << this << window() << "\n from: "
|
qCDebug(lcQpaWindows) << '>' << __FUNCTION__ << this << window() << "\n from: "
|
||||||
<< QWindowsWindow::debugWindowFlags(m_data.flags)
|
<< m_data.flags << "\n to: " << flags;
|
||||||
<< "\n to: " << QWindowsWindow::debugWindowFlags(flags);
|
|
||||||
const QRect oldGeometry = geometryDp();
|
const QRect oldGeometry = geometryDp();
|
||||||
if (m_data.flags != flags) {
|
if (m_data.flags != flags) {
|
||||||
m_data.flags = flags;
|
m_data.flags = flags;
|
||||||
@ -1549,8 +1548,7 @@ void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags)
|
|||||||
handleGeometryChange();
|
handleGeometryChange();
|
||||||
|
|
||||||
qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << "\n returns: "
|
qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << "\n returns: "
|
||||||
<< QWindowsWindow::debugWindowFlags(m_data.flags)
|
<< m_data.flags << " geometry " << oldGeometry << "->" << newGeometry;
|
||||||
<< " geometry " << oldGeometry << "->" << newGeometry;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWindowsWindowData QWindowsWindow::setWindowFlags_sys(Qt::WindowFlags wt,
|
QWindowsWindowData QWindowsWindow::setWindowFlags_sys(Qt::WindowFlags wt,
|
||||||
@ -2202,62 +2200,6 @@ void QWindowsWindow::setEnabled(bool enabled)
|
|||||||
setStyle(newStyle);
|
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)
|
static HICON createHIcon(const QIcon &icon, int xSize, int ySize)
|
||||||
{
|
{
|
||||||
if (!icon.isNull()) {
|
if (!icon.isNull()) {
|
||||||
|
@ -240,8 +240,6 @@ public:
|
|||||||
void setCursor(const QWindowsWindowCursor &c);
|
void setCursor(const QWindowsWindowCursor &c);
|
||||||
void applyCursor();
|
void applyCursor();
|
||||||
|
|
||||||
static QByteArray debugWindowFlags(Qt::WindowFlags wf);
|
|
||||||
|
|
||||||
inline bool testFlag(unsigned f) const { return (m_flags & f) != 0; }
|
inline bool testFlag(unsigned f) const { return (m_flags & f) != 0; }
|
||||||
inline void setFlag(unsigned f) const { m_flags |= f; }
|
inline void setFlag(unsigned f) const { m_flags |= f; }
|
||||||
inline void clearFlag(unsigned f) const { m_flags &= ~f; }
|
inline void clearFlag(unsigned f) const { m_flags &= ~f; }
|
||||||
|
Loading…
Reference in New Issue
Block a user