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. Increasing usage for C++ new operators based on data model indexes?
QtWS25 Last Chance

Increasing usage for C++ new operators based on data model indexes?

Scheduled Pinned Locked Moved Unsolved General and Desktop
data modelscreateindexallocationnew operatorssoftware design
116 Posts 6 Posters 51.3k Views
  • 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.
  • E elfring

    No they can't.

    Why do you try to exclude the possibility that various data can be loaded into models?

    … - a proof of concept in code.

    Do any other aspects hinder you to discuss software design possibilities around returning pointers (or C++ references) from functions after a few parameters were passed?

    kshegunovK Offline
    kshegunovK Offline
    kshegunov
    Moderators
    wrote on last edited by kshegunov
    #87

    @elfring said in Increasing usage for C++ new operators based on data model indexes?:

    Why do you try to exclude the possibility that various data can be loaded into models?

    I don't, and it already can through QVariant.

    Do any other aspects hinder you to discuss software design possibilities around returning pointers (or C++ references) from functions after a few parameters were passed?

    No. I want you to meet the burden or proof - if you claim something, have the balls to back it up. You claim to have an idea that's better than the currently available one, put it on paper, so to speak, and we can discuss it.

    Read and abide by the Qt Code of Conduct

    E 1 Reply Last reply
    2
    • kshegunovK kshegunov

      @elfring said in Increasing usage for C++ new operators based on data model indexes?:

      Why do you try to exclude the possibility that various data can be loaded into models?

      I don't, and it already can through QVariant.

      Do any other aspects hinder you to discuss software design possibilities around returning pointers (or C++ references) from functions after a few parameters were passed?

      No. I want you to meet the burden or proof - if you claim something, have the balls to back it up. You claim to have an idea that's better than the currently available one, put it on paper, so to speak, and we can discuss it.

      E Offline
      E Offline
      elfring
      wrote on last edited by
      #88

      You claim to have an idea that's better than the currently available one,

      I got another software development idea which I find useful.

      put it on paper,

      I have described it in a few variants for this feature request already.

      so to speak, and we can discuss it.

      Another approach

      • Function input:
        Parameters like row and column
      • Function output:
        • Pointer ⇒ How likely is it that this function variant can be called “C++ new operator”?
        • C++ reference ⇒ Would you like to use direct access for an object?
      kshegunovK 1 Reply Last reply
      0
      • E elfring

        You claim to have an idea that's better than the currently available one,

        I got another software development idea which I find useful.

        put it on paper,

        I have described it in a few variants for this feature request already.

        so to speak, and we can discuss it.

        Another approach

        • Function input:
          Parameters like row and column
        • Function output:
          • Pointer ⇒ How likely is it that this function variant can be called “C++ new operator”?
          • C++ reference ⇒ Would you like to use direct access for an object?
        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #89

        @elfring said in Increasing usage for C++ new operators based on data model indexes?:

        I got another software development idea which I find useful.

        Good. Make a proof of concept for it as well. We can discuss it after that.

        I have described it in a few variants for this feature request already.

        You have not written anything tangible for us to discuss. You can describe it all night long, but at the end of the day we have to have something to base the discussion on. Some kind of proposed code that is to replace the current approach and then we can compare and argue.

        Another approach

        Finish one of the approaches before jumping into the next one.

        Read and abide by the Qt Code of Conduct

        E 1 Reply Last reply
        3
        • kshegunovK kshegunov

          @elfring said in Increasing usage for C++ new operators based on data model indexes?:

          I got another software development idea which I find useful.

          Good. Make a proof of concept for it as well. We can discuss it after that.

          I have described it in a few variants for this feature request already.

          You have not written anything tangible for us to discuss. You can describe it all night long, but at the end of the day we have to have something to base the discussion on. Some kind of proposed code that is to replace the current approach and then we can compare and argue.

          Another approach

          Finish one of the approaches before jumping into the next one.

          E Offline
          E Offline
          elfring
          wrote on last edited by
          #90

          You have not written anything tangible for us to discuss.

          Can you discuss the programming interface design for a single function in terms of concepts (without referring to source code examples)?

          kshegunovK 1 Reply Last reply
          -1
          • E elfring

            You have not written anything tangible for us to discuss.

            Can you discuss the programming interface design for a single function in terms of concepts (without referring to source code examples)?

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #91

            @elfring said in Increasing usage for C++ new operators based on data model indexes?:

            Can you discuss the programming interface design for a single function in terms of concepts (without referring to source code examples)?

            No. There's no interface design for single functions, plus if it's only one function, just write it down for us and we can take a stab at the issue.

            Read and abide by the Qt Code of Conduct

            E 1 Reply Last reply
            2
            • kshegunovK kshegunov

              @elfring said in Increasing usage for C++ new operators based on data model indexes?:

              Can you discuss the programming interface design for a single function in terms of concepts (without referring to source code examples)?

              No. There's no interface design for single functions, plus if it's only one function, just write it down for us and we can take a stab at the issue.

              E Offline
              E Offline
              elfring
              wrote on last edited by
              #92

              There's no interface design for single functions,

              I find this view questionable.

              plus if it's only one function, just write it down for us and we can take a stab at the issue.

              template<typename model_item, typename model_index> model_item * get_item_pointer(model_index mx);
              

              Can you discuss such a function template declaration better?

              kshegunovK 1 Reply Last reply
              0
              • E elfring

                There's no interface design for single functions,

                I find this view questionable.

                plus if it's only one function, just write it down for us and we can take a stab at the issue.

                template<typename model_item, typename model_index> model_item * get_item_pointer(model_index mx);
                

                Can you discuss such a function template declaration better?

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by kshegunov
                #93

                @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                I find this view questionable.

                That's your right. I will not spend any time arguing it either way.

                Can you discuss such a function template declaration better?

                That's a declaration, moreover it's a template, so this declaration doesn't mean anything to me. I have no idea what it is to be doing. Neither can I know how this model_item is to be handled inside the model, nor what model_index is, since it's a generic template type. Additionally there's no clarity of how this function is to be integrated into the QObject derived models, because there are limitations of what moc can parse.

                Give us some solutions to these problems and I'd be happy to pitch in with ideas, critiques and even work. But only if you take the time to actually prepare something that can reasonably be discussed.

                Vague notes about theoretical constructs are not acceptable.

                Read and abide by the Qt Code of Conduct

                E 1 Reply Last reply
                3
                • kshegunovK kshegunov

                  @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                  I find this view questionable.

                  That's your right. I will not spend any time arguing it either way.

                  Can you discuss such a function template declaration better?

                  That's a declaration, moreover it's a template, so this declaration doesn't mean anything to me. I have no idea what it is to be doing. Neither can I know how this model_item is to be handled inside the model, nor what model_index is, since it's a generic template type. Additionally there's no clarity of how this function is to be integrated into the QObject derived models, because there are limitations of what moc can parse.

                  Give us some solutions to these problems and I'd be happy to pitch in with ideas, critiques and even work. But only if you take the time to actually prepare something that can reasonably be discussed.

                  Vague notes about theoretical constructs are not acceptable.

                  E Offline
                  E Offline
                  elfring
                  wrote on last edited by
                  #94

                  I have no idea what it is to be doing.

                  Your understanding of this programming interface (and my API proposal) might be still incomplete at the moment.
                  But I am confident that you know already what such a function should be doing: You get a pointer for an object based on the provided input data.

                  …, since it's a generic template type.

                  Can you become used to work with templates for software development and involved concepts?

                  kshegunovK 1 Reply Last reply
                  0
                  • E elfring

                    I have no idea what it is to be doing.

                    Your understanding of this programming interface (and my API proposal) might be still incomplete at the moment.
                    But I am confident that you know already what such a function should be doing: You get a pointer for an object based on the provided input data.

                    …, since it's a generic template type.

                    Can you become used to work with templates for software development and involved concepts?

                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by
                    #95

                    @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                    Your understanding of this programming interface (and my API proposal) might be still incomplete at the moment.

                    That is for sure, as you have not proposed an API.

                    But I am confident that you know already what such a function should be doing: You get a pointer for an object based on the provided input data.

                    Humor me.

                    Can you become used to work with templates for software development and involved concepts?

                    I already am.

                    Read and abide by the Qt Code of Conduct

                    E 1 Reply Last reply
                    1
                    • kshegunovK kshegunov

                      @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                      Your understanding of this programming interface (and my API proposal) might be still incomplete at the moment.

                      That is for sure, as you have not proposed an API.

                      But I am confident that you know already what such a function should be doing: You get a pointer for an object based on the provided input data.

                      Humor me.

                      Can you become used to work with templates for software development and involved concepts?

                      I already am.

                      E Offline
                      E Offline
                      elfring
                      wrote on last edited by
                      #96

                      …, as you have not proposed an API.

                      A function template declaration can be a succinct description for an application programming interface, can't it?

                      kshegunovK 1 Reply Last reply
                      0
                      • E elfring

                        …, as you have not proposed an API.

                        A function template declaration can be a succinct description for an application programming interface, can't it?

                        kshegunovK Offline
                        kshegunovK Offline
                        kshegunov
                        Moderators
                        wrote on last edited by
                        #97

                        @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                        A function template declaration can be a succinct description for an application programming interface, can't it?

                        No, it can't. Not even by a long shot.

                        Read and abide by the Qt Code of Conduct

                        E 1 Reply Last reply
                        1
                        • kshegunovK kshegunov

                          @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                          A function template declaration can be a succinct description for an application programming interface, can't it?

                          No, it can't. Not even by a long shot.

                          E Offline
                          E Offline
                          elfring
                          wrote on last edited by
                          #98

                          No, it can't. Not even by a long shot.

                          How can your view fit to the C++ standard template library?

                          kshegunovK 1 Reply Last reply
                          0
                          • E elfring

                            No, it can't. Not even by a long shot.

                            How can your view fit to the C++ standard template library?

                            kshegunovK Offline
                            kshegunovK Offline
                            kshegunov
                            Moderators
                            wrote on last edited by
                            #99

                            @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                            How can your view fit to the C++ standard template library?

                            It fits perfectly. The STL is comprised by many, many, many functions and classes. They even have bodies too, unlike the one declaration you wrote.

                            Read and abide by the Qt Code of Conduct

                            E 1 Reply Last reply
                            1
                            • kshegunovK kshegunov

                              @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                              How can your view fit to the C++ standard template library?

                              It fits perfectly. The STL is comprised by many, many, many functions and classes. They even have bodies too, unlike the one declaration you wrote.

                              E Offline
                              E Offline
                              elfring
                              wrote on last edited by
                              #100

                              The STL is comprised by many, many, many functions and classes.

                              My proposal can eventually grow into another template library, can't it?

                              They even have bodies too, unlike the one declaration you wrote.

                              The desired implementation can evolve further if the required concepts will be generally accepted.

                              kshegunovK 1 Reply Last reply
                              0
                              • E elfring

                                The STL is comprised by many, many, many functions and classes.

                                My proposal can eventually grow into another template library, can't it?

                                They even have bodies too, unlike the one declaration you wrote.

                                The desired implementation can evolve further if the required concepts will be generally accepted.

                                kshegunovK Offline
                                kshegunovK Offline
                                kshegunov
                                Moderators
                                wrote on last edited by
                                #101

                                @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                                My proposal can eventually grow into another template library, can't it?

                                Only if you write the library, or at least the core of it.

                                The desired implementation can evolve further if the required concepts will be generally accepted.

                                The only thing that's going to be generally accepted is written code, i.e. an implementation. Since you have written none, none is going to evolve.

                                Read and abide by the Qt Code of Conduct

                                E 1 Reply Last reply
                                1
                                • kshegunovK kshegunov

                                  @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                                  My proposal can eventually grow into another template library, can't it?

                                  Only if you write the library, or at least the core of it.

                                  The desired implementation can evolve further if the required concepts will be generally accepted.

                                  The only thing that's going to be generally accepted is written code, i.e. an implementation. Since you have written none, none is going to evolve.

                                  E Offline
                                  E Offline
                                  elfring
                                  wrote on last edited by
                                  #102

                                  The only thing that's going to be generally accepted is written code, i.e. an implementation.

                                  Some software designers expect the development of specific concepts before concrete programming.
                                  Template programming can help to achieve a safer coding style.

                                  JKSHJ 1 Reply Last reply
                                  0
                                  • E elfring

                                    The only thing that's going to be generally accepted is written code, i.e. an implementation.

                                    Some software designers expect the development of specific concepts before concrete programming.
                                    Template programming can help to achieve a safer coding style.

                                    JKSHJ Offline
                                    JKSHJ Offline
                                    JKSH
                                    Moderators
                                    wrote on last edited by
                                    #103

                                    @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                                    Some software designers expect the development of specific concepts before concrete programming.

                                    @elfring, discussing "specific concepts" with you is difficult because your posts are unclear. If you write code, then your ideas will be clearer and easier to understand.

                                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                    E 1 Reply Last reply
                                    1
                                    • JKSHJ JKSH

                                      @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                                      Some software designers expect the development of specific concepts before concrete programming.

                                      @elfring, discussing "specific concepts" with you is difficult because your posts are unclear. If you write code, then your ideas will be clearer and easier to understand.

                                      E Offline
                                      E Offline
                                      elfring
                                      wrote on last edited by
                                      #104

                                      discussing "specific concepts" with you is difficult because your posts are unclear.

                                      I hope that the involved communication difficulties can be resolved after a bit more time.

                                      If you write code, then your ideas will be clearer and easier to understand.

                                      • Can your desire for “source code” distract from the really relevant functional design?
                                      • Can other information presentation variants and communication tools help more to achieve also a better common understanding?
                                      kshegunovK 1 Reply Last reply
                                      -1
                                      • E elfring

                                        discussing "specific concepts" with you is difficult because your posts are unclear.

                                        I hope that the involved communication difficulties can be resolved after a bit more time.

                                        If you write code, then your ideas will be clearer and easier to understand.

                                        • Can your desire for “source code” distract from the really relevant functional design?
                                        • Can other information presentation variants and communication tools help more to achieve also a better common understanding?
                                        kshegunovK Offline
                                        kshegunovK Offline
                                        kshegunov
                                        Moderators
                                        wrote on last edited by kshegunov
                                        #105

                                        I'll take the liberty to answer instead of @JKSH.

                                        @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                                        I hope that the involved communication difficulties can be resolved after a bit more time.

                                        Your hopes are falling short. If you don't make an effort to provide what is required for a conversation, then the conversation is nonexistent. You don't. You don't answer questions, you don't in any way try to give back what was asked for, and you randomly pick up parts of the sentences to try and extend this thread.

                                        Can your desire for “source code” distract from the really relevant functional design?

                                        It can't. Source code is the product of thought in this community. Arguing excessively and arguing against providing source code is not going to work. We want to see you're serious enough about your claim that you're willing to put an effort in defending it. Empty platitudes and (semi)random links to documentation(s) are not going to be entertained.

                                        Can other information presentation variants and communication tools help more to achieve also a better common understanding?

                                        Common understanding is a two-way street. If you're not willing to meet us halfway I see no reason any of us to want to waste our time.

                                        Read and abide by the Qt Code of Conduct

                                        E 1 Reply Last reply
                                        5
                                        • kshegunovK kshegunov

                                          I'll take the liberty to answer instead of @JKSH.

                                          @elfring said in Increasing usage for C++ new operators based on data model indexes?:

                                          I hope that the involved communication difficulties can be resolved after a bit more time.

                                          Your hopes are falling short. If you don't make an effort to provide what is required for a conversation, then the conversation is nonexistent. You don't. You don't answer questions, you don't in any way try to give back what was asked for, and you randomly pick up parts of the sentences to try and extend this thread.

                                          Can your desire for “source code” distract from the really relevant functional design?

                                          It can't. Source code is the product of thought in this community. Arguing excessively and arguing against providing source code is not going to work. We want to see you're serious enough about your claim that you're willing to put an effort in defending it. Empty platitudes and (semi)random links to documentation(s) are not going to be entertained.

                                          Can other information presentation variants and communication tools help more to achieve also a better common understanding?

                                          Common understanding is a two-way street. If you're not willing to meet us halfway I see no reason any of us to want to waste our time.

                                          E Offline
                                          E Offline
                                          elfring
                                          wrote on last edited by
                                          #106

                                          You don't answer questions,

                                          I find this information inappropriate.

                                          you don't in any way try to give back what was asked for, …

                                          I chose to respond in different ways.

                                          Arguing excessively and arguing against providing source code is not going to work.

                                          • Are there any developers around who can clarify design extensions without thinking only in source code?
                                          • Can the original development idea become more interesting?

                                          Common understanding is a two-way street.

                                          Can the clarification of design aspects from a function template declaration help here?

                                          kshegunovK 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