Qt 4.8
Classes | Macros | Typedefs | Functions
qcoreapplication.h File Reference
#include <QtCore/qobject.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qeventloop.h>

Go to the source code of this file.

Classes

class  QCoreApplication
 The QCoreApplication class provides an event loop for console Qt applications. More...
 

Macros

#define Q_DECLARE_TR_FUNCTIONS(context)
 The Q_DECLARE_TR_FUNCTIONS() macro declares and implements two translation functions, tr() and trUtf8(), with these signatures: More...
 
#define qApp   QCoreApplication::instance()
 

Typedefs

typedef struct tagMSG MSG
 
typedef void(* QtCleanUpFunction) ()
 

Functions

Q_CORE_EXPORT QString decodeMSG (const MSG &)
 
Q_CORE_EXPORT QDebug operator<< (QDebug, const MSG &)
 
Q_CORE_EXPORT void qAddPostRoutine (QtCleanUpFunction)
 
Q_CORE_EXPORT QString qAppName ()
 
Q_CORE_EXPORT void qRemovePostRoutine (QtCleanUpFunction)
 

Macro Definition Documentation

◆ Q_DECLARE_TR_FUNCTIONS

#define Q_DECLARE_TR_FUNCTIONS (   context)
Value:
public: \
static inline QString tr(const char *sourceText, const char *disambiguation = 0) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation); } \
static inline QString trUtf8(const char *sourceText, const char *disambiguation = 0) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, \
static inline QString tr(const char *sourceText, const char *disambiguation, int n) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, \
static inline QString trUtf8(const char *sourceText, const char *disambiguation, int n) \
{ return QCoreApplication::translate(#context, sourceText, disambiguation, \
private:
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QString translate(const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr)

The Q_DECLARE_TR_FUNCTIONS() macro declares and implements two translation functions, tr() and trUtf8(), with these signatures:

static inline QString tr(const char *sourceText,
const char *comment = 0);
static inline QString trUtf8(const char *sourceText,
const char *comment = 0);

This macro is useful if you want to use QObject::tr() or QObject::trUtf8() in classes that don't inherit from QObject.

Q_DECLARE_TR_FUNCTIONS() must appear at the very top of the class definition (before the first public: or protected:). For example:

class MyMfcView : public CView
{
public:
MyMfcView();
...
};

The context parameter is normally the class name, but it can be any string.

See also
Q_OBJECT, QObject::tr(), QObject::trUtf8()

Definition at line 267 of file qcoreapplication.h.

◆ qApp

#define qApp   QCoreApplication::instance()

Definition at line 69 of file qcoreapplication.h.

Referenced by QCalendarWidgetPrivate::_q_yearClicked(), QCalendarWidgetPrivate::_q_yearEditingFinished(), QWidget::activateWindow(), QApplication::alert(), applicationEventHandler(), QTextHtmlParserNode::applyBackgroundImage(), QGtkStylePrivate::applyCustomPaletteHash(), QApplicationPrivate::applyX11SpecificCommandLineArguments(), axs_FilterProc(), QApplication::changeOverrideCursor(), QX11EmbedWidgetPrivate::checkActivateWindow(), QApplication::clipboard(), QX11Data::clipboardWaitForEvent(), QPrintDialogPrivate::closeCarbonPrintPanel(), QDeclarativeTextEdit::closeSoftwareInputPanel(), QDeclarativeTextInput::closeSoftwareInputPanel(), constructModifierMask(), QShortcutMap::correctGraphicsWidgetContext(), QShortcutMap::correctWidgetContext(), QSettingsPrivate::create(), create_wm_client_leader(), QXIMInputContext::create_xim(), QClassFactory::CreateInstanceHelper(), QGLPixmapData::createPixmapForImage(), QWSDisplay::Data::Data(), QKeySequencePrivate::decodeString(), QDeclarativeItemModule::defineModule(), QDeclarativeUtilModule::defineModule(), QDeclarativeItemModule::defineModuleCompat(), QDeclarativeUtilModule::defineModuleCompat(), QGestureManager::deliverEvents(), QWidget::destroy(), QVFbScreen::disconnect(), QApplicationPrivate::dispatchEnterLeave(), DllCanUnloadNow(), QX11Data::dndEnable(), QDragManager::drag(), QMacStyle::drawControl(), QTextImageHandler::drawObject(), QOleDropTarget::Drop(), DumpIDL(), dumpRecursive(), effectiveState(), QX11EmbedContainer::embedClient(), QApplicationPrivate::emitLastWindowClosed(), enableIme(), QKeySequencePrivate::encodeString(), QWSServer::endDisplayReconfigure(), QIconLoader::ensureInitialized(), QDeclarativeSystemPalette::eventFilter(), QAxHostWidget::eventFilter(), QMenuBar::eventFilter(), QGraphicsScene::eventFilter(), QApplication::exec(), QSystemTrayIconSys::findTrayGeometry(), findWindowThatShouldDisplayMenubar(), flipPoint(), QEventDispatcherBlackberryQPA::flush(), QEventDispatcherQWS::flush(), QEventDispatcherQPA::flush(), QEventDispatcherMac::flush(), QIcon::fromTheme(), getNetWmState(), QGtkStylePrivate::getThemeFont(), QAxServerBase::GetUserType(), QMacInputContext::globalEventProcessor(), QApplicationPrivate::globalEventProcessor(), glScreenForDevice(), QGraphicsWidget::grabShortcut(), QWidget::grabShortcut(), QWidgetPrivate::handleSoftwareInputPanel(), QEventDispatcherQPAPrivate::hasIntegration(), QWidgetPrivate::hide_helper(), QWidgetPrivate::hide_sys(), QWidgetPrivate::hideChildren(), QGuiPlatformPlugin::iconThemeSearchPaths(), QWidgetPrivate::inheritStyle(), QGraphicsScenePrivate::init(), QPrinter::init(), QWidgetPrivate::init(), init_display(), QGtkStylePrivate::initGtkWidgets(), QBBScreenEventHandler::injectPointerMoveEvent(), QWidgetPrivate::inputContext(), QDeclarativeDebugServer::instance(), QGestureManager::instance(), QGLSignalProxy::instance(), QTextImageHandler::intrinsicSize(), QWidgetPrivate::isBackgroundInherited(), isServerProcess(), QPrinter::isValid(), jump(), QFontDatabase::load(), QTextDocument::loadResource(), loadWin(), QFontDatabase::loadXlfd(), make_win_eventUPP(), QKeyEvent::matches(), maybeSwapShortcut(), QTest::mouseEvent(), QDeclarativeTextInput::mouseReleaseEvent(), QDeclarativeTextEdit::mouseReleaseEvent(), QAccessibleWidget::navigate(), QApplication::notify(), QAxServerBase::OnAmbientPropertyChange(), onApplicationChangedActivation(), onApplicationWindowChangedActivation(), QAxClientSite::OnFocus(), QAxClientSite::OnUIDeactivate(), QDeclarativeTextEdit::openSoftwareInputPanel(), QDeclarativeTextInput::openSoftwareInputPanel(), QApplication::overrideCursor(), QDecorationStyled::paint(), QDecorationWindows::paint(), QDecorationDefault::paint(), QDecorationWindows::paintButton(), QAccessibleWidget::parentObject(), QDeclarativeJS::Parser::parse(), parseGeometry(), PixmapEntry::pixmap(), QAuServerNAS::play(), QMacStyle::polish(), QGtkStyle::polish(), QEventDispatcherQWS::processEvents(), QEventDispatcherX11::processEvents(), QGuiEventDispatcherWin32::processEvents(), QWSKeyboardHandler::processKeycode(), q_createNativeChildrenAndSetParent(), qAxFactory(), QBBIntegration::QBBIntegration(), QClipboardINCRTransaction::QClipboardINCRTransaction(), QDeclarativeApplication::QDeclarativeApplication(), QDeclarativeSystemPalette::QDeclarativeSystemPalette(), QDirectPainter::QDirectPainter(), QTest::qExec(), QFontComboBox::QFontComboBox(), QFontEngineX11FT::QFontEngineX11FT(), QMdiSubWindow::QMdiSubWindow(), QNlaEngine::QNlaEngine(), QShortcut::QShortcut(), qstring_to_xtp(), qt_cleanup(), qt_dispatchTabletProximityEvent(), qt_grab_cursor(), qt_init(), qt_init_app_proc_handler(), qt_init_tablet_proximity_handler(), qt_mac_applicationmenu_string(), qt_mac_display_change_callbk(), qt_mac_dnd_update_action(), qt_mac_get_mac_modifiers(), qt_mac_get_modifiers(), qt_mac_menu_event(), qt_mac_mouse_inside_answer_rect(), qt_mac_set_modal_state_helper_recursive(), qt_mac_should_disable_menu(), qt_mac_unregister_widget(), qt_mac_update_os_settings(), qt_macSymbolForQtKey(), qt_new_audio_server(), qt_painter_thread_test(), qt_pixmap_thread_test(), qt_tablet_cleanup_wce(), qt_win_display_dc(), qt_wince_full_screen(), qt_x11_wait_for_window_manager(), qt_x11EventFilter(), QTipLabel::QTipLabel(), qtkeyForMacSymbol(), QtWndProc(), QAccessible::queryAccessibleInterface(), QUIKitScreen::QUIKitScreen(), QWaylandWindow::QWaylandWindow(), QWhatsThisPrivate::QWhatsThisPrivate(), QWidgetPrivate::QWidgetPrivate(), QWindowsCEStyle::QWindowsCEStyle(), QWindowsMobileStyle::QWindowsMobileStyle(), qwsEventSourceDispatch(), QApplication::qwsProcessEvent(), QX11EmbedContainer::QX11EmbedContainer(), QXcbConnection::QXcbConnection(), QVFbKeyboardHandler::readKeyboardData(), QVFbScreenKeyboardHandler::readKeyboardData(), QWSDisplay::Data::reinit(), QGraphicsWidget::releaseShortcut(), QWidget::releaseShortcut(), QAlphaWidget::render(), QStyleSheetStyle::repolish(), QDirectPainter::reserveRegion(), QApplication::restoreOverrideCursor(), QAlphaWidget::run(), QRollEffect::run(), QEventDispatcherQPAPrivate::runEventLoopIntegration(), QGraphicsTextItem::sceneEvent(), screenForDevice(), QRollEffect::scroll(), QTest::sendKeyEvent(), QDeclarativeTextInputPrivate::sendMouseEventToInputContext(), QApplication::setActiveWindow(), QWidget::setAttribute(), QShortcut::setAutoRepeat(), QAction::setAutoRepeat(), QApplication::setColorSpec(), QShortcut::setContext(), QShortcut::setEnabled(), QAction::setEnabled(), QApplicationPrivate::setFocusWidget(), QApplication::setFont(), QWidget::setInputMethodHints(), QShortcut::setKey(), QApplication::setOverrideCursor(), QApplicationPrivate::setPalette_helper(), QWidget::setParent(), QAction::setShortcut(), QGraphicsWidget::setShortcutAutoRepeat(), QWidget::setShortcutAutoRepeat(), QAction::setShortcutContext(), QGraphicsWidget::setShortcutEnabled(), QWidget::setShortcutEnabled(), QAction::setShortcuts(), QApplication::setStyle(), QWidget::setStyle(), QApplication::setStyleSheet(), QGtkStylePrivate::setupGtkFileChooser(), QAction::setVisible(), QWidget::setVisible(), QWSDisplay::setWindowCaption(), QWidget::setWindowState(), QMacPrintEnginePrivate::shouldSuppressStatus(), QWidget::show(), QWidgetPrivate::show_helper(), QTest::simulateEvent(), sm_dieCallback(), sm_performSaveYourself(), QUIKitEventLoop::startEventLoop(), QAuServerNAS::stop(), QApplication::style(), QStyleSheetStyle::styleRules(), QApplication::syncX(), QSystemTrayIconSys::sysTrayTracker(), QCoreFuriCuri::timerEvent(), QKeyMapperPrivate::translateKeyEvent(), QETWidget::translateKeyEvent(), QETWidget::translateMouseEvent(), QETWidget::translateWheelEvent(), QETWidget::translateXinputEvent(), QMacStyle::unpolish(), QGtkStyle::unpolish(), QStyleSheetStyle::unpolish(), QUIKitScreen::updateInterfaceOrientation(), QWidget::updateMicroFocus(), UpdateRegistry(), QGtkStyleUpdateScheduler::updateTheme(), QWSDisplay::Data::waitForRegionAck(), QWSDisplay::Data::waitForRegionEvents(), QAxScriptSite::window(), QX11EmbedWidget::x11Event(), QX11EmbedContainer::x11Event(), x11EventSourceDispatch(), QApplication::x11ProcessEvent(), QAction::~QAction(), QDirectPainterPrivate::~QDirectPainterPrivate(), QGraphicsScene::~QGraphicsScene(), QShortcut::~QShortcut(), and QWidget::~QWidget().

Typedef Documentation

◆ MSG

typedef struct tagMSG MSG

Definition at line 54 of file qcoreapplication.h.

◆ QtCleanUpFunction

typedef void(* QtCleanUpFunction) ()

Definition at line 282 of file qcoreapplication.h.

Function Documentation

◆ decodeMSG()

Q_CORE_EXPORT QString decodeMSG ( const MSG )

Definition at line 645 of file qcoreapplication_win.cpp.

Referenced by operator<<(), and valueCheck().

646 {
647  const WPARAM wParam = msg.wParam;
648  const LPARAM lParam = msg.lParam;
649  QString wmmsg = QString::fromLatin1(findWMstr(msg.message));
650  // Unknown WM_, so use number
651  if (wmmsg.isEmpty())
652  wmmsg = QString::fromLatin1("WM_(%1)").arg(msg.message);
653 
654  QString rawParameters;
655  rawParameters.sprintf("hwnd(0x%p) ", (void *)msg.hwnd);
656 
657  // Custom WM_'s
658  if (msg.message > WM_APP)
659  wmmsg = QString::fromLatin1("WM_APP + %1").arg(msg.message - WM_APP);
660  else if (msg.message > WM_USER)
661  wmmsg = QString::fromLatin1("WM_USER + %1").arg(msg.message - WM_USER);
662 
663  QString parameters;
664  switch (msg.message) {
665 #ifdef WM_ACTIVATE
666  case WM_ACTIVATE:
667  {
668  QString activation = valueCheck(wParam,
669  FLAG_STRING(WA_ACTIVE, "Activate"),
670  FLAG_STRING(WA_INACTIVE, "Deactivate"),
671  FLAG_STRING(WA_CLICKACTIVE, "Activate by mouseclick"),
672  FLAG_STRING());
673  parameters.sprintf("%s Hwnd (0x%p)", activation.toLatin1().data(), (void *)msg.hwnd);
674  }
675  break;
676 #endif
677 #ifdef WM_CAPTURECHANGED
678  case WM_CAPTURECHANGED:
679  parameters.sprintf("Hwnd gaining capture (0x%p)", (void *)lParam);
680  break;
681 #endif
682 #ifdef WM_CREATE
683  case WM_CREATE:
684  {
685  LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam;
686  QString styles = flagCheck(lpcs->style,
687  FLGSTR(WS_BORDER),
688  FLGSTR(WS_CAPTION),
689  FLGSTR(WS_CHILD),
690  FLGSTR(WS_CLIPCHILDREN),
691  FLGSTR(WS_CLIPSIBLINGS),
692  FLGSTR(WS_DISABLED),
693  FLGSTR(WS_DLGFRAME),
694  FLGSTR(WS_GROUP),
695  FLGSTR(WS_HSCROLL),
696  FLGSTR(WS_OVERLAPPED),
697 #if defined(WS_OVERLAPPEDWINDOW) && (WS_OVERLAPPEDWINDOW != 0)
699 #endif
700 #ifdef WS_ICONIC
701  FLGSTR(WS_ICONIC),
702 #endif
704  FLGSTR(WS_MAXIMIZEBOX),
706  FLGSTR(WS_MINIMIZEBOX),
708  FLGSTR(WS_POPUP),
709 #ifdef WS_POPUPWINDOW
711 #endif
712  FLGSTR(WS_SIZEBOX),
713  FLGSTR(WS_SYSMENU),
714  FLGSTR(WS_TABSTOP),
716 #ifdef WS_TILED
717  FLGSTR(WS_TILED),
718 #endif
719 #ifdef WS_TILEDWINDOW
721 #endif
722  FLGSTR(WS_VISIBLE),
723  FLGSTR(WS_VSCROLL),
724  FLAG_STRING());
725 
726  QString exStyles = flagCheck(lpcs->dwExStyle,
727 #ifdef WS_EX_ACCEPTFILES
728  FLGSTR(WS_EX_ACCEPTFILES),
729 #endif
730 #ifdef WS_EX_APPWINDOW
731  FLGSTR(WS_EX_APPWINDOW),
732 #endif
733  FLGSTR(WS_EX_CLIENTEDGE),
734  FLGSTR(WS_EX_DLGMODALFRAME),
735 #ifdef WS_EX_LEFT
736  FLGSTR(WS_EX_LEFT),
737 #endif
738  FLGSTR(WS_EX_LEFTSCROLLBAR),
739 #ifdef WS_EX_LTRREADING
740  FLGSTR(WS_EX_LTRREADING),
741 #endif
742 #ifdef WS_EX_MDICHILD
743  FLGSTR(WS_EX_MDICHILD),
744 #endif
745 #ifdef WS_EX_NOACTIVATE
746  FLGSTR(WS_EX_NOACTIVATE),
747 #endif
748 #ifdef WS_EX_NOANIMATION
749  FLGSTR(WS_EX_NOANIMATION),
750 #endif
752  FLGSTR(WS_EX_OVERLAPPEDWINDOW),
753 #ifdef WS_EX_PALETTEWINDOW
754  FLGSTR(WS_EX_PALETTEWINDOW),
755 #endif
756 #ifdef WS_EX_RIGHT
757  FLGSTR(WS_EX_RIGHT),
758 #endif
759 #ifdef WS_EX_RIGHTSCROLLBAR
760  FLGSTR(WS_EX_RIGHTSCROLLBAR),
761 #endif
762 #ifdef WS_EX_RTLREADING
763  FLGSTR(WS_EX_RTLREADING),
764 #endif
765  FLGSTR(WS_EX_STATICEDGE),
767  FLGSTR(WS_EX_TOPMOST),
768 #ifdef WS_EX_TRANSPARENT
769  FLGSTR(WS_EX_TRANSPARENT),
770 #endif
771  FLGSTR(WS_EX_WINDOWEDGE),
772 #ifdef WS_EX_CAPTIONOKBTN
774 #endif
775  FLAG_STRING());
776 
778  if (lpcs->lpszClass != 0) {
779  if (HIWORD(lpcs->lpszClass) == 0) // Atom
780  className = QString::number(LOWORD(lpcs->lpszClass), 16);
781  else // String
782  className = QString((QChar*)lpcs->lpszClass,
783  (int)wcslen(reinterpret_cast<const wchar_t *>(lpcs->lpszClass)));
784  }
785 
786  QString windowName;
787  if (lpcs->lpszName != 0)
788  windowName = QString((QChar*)lpcs->lpszName,
789  (int)wcslen(reinterpret_cast<const wchar_t *>(lpcs->lpszName)));
790 
791  parameters.sprintf("x,y(%4d,%4d) w,h(%4d,%4d) className(%s) windowName(%s) parent(0x%p) style(%s) exStyle(%s)",
792  lpcs->x, lpcs->y, lpcs->cx, lpcs->cy, className.toLatin1().data(),
793  windowName.toLatin1().data(), (void *)lpcs->hwndParent,
794  styles.toLatin1().data(), exStyles.toLatin1().data());
795  }
796  break;
797 #endif
798 #ifdef WM_DESTROY
799  case WM_DESTROY:
800  parameters.sprintf("Destroy hwnd (0x%p)", (void *)msg.hwnd);
801  break;
802 #endif
803 #ifdef WM_IME_NOTIFY
804  case WM_IME_NOTIFY:
805  {
806  QString imnCommand = valueCheck(wParam,
807  FLGSTR(IMN_CHANGECANDIDATE),
808  FLGSTR(IMN_CLOSECANDIDATE),
809  FLGSTR(IMN_CLOSESTATUSWINDOW),
810  FLGSTR(IMN_GUIDELINE),
811  FLGSTR(IMN_OPENCANDIDATE),
812  FLGSTR(IMN_OPENSTATUSWINDOW),
813  FLGSTR(IMN_SETCANDIDATEPOS),
814  FLGSTR(IMN_SETCOMPOSITIONFONT),
815  FLGSTR(IMN_SETCOMPOSITIONWINDOW),
816  FLGSTR(IMN_SETCONVERSIONMODE),
817  FLGSTR(IMN_SETOPENSTATUS),
818  FLGSTR(IMN_SETSENTENCEMODE),
819  FLGSTR(IMN_SETSTATUSWINDOWPOS),
820  FLAG_STRING());
821  parameters.sprintf("Command(%s : 0x%p)", imnCommand.toLatin1().data(), (void *)lParam);
822  }
823  break;
824 #endif
825 #ifdef WM_IME_SETCONTEXT
826  case WM_IME_SETCONTEXT:
827  {
828  bool fSet = (BOOL)wParam;
829  DWORD fShow = (DWORD)lParam;
830  QString showFlgs = flagCheck(fShow,
831 #ifdef ISC_SHOWUICOMPOSITIONWINDOW
832  FLGSTR(ISC_SHOWUICOMPOSITIONWINDOW),
833 #endif
834 #ifdef ISC_SHOWUIGUIDWINDOW
835  FLGSTR(ISC_SHOWUIGUIDWINDOW),
836 #endif
837 #ifdef ISC_SHOWUISOFTKBD
838  FLGSTR(ISC_SHOWUISOFTKBD),
839 #endif
840  FLGSTR(ISC_SHOWUICANDIDATEWINDOW),
841  FLGSTR(ISC_SHOWUICANDIDATEWINDOW << 1),
842  FLGSTR(ISC_SHOWUICANDIDATEWINDOW << 2),
843  FLGSTR(ISC_SHOWUICANDIDATEWINDOW << 3),
844  FLAG_STRING());
845  parameters.sprintf("Input context(%s) Show flags(%s)", (fSet? "Active" : "Inactive"), showFlgs.toLatin1().data());
846  }
847  break;
848 #endif
849 #ifdef WM_KILLFOCUS
850  case WM_KILLFOCUS:
851  parameters.sprintf("Hwnd gaining keyboard focus (0x%p)", (void *)wParam);
852  break;
853 #endif
854 #ifdef WM_CHAR
855  case WM_CHAR:
856 #endif
857 #ifdef WM_IME_CHAR
858  case WM_IME_CHAR:
859 #endif
860 #ifdef WM_KEYDOWN
861  case WM_KEYDOWN:
862 #endif
863 #ifdef WM_KEYUP
864  case WM_KEYUP:
865  {
866  int nVirtKey = (int)wParam;
867  long lKeyData = (long)lParam;
868  int repCount = (lKeyData & 0xffff); // Bit 0-15
869  int scanCode = (lKeyData & 0xf0000) >> 16; // Bit 16-23
870  bool contextCode = (lKeyData && 0x20000000); // Bit 29
871  bool prevState = (lKeyData && 0x40000000); // Bit 30
872  bool transState = (lKeyData && 0x80000000); // Bit 31
873  parameters.sprintf("Virual-key(0x%x) Scancode(%d) Rep(%d) Contextcode(%d), Prev state(%d), Trans state(%d)",
874  nVirtKey, scanCode, repCount, contextCode, prevState, transState);
875  }
876  break;
877 #endif
878 #ifdef WM_INPUTLANGCHANGE
879  case WM_INPUTLANGCHANGE:
880  parameters = QLatin1String("Keyboard layout changed");
881  break;
882 #endif // WM_INPUTLANGCHANGE
883 #ifdef WM_NCACTIVATE
884  case WM_NCACTIVATE:
885  {
886  parameters = (msg.wParam? QLatin1String("Active Titlebar") : QLatin1String("Inactive Titlebar"));
887  }
888  break;
889 #endif
890 #ifdef WM_MOUSEACTIVATE
891  case WM_MOUSEACTIVATE:
892  {
893  QString mouseMsg = QString::fromLatin1(findWMstr(HIWORD(lParam)));
894  parameters.sprintf("TLW(0x%p) HittestCode(0x%x) MouseMsg(%s)", (void *)wParam, LOWORD(lParam), mouseMsg.toLatin1().data());
895  }
896  break;
897 #endif
898 #ifdef WM_MOUSELEAVE
899  case WM_MOUSELEAVE:
900  break; // wParam & lParam not used
901 #endif
902 #ifdef WM_MOUSEHOVER
903  case WM_MOUSEHOVER:
904 #endif
905 #ifdef WM_MOUSEWHEEL
906  case WM_MOUSEWHEEL:
907 #endif
908 #ifdef WM_MOUSEHWHEEL
909  case WM_MOUSEHWHEEL:
910 #endif
911 #ifdef WM_LBUTTONDBLCLK
912  case WM_LBUTTONDBLCLK:
913 #endif
914 #ifdef WM_LBUTTONDOWN
915  case WM_LBUTTONDOWN:
916 #endif
917 #ifdef WM_LBUTTONUP
918  case WM_LBUTTONUP:
919 #endif
920 #ifdef WM_MBUTTONDBLCLK
921  case WM_MBUTTONDBLCLK:
922 #endif
923 #ifdef WM_MBUTTONDOWN
924  case WM_MBUTTONDOWN:
925 #endif
926 #ifdef WM_MBUTTONUP
927  case WM_MBUTTONUP:
928 #endif
929 #ifdef WM_RBUTTONDBLCLK
930  case WM_RBUTTONDBLCLK:
931 #endif
932 #ifdef WM_RBUTTONDOWN
933  case WM_RBUTTONDOWN:
934 #endif
935 #ifdef WM_RBUTTONUP
936  case WM_RBUTTONUP:
937 #endif
938 #ifdef WM_MOUSEMOVE
939  case WM_MOUSEMOVE:
940  {
941  QString vrtKeys = flagCheck(wParam,
942  FLGSTR(MK_CONTROL),
943  FLGSTR(MK_LBUTTON),
944  FLGSTR(MK_MBUTTON),
945  FLGSTR(MK_RBUTTON),
946  FLGSTR(MK_SHIFT),
947 #ifdef MK_XBUTTON1
949 #endif
950 #ifdef MK_XBUTTON2
952 #endif
953  FLAG_STRING());
954  parameters.sprintf("x,y(%4d,%4d) Virtual Keys(%s)", GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), vrtKeys.toLatin1().data());
955  }
956  break;
957 #endif
958 #ifdef WM_MOVE
959  case WM_MOVE:
960  parameters.sprintf("x,y(%4d,%4d)", LOWORD(lParam), HIWORD(lParam));
961  break;
962 #endif
963 #if defined(WM_PAINT) && defined(WM_ERASEBKGND)
964  case WM_ERASEBKGND:
965  case WM_PAINT:
966  parameters.sprintf("hdc(0x%p)", (void *)wParam);
967  break;
968 #endif
969 #ifdef WM_QUERYNEWPALETTE
970  case WM_QUERYNEWPALETTE:
971  break; // lParam & wParam are unused
972 #endif
973 #ifdef WM_SETCURSOR
974  case WM_SETCURSOR:
975  {
976  QString mouseMsg = QString::fromLatin1(findWMstr(HIWORD(lParam)));
977  parameters.sprintf("HitTestCode(0x%x) MouseMsg(%s)", LOWORD(lParam), mouseMsg.toLatin1().data());
978  }
979  break;
980 #endif
981 #ifdef WM_SETFOCUS
982  case WM_SETFOCUS:
983  parameters.sprintf("Lost Focus (0x%p)", (void *)wParam);
984  break;
985 #endif
986 #ifdef WM_SETTEXT
987  case WM_SETTEXT:
988  parameters.sprintf("Set Text (%s)", QString((QChar*)lParam, (int)wcslen(reinterpret_cast<const wchar_t *>(lParam))).toLatin1().data()); //Unicode string
989  break;
990 #endif
991 #ifdef WM_SIZE
992  case WM_SIZE:
993  {
994  QString showMode = valueCheck(wParam,
995  FLGSTR(SIZE_MAXHIDE),
996  FLGSTR(SIZE_MAXIMIZED),
997  FLGSTR(SIZE_MAXSHOW),
998  FLGSTR(SIZE_MINIMIZED),
999  FLGSTR(SIZE_RESTORED),
1000  FLAG_STRING());
1001 
1002  parameters.sprintf("w,h(%4d,%4d) showmode(%s)", LOWORD(lParam), HIWORD(lParam), showMode.toLatin1().data());
1003  }
1004  break;
1005 #endif
1006 #ifdef WM_WINDOWPOSCHANGED
1007  case WM_WINDOWPOSCHANGED:
1008  {
1009  LPWINDOWPOS winPos = (LPWINDOWPOS)lParam;
1010  if (!winPos)
1011  break;
1012  QString hwndAfter = valueCheck(quint64(winPos->hwndInsertAfter),
1013  FLAG_STRING((qptrdiff)HWND_BOTTOM, "HWND_BOTTOM"),
1014  FLAG_STRING((qptrdiff)HWND_NOTOPMOST, "HWND_NOTOPMOST"),
1015  FLAG_STRING((qptrdiff)HWND_TOP, "HWND_TOP"),
1016  FLAG_STRING((qptrdiff)HWND_TOPMOST, "HWND_TOPMOST"),
1017  FLAG_STRING());
1018  if (hwndAfter.isEmpty())
1019  hwndAfter = QString::number((quintptr)winPos->hwndInsertAfter, 16);
1020  QString flags = flagCheck(winPos->flags,
1021  FLGSTR(SWP_DRAWFRAME),
1022  FLGSTR(SWP_FRAMECHANGED),
1023  FLGSTR(SWP_HIDEWINDOW),
1024  FLGSTR(SWP_NOACTIVATE),
1025 #ifdef SWP_NOCOPYBITS
1026  FLGSTR(SWP_NOCOPYBITS),
1027 #endif
1028  FLGSTR(SWP_NOMOVE),
1029  FLGSTR(SWP_NOOWNERZORDER),
1031  FLGSTR(SWP_NOREPOSITION),
1032 #ifdef SWP_NOSENDCHANGING
1033  FLGSTR(SWP_NOSENDCHANGING),
1034 #endif
1035  FLGSTR(SWP_NOSIZE),
1036  FLGSTR(SWP_NOZORDER),
1037  FLGSTR(SWP_SHOWWINDOW),
1038  FLAG_STRING());
1039  parameters.sprintf("x,y(%4d,%4d) w,h(%4d,%4d) flags(%s) hwndAfter(%s)", winPos->x, winPos->y, winPos->cx, winPos->cy, flags.toLatin1().data(), hwndAfter.toLatin1().data());
1040  }
1041  break;
1042 #endif
1043  default:
1044  parameters.sprintf("wParam(0x%p) lParam(0x%p)", (void *)wParam, (void *)lParam);
1045  break;
1046  }
1047  // Yes, we want to give the WM_ names 20 chars of space before showing the
1048  // decoded message, since some of the common messages are quite long, and
1049  // we don't want the decoded information to vary in output position
1050  QString message = QString::fromLatin1("%1: ").arg(wmmsg, 20);
1051  message += rawParameters;
1052  message += parameters;
1053  return message;
1054 }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
#define WM_MOUSEWHEEL
Definition: qt_windows.h:116
QString & sprintf(const char *format,...)
Safely builds a formatted string from the format string cformat and an arbitrary list of arguments...
Definition: qstring.cpp:5567
QIntegerForSizeof< void * >::Unsigned quintptr
Definition: qglobal.h:986
#define WS_EX_TOOLWINDOW
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
#define FLGSTR(x)
#define WM_MOUSEHWHEEL
Definition: qt_windows.h:119
#define HWND_NOTOPMOST
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define WS_MAXIMIZE
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString flagCheck(uint actual,...)
#define MK_XBUTTON1
QString valueCheck(uint actual,...)
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
#define WM_SETCURSOR
const char * className
Definition: qwizard.cpp:137
#define WS_MINIMIZE
#define WS_TILED
#define HWND_TOPMOST
unsigned __int64 quint64
Definition: qglobal.h:943
QIntegerForSizeof< void * >::Signed qptrdiff
Definition: qglobal.h:987
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
#define GET_X_LPARAM(lp)
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
#define WS_EX_NOPARENTNOTIFY
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
#define SWP_NOREDRAW
#define WS_OVERLAPPEDWINDOW
#define MK_XBUTTON2
static const char * findWMstr(uint msg)
#define WS_POPUPWINDOW
#define GET_Y_LPARAM(lp)
#define WS_EX_CAPTIONOKBTN
FLAG_STRING_STRUCT FLAG_STRING(uint value=0, const char *c=0)
#define WS_THICKFRAME
#define WS_TILEDWINDOW
#define WM_MOUSELEAVE

◆ operator<<()

Q_CORE_EXPORT QDebug operator<< ( QDebug  ,
const MSG  
)

Definition at line 1058 of file qcoreapplication_win.cpp.

1059 {
1060  dbg << decodeMSG(msg);
1061  return dbg.nospace();
1062 }
QString decodeMSG(const MSG &msg)

◆ qAddPostRoutine()

Q_CORE_EXPORT void qAddPostRoutine ( QtCleanUpFunction  )
related

◆ qAppName()

Q_CORE_EXPORT QString qAppName ( )

Definition at line 575 of file qcoreapplication.cpp.

Referenced by getNetWmState(), qt_mac_menu_merge_text(), qt_tablet_cleanup_wce(), and sm_performSaveYourself().

576 {
578  return QString();
579  return QCoreApplication::instance()->d_func()->appName();
580 }
static bool checkInstance(const char *method)
The QString class provides a Unicode character string.
Definition: qstring.h:83
static QCoreApplication * instance()
Returns a pointer to the application&#39;s QCoreApplication (or QApplication) instance.

◆ qRemovePostRoutine()

Q_CORE_EXPORT void qRemovePostRoutine ( QtCleanUpFunction  )

Definition at line 281 of file qcoreapplication.cpp.

282 {
283  QVFuncList *list = postRList();
284  if (!list)
285  return;
286  list->removeAll(p);
287 }
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770