Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt handle native messages?
Forum Updated to NodeBB v4.3 + New Features

Qt handle native messages?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 5.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Peppy
    wrote on last edited by
    #1

    Is there any way how to handle native messages? I mean to handle, for example, on Windows WM_NCPAINT (to work with border). It is not available to work with Window Caption Bar. Will Qt implement it? Yes, it requires to add some handler function for example, add to QWidget method:
    @virtual void QWidget::borderPaintEvent(QPainter* e) = 0;@ ?
    In WinAPI it just require to catch in Switch-case code...
    @
    case WM_NCPAINT:
    // call QWidget::borderPaintEvent(QPainter *e);
    break;
    @
    It could allows me to work with Non-Client Area in Qt and use platform-depent libraries. Could it be RFC, Can I push it somewhere ?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      Like "QCoreApplication::winEventFilter()":http://doc.qt.nokia.com/latest/qcoreapplication.html#winEventFilter?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Peppy
        wrote on last edited by
        #3

        Yes. But, I think, it is not good idea to work with Window settings under QCoreApplication (QApplication). Much more logic gives to have handler under QWidget. So, I will have to inherit and replace QWidget. It seems.

        //EDIT:
        Hmm...I think to inherit QCoreApplication/QApplication, reimplement winEventFilter, and it in, call @MainWidget::borderPaintEvent();@
        This could be also an idea...

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          "QWidget::winEvent":http://doc.qt.nokia.com/latest/qwidget.html#winEvent.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Peppy
            wrote on last edited by
            #5

            Yes, and into it add line of code:
            @
            if(msg.message == WM_NCPAINT)
            {
            borderPaintEvent();
            }@
            Yes, it has logic...

            EDIT: but what to @long result@ ??

            1 Reply Last reply
            0
            • L Offline
              L Offline
              lgeyer
              wrote on last edited by
              #6

              result is the "system-dependant":http://goo.gl/t8Cg3, "message-dependant":http://goo.gl/G1e1Q result of the message. "In your case":http://goo.gl/oL2jS zero if the message has been processed.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved