Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-39407

Create convenience functions for COM/WRL handling

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P3: Somewhat important
    • 5.4.0
    • None
    • Core: Other
    • Windows [Phone] 8.1

    • WinRT
    • 6d95ce16493fbf819749dbd7ad9e8ffa61859cdb 164ae66ff763b39cfe921df96470c7bfd11038d2

    Description

      There is a lot of verbose COM handling in qtbase in WinRT code paths. We can simplify and make these calls more consistent by making some macros or inline functions in qfunctions_winrt.h:

      • QString/HString conversion functions. These normally take 3-4 lines. An inline function or macro could make it a one-liner. See "qt_QStringFromHString" in qnativesocketengine_winrt.cpp for inspiration.
      • Print qErrnoWarning and return when an HRESULT fails. For example:
        • RETURN_VOID_IF_FAILED() // used inside constructors and functions which return void
        • RETURN_FALSE_IF_FAILED() // used inside methods that return bool
        • RETURN_HR_IF_FAILED() // used inside callbacks
        • RETURN_OK_IF_FAILED() // used inside callbacks that have side effects
      • Global getters for the Core Window/Dispatcher might also be useful. This is done in several places (to great verbosity) and could be centralized into one location.
        • HRESULT getCoreWindow(ICoreWindow **);
        • HRESULT getCoreDispatcher(ICoreDispatcher **);

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            andrew.knight Andrew Knight
            andrew.knight Andrew Knight
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes