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. QDbus chat example viz qdbusxml2cpp
Forum Updated to NodeBB v4.3 + New Features

QDbus chat example viz qdbusxml2cpp

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 555 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.
  • PsnarfP Offline
    PsnarfP Offline
    Psnarf
    wrote on last edited by
    #1

    The Qt Dbus chat example, modified from Troltech 4.8, no longer contains the include and source files for the d-bus adapter and interface, rather those include files are built each time the project is compiled. The documentation on
    https://doc.qt.io/qt-5/qdbusxml2cpp.html proclaims:

    The qdbusxml2cpp tool is not meant to be run every time you 
    compile your application.
    

    Could not the example include the source and include files with an explanation of how qdbusxml2cpp created them from the xml file? Upon first glance, the casual reader may be astonished that build/run just works. There should be an instruction to run more than one instance of the chat window, otherwise the user experience does not match the image with two instances chatting among themselves. Perhaps there could be a tutorial with full documentation of each function? Is it not considered bad form to include main(), mainwindow(), and all in one c++ file?

    1 Reply Last reply
    0
    • PsnarfP Offline
      PsnarfP Offline
      Psnarf
      wrote on last edited by
      #2

      The qdbusxml2cpp tool could be modified to change the pointer to QObject from zero to nullptr.

       QObject *parent = nullptr
      

      A pass through all of the examples hunting for *parent=0 would help bring things up to C++11? If I can be of assistance in this matter, do not hesitate to contact me.

      PsnarfP 1 Reply Last reply
      1
      • PsnarfP Psnarf

        The qdbusxml2cpp tool could be modified to change the pointer to QObject from zero to nullptr.

         QObject *parent = nullptr
        

        A pass through all of the examples hunting for *parent=0 would help bring things up to C++11? If I can be of assistance in this matter, do not hesitate to contact me.

        PsnarfP Offline
        PsnarfP Offline
        Psnarf
        wrote on last edited by
        #3

        There are only 267 files with "*pointer=0" in Qt/Examples/Qt-5.13.0. Easy to fix with find -exec sed.

        1 Reply Last reply
        1
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Nice catch !

          Would you consider submitting a patch to fix that ? :-)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by Christian Ehrlicher
            #5

            @sgaist said in QDbus chat example viz qdbusxml2cpp:

            Would you consider submitting a patch to fix that ? :-)

            No need for it anymore since at least https://codereview.qt-project.org/c/qt/qtbase/+/267839 I would guess :)

            /edit: there are still a lot left, will let clang-tidy to the rest :)
            /edit2: https://codereview.qt-project.org/c/qt/qtbase/+/272360

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            1
            • PsnarfP Offline
              PsnarfP Offline
              Psnarf
              wrote on last edited by
              #6

              @SGaist There are inconsistent styles, making things a bit more difficult.
              *parent = 0
              *parent=0
              * parent = 0
              QObject * parent = 0
              Invoking the style police is a matter for another topic. (K&R vs Stroustrup?)
              Only two headers use the spaceless assignment:

              find Qt/Examples/Qt-5.13.0 -type f -name "*.h" \
                 -exec grep --with-filename "parent=0" {} \; 
              

              Qt/Examples/Qt-5.13.0/quick/models/objectlistmodel/dataobject.h
              2x QObject parent=0
              Qt/Examples/Qt-5.13.0/sensors/sensor_explorer/import/propertyinfo.h
              1x QObject
              parent=0
              Easy manual edit, or

              -exec sed 's,parent=0,parent=nullptr,g' -i {} \;
              

              As for the rest:

              find Qt/Examples/Qt-5.13.0 -type f -name "*.h" \
              -exec sed 's,parent = 0,parent = nullptr,g' -i {} \;
              
              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Looks like @Christian-Ehrlicher is already working on it so it should be good in a near future release.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  At least in QtBase, not the rest. So patches for all other modules are welcome.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  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