Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QtCreator - create only getter or only setter

    Tools
    qtcreator getter setter field
    3
    5
    1763
    Loading More Posts
    • 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.
    • morsisko
      morsisko last edited by

      Hi,
      Is there a way to create only a getter/setter of field? I know that there is a option to create getter&setter, but I don't see something that would let me create ONLY getter or only setter.
      Thanks for answer.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        Do you mean that for Qt's property system ?

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

        morsisko 1 Reply Last reply Reply Quote 0
        • morsisko
          morsisko @SGaist last edited by

          @SGaist I mean something like when you click on class field you have a menu called "Refactor", and after "Create getter and setter member function", but it crates getter and setter, when i want create only getter. Yes i can delete the setter from .h and .cpp file but it takes too much time when you have to create about 200 getters. :(

          kshegunov 1 Reply Last reply Reply Quote 0
          • kshegunov
            kshegunov Moderators @morsisko last edited by

            @morsisko
            I have that in the context menu. Maybe you're using an older version of QtCreator (I have 3.6.0 here)?

            Context menu

            Kind regards.

            Read and abide by the Qt Code of Conduct

            morsisko 1 Reply Last reply Reply Quote 0
            • morsisko
              morsisko @kshegunov last edited by

              @kshegunov Many thanks, i had the eariler version of qtCreator.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post