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?

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.4k 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.
  • K kshegunov
    26 Oct 2018, 19:12

    @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 26 Oct 2018, 19:17 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?

    K 1 Reply Last reply 26 Oct 2018, 19:18
    0
    • E elfring
      26 Oct 2018, 19:17

      …, as you have not proposed an API.

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

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 26 Oct 2018, 19:18 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 26 Oct 2018, 19:21
      1
      • K kshegunov
        26 Oct 2018, 19:18

        @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 26 Oct 2018, 19:21 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?

        K 1 Reply Last reply 26 Oct 2018, 19:23
        0
        • E elfring
          26 Oct 2018, 19:21

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

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

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 26 Oct 2018, 19:23 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 26 Oct 2018, 19:36
          1
          • K kshegunov
            26 Oct 2018, 19:23

            @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 26 Oct 2018, 19:36 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.

            K 1 Reply Last reply 26 Oct 2018, 19:42
            0
            • E elfring
              26 Oct 2018, 19:36

              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.

              K Offline
              K Offline
              kshegunov
              Moderators
              wrote on 26 Oct 2018, 19:42 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 26 Oct 2018, 19:47
              1
              • K kshegunov
                26 Oct 2018, 19:42

                @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 26 Oct 2018, 19:47 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.

                J 1 Reply Last reply 26 Oct 2018, 22:02
                0
                • E elfring
                  26 Oct 2018, 19:47

                  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.

                  J Offline
                  J Offline
                  JKSH
                  Moderators
                  wrote on 26 Oct 2018, 22:02 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 27 Oct 2018, 08:24
                  1
                  • J JKSH
                    26 Oct 2018, 22:02

                    @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 27 Oct 2018, 08:24 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?
                    K 1 Reply Last reply 27 Oct 2018, 09:50
                    -1
                    • E elfring
                      27 Oct 2018, 08:24

                      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?
                      K Offline
                      K Offline
                      kshegunov
                      Moderators
                      wrote on 27 Oct 2018, 09:50 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 27 Oct 2018, 17:22
                      5
                      • K kshegunov
                        27 Oct 2018, 09:50

                        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 27 Oct 2018, 17:22 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?

                        K 1 Reply Last reply 27 Oct 2018, 17:33
                        0
                        • E elfring
                          27 Oct 2018, 17:22

                          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?

                          K Offline
                          K Offline
                          kshegunov
                          Moderators
                          wrote on 27 Oct 2018, 17:33 last edited by
                          #107

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

                          I find this information inappropriate.

                          Yeah, me too.

                          I chose to respond in different ways.

                          Yeah, me too.

                          • Are there any developers around who can clarify design extensions without thinking only in source code?

                          We don't think only in source code, but we find it as a useful way to clarify what we mean. Are you able to clarify your design extensions through source code?

                          • Can the original development idea become more interesting?

                          Not unless you make it more interesting by including some source that we can discuss.

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

                          Nope, but a class with its function bodies would help.

                          Read and abide by the Qt Code of Conduct

                          E 1 Reply Last reply 27 Oct 2018, 17:44
                          1
                          • K kshegunov
                            27 Oct 2018, 17:33

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

                            I find this information inappropriate.

                            Yeah, me too.

                            I chose to respond in different ways.

                            Yeah, me too.

                            • Are there any developers around who can clarify design extensions without thinking only in source code?

                            We don't think only in source code, but we find it as a useful way to clarify what we mean. Are you able to clarify your design extensions through source code?

                            • Can the original development idea become more interesting?

                            Not unless you make it more interesting by including some source that we can discuss.

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

                            Nope, but a class with its function bodies would help.

                            E Offline
                            E Offline
                            elfring
                            wrote on 27 Oct 2018, 17:44 last edited by
                            #108

                            Are you able to clarify your design extensions through source code?

                            My published software development activities demonstrate that such contributions can happen.

                            Not unless you make it more interesting by including some source that we can discuss.

                            How will your interests evolve for application programming interfaces expressed in the format of function template declarations?

                            Nope, but a class with its function bodies would help.

                            Can it occasionally be more helpful to clarify software design properties before attempting a specific implementation?

                            K 1 Reply Last reply 27 Oct 2018, 17:55
                            0
                            • E elfring
                              27 Oct 2018, 17:44

                              Are you able to clarify your design extensions through source code?

                              My published software development activities demonstrate that such contributions can happen.

                              Not unless you make it more interesting by including some source that we can discuss.

                              How will your interests evolve for application programming interfaces expressed in the format of function template declarations?

                              Nope, but a class with its function bodies would help.

                              Can it occasionally be more helpful to clarify software design properties before attempting a specific implementation?

                              K Offline
                              K Offline
                              kshegunov
                              Moderators
                              wrote on 27 Oct 2018, 17:55 last edited by
                              #109

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

                              My published software development activities demonstrate that such contributions can happen.

                              Not from what I was able to see.

                              How will your interests evolve for application programming interfaces expressed in the format of function template declarations?

                              They will not. My interests have evolved already and in their current state of evolution they require hard facts, evidence if you will.

                              Can it occasionally be more helpful to clarify software design properties before attempting a specific implementation?

                              Occasionally it can, but not in this case.

                              Read and abide by the Qt Code of Conduct

                              E 1 Reply Last reply 27 Oct 2018, 18:07
                              0
                              • K kshegunov
                                27 Oct 2018, 17:55

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

                                My published software development activities demonstrate that such contributions can happen.

                                Not from what I was able to see.

                                How will your interests evolve for application programming interfaces expressed in the format of function template declarations?

                                They will not. My interests have evolved already and in their current state of evolution they require hard facts, evidence if you will.

                                Can it occasionally be more helpful to clarify software design properties before attempting a specific implementation?

                                Occasionally it can, but not in this case.

                                E Offline
                                E Offline
                                elfring
                                wrote on 27 Oct 2018, 18:07 last edited by elfring
                                #110

                                They will not.

                                Can this kind of feedback express another kind of change resistance?

                                Occasionally it can,

                                It is nice that you can follow this view to some degree.

                                but not in this case.

                                I prefer a stricter separation between a software design draft and a possible prototype implementation here.

                                K 1 Reply Last reply 27 Oct 2018, 19:42
                                0
                                • E elfring
                                  27 Oct 2018, 18:07

                                  They will not.

                                  Can this kind of feedback express another kind of change resistance?

                                  Occasionally it can,

                                  It is nice that you can follow this view to some degree.

                                  but not in this case.

                                  I prefer a stricter separation between a software design draft and a possible prototype implementation here.

                                  K Offline
                                  K Offline
                                  kshegunov
                                  Moderators
                                  wrote on 27 Oct 2018, 19:42 last edited by
                                  #111

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

                                  Can this kind of feedback express another kind of change resistance?

                                  I don't resist change. You have not proposed a change but a hypothesis, it's yet to be proven if it can be made into a change.

                                  I prefer a stricter separation between a software design draft and a possible prototype implementation here.

                                  That's your prerogative, just don't expect people to write the code for you.

                                  Read and abide by the Qt Code of Conduct

                                  1 Reply Last reply
                                  1
                                  • VRoninV Offline
                                    VRoninV Offline
                                    VRonin
                                    wrote on 29 Oct 2018, 09:03 last edited by
                                    #112

                                    Since we didn't make it explicit so far: we think your idea is really, really, bad. We tried to explain you why it's bad but you either decided to ignore us or just don't understand models enough to see the faults.

                                    Proposing useful extensions is one thing, making us waste time discussing changes that are so bad they would get shot out in the first code review stage is another

                                    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                                    ~Napoleon Bonaparte

                                    On a crusade to banish setIndexWidget() from the holy land of Qt

                                    E 1 Reply Last reply 29 Oct 2018, 10:18
                                    2
                                    • VRoninV VRonin
                                      29 Oct 2018, 09:03

                                      Since we didn't make it explicit so far: we think your idea is really, really, bad. We tried to explain you why it's bad but you either decided to ignore us or just don't understand models enough to see the faults.

                                      Proposing useful extensions is one thing, making us waste time discussing changes that are so bad they would get shot out in the first code review stage is another

                                      E Offline
                                      E Offline
                                      elfring
                                      wrote on 29 Oct 2018, 10:18 last edited by
                                      #113

                                      we think your idea is really, really, bad.

                                      So it seems that we stumble on a conflict because of varying imaginations for further software evolution.
                                      Our ways of thinking about software design aspects are generally different.

                                      I am curious if any other Qt user or contributor would like to adjust the mentioned design details any more.

                                      1 Reply Last reply
                                      0
                                      • VRoninV Offline
                                        VRoninV Offline
                                        VRonin
                                        wrote on 29 Oct 2018, 10:23 last edited by
                                        #114

                                        Ok, let's start a vote.

                                        Anybody here thinks the design "proposed" above has any reason to exist?

                                        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                                        ~Napoleon Bonaparte

                                        On a crusade to banish setIndexWidget() from the holy land of Qt

                                        K 1 Reply Last reply 29 Oct 2018, 11:48
                                        0
                                        • VRoninV VRonin
                                          29 Oct 2018, 10:23

                                          Ok, let's start a vote.

                                          Anybody here thinks the design "proposed" above has any reason to exist?

                                          K Offline
                                          K Offline
                                          kshegunov
                                          Moderators
                                          wrote on 29 Oct 2018, 11:48 last edited by kshegunov
                                          #115

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

                                          Ok, let's start a vote.

                                          Fine, I'll bite.

                                          Anybody here thinks the design "proposed" above has any reason to exist?

                                          No due to the "design" not having addressed all any of the issues raised in this thread. Being incomplete and practically inapplicable, which is my beef with it, makes the proposition more of a theoretical hypothesizing than a design proposition. Here's what is to be done, so to have it considered as a proposition for a change:

                                          1. Motivation:
                                            • There's no clear distinction why this change is needed. The QModelIndex class is already very light and can be passed around by value extremely cheaply. Why would introducing a heap manager be better.
                                          2. Structure & design
                                            • There's no clear way to tell how the memory management is to be done - the placement new requires a memory block to begin with. What class and how is going to manage the memory blocks throughout the application and how?
                                            • There's no clarity how the interface between Qt code and user code is going to work.
                                              • Templates with QObjects is not an option, and deriving from QObject is necessary to have signal-slots.
                                              • Templates with models means making promises about binary and source compatibility hell. The API would define the private internals of the class and once set there's no going back to fix it for a period of a major version turnaround. (Notable warnings in the documentation that the containers should not be subclassed!)
                                              • Even if we assume the above is solved instantiation of the models will make binaries extremely fat.
                                              • Templates are distinct types, so QAbstractItemModel<MyType> is different from QAbstractItemModel<YourType>. Only way to solve is to have an interface (purely abstract class) that is to be referred in the user code. Possible, but hardly worth it; the vtables are going to get enormous.
                                              • Above statement also implies that the views have to be templated, as they have no notion of the user type until an instantiation of the model happens, which is in the user code. Practicality goes out the window.
                                          3. Implementation
                                            • No implementation provided.
                                            • The sheer amount of changes needed means that basically half the Qt toolkit needs to be reimplemented.

                                          Read and abide by the Qt Code of Conduct

                                          1 Reply Last reply
                                          6

                                          105/116

                                          27 Oct 2018, 09:50

                                          • Login

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