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

Add decorations for uic's generated data members declarations

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Build tools: uic
    • None

    Description

      I have a small feature request (that I've already implemented as a local hack, so it's doable, I'm just wondering on the proper API.)

      I'd like to have uic support decorations when it generates the data members in the Ui class. Basically, instead of generating

      class Ui_Form {
      public:
        QPushButton *button;
        QLabel *label; 
        // etc.
      };
      

      I'd like to have some means to tune the generation so that I could get something like this out:

      #include <smart_ptr> // custom include
      
      class Ui_Form {
      public:
        smart_ptr<QPushButton *> button;
        smart_ptr<QLabel *> label; 
        // etc.
      };
      

      (There's some support for custom includes, but it's limited to 1 include , and this should be on top of that).

      I guess it could be as blunt as two new command line options, like -decl-prefix="smart_ptr<" and -decl-suffix="> ", but maybe we have better ideas?

      I also wonder about CMake support for all of this. I wonder how to customize uic invocations for some .ui files. (AUTOUIC seems to have some problems with Ninja, so few(er) projects adopt it these days?)

      Attachments

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

        Activity

          People

            jkobus Jarek Kobus
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes