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. Autocomplete
Forum Updated to NodeBB v4.3 + New Features

Autocomplete

Scheduled Pinned Locked Moved Solved General and Desktop
30 Posts 4 Posters 10.2k 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.
  • mrjjM mrjj

    @JonB
    There is no picture of poster's idea of auto filled parameters.
    So either poster want something that is impossible or
    something i dont understand/have seen.

    like ". It doesn't autocomplete like "connect" for instance."

    i cant connect to auto complete in any way.

    J.HilkJ Offline
    J.HilkJ Offline
    J.Hilk
    Moderators
    wrote on last edited by
    #15

    @mrjj
    QObject::connect has indeed an autocomplete function

    Right after the class Reference (Qt5 Syntax) MyClass:: and right after the signal or slot macro(Qt4 Syntax)

    QT4Syntax actually fills in the argument Types


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    mrjjM 1 Reply Last reply
    0
    • J.HilkJ J.Hilk

      @mrjj
      QObject::connect has indeed an autocomplete function

      Right after the class Reference (Qt5 Syntax) MyClass:: and right after the signal or slot macro(Qt4 Syntax)

      QT4Syntax actually fills in the argument Types

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #16

      @J.Hilk
      ah, in that way. well i didnt think of it as parameters filling. just suggestion for context as it can do anywhere.
      Ok, that concludes the post :)
      Not possible.

      1 Reply Last reply
      0
      • JonBJ JonB

        @mrjj
        Like I said, that's because the parameters are not supposed to be "auto-completable", they are there only as a "tooltip" to help you understand the types/overloads available, not as a "picker"/"paster"!

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #17

        @JonB
        Hi, Yes im fully aware of that but poster had completion working (he said)
        Just trying to determine what poster saw.
        And i fully agree, auto filling of parameters sounded really fishy :)

        ? 1 Reply Last reply
        0
        • mrjjM mrjj

          @JonB
          Hi, Yes im fully aware of that but poster had completion working (he said)
          Just trying to determine what poster saw.
          And i fully agree, auto filling of parameters sounded really fishy :)

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by A Former User
          #18

          @mrjj Crikey.

          I want to type for instance ProgressBar::paintEvent(QPaintEvent *event)

          I type Prog autocomplete pops up, I hit return yay ProgressBar

          Then I type :: and autocomplete kicks in again, I make my selection and hit return Now I have
          ProgressBar::paintEvent. and the Parameter List is offered in a little floating box. and ctrl+spacebar inserts it.

          Now I have ProgressBar::paintEvent(QPaintEvent *event)

          Didn't mean to start a fire or anything!

          mrjjM 1 Reply Last reply
          0
          • ? A Former User

            @mrjj Crikey.

            I want to type for instance ProgressBar::paintEvent(QPaintEvent *event)

            I type Prog autocomplete pops up, I hit return yay ProgressBar

            Then I type :: and autocomplete kicks in again, I make my selection and hit return Now I have
            ProgressBar::paintEvent. and the Parameter List is offered in a little floating box. and ctrl+spacebar inserts it.

            Now I have ProgressBar::paintEvent(QPaintEvent *event)

            Didn't mean to start a fire or anything!

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #19

            @Ian-Bray
            Oh, no fires here. Just a bit confusion :)
            Now i understand.
            There you select a member and yes then it inserts the complete signature ( meaning with the parameters)
            as it can see how it should be from the .h file.

            How ever when shows
            alt text
            It shows possible parameters and u must type variable names as its a function call

            As far as i know, there is no key to have it paste the signature in such cases. :(
            But you can press F2 on the method name to go there and then copy the signature.

            ? 1 Reply Last reply
            0
            • mrjjM mrjj

              @Ian-Bray
              Oh, no fires here. Just a bit confusion :)
              Now i understand.
              There you select a member and yes then it inserts the complete signature ( meaning with the parameters)
              as it can see how it should be from the .h file.

              How ever when shows
              alt text
              It shows possible parameters and u must type variable names as its a function call

              As far as i know, there is no key to have it paste the signature in such cases. :(
              But you can press F2 on the method name to go there and then copy the signature.

              ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #20

              @mrjj

              If I type QColor and then a semi-colon "("

              I get a menu popup with 11 options. Using the up/down keys I scroll to number 3 and hit return to insert, but the carriage returns and ctrl + spacebar just resets it to the first option.

              mrjjM 1 Reply Last reply
              0
              • ? A Former User

                @mrjj

                If I type QColor and then a semi-colon "("

                I get a menu popup with 11 options. Using the up/down keys I scroll to number 3 and hit return to insert, but the carriage returns and ctrl + spacebar just resets it to the first option.

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #21

                @Ian-Bray
                Hmm, you should get what u select in drop-down. sounds odd.
                Like this ?
                alt text

                ? 1 Reply Last reply
                0
                • mrjjM mrjj

                  @Ian-Bray
                  Hmm, you should get what u select in drop-down. sounds odd.
                  Like this ?
                  alt text

                  ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #22

                  @mrjj No QColor(

                  mrjjM 1 Reply Last reply
                  0
                  • ? A Former User

                    @mrjj No QColor(

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #23

                    @Ian-Bray
                    Like
                    alt text

                    You cannot make it paste that into editor. (in this case, QRgb64 rgba64)

                    ? 1 Reply Last reply
                    0
                    • mrjjM mrjj

                      @Ian-Bray
                      Like
                      alt text

                      You cannot make it paste that into editor. (in this case, QRgb64 rgba64)

                      ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by A Former User
                      #24

                      @mrjj Yes. I know. I was wondering if there was an exotic keystroke to insert it. See my first post!!
                      Tell them to fix it so it does insert! :-) I hold Q_PROPERTY up as an example.

                      Especially connect()

                      mrjjM 1 Reply Last reply
                      0
                      • ? A Former User

                        @mrjj Yes. I know. I was wondering if there was an exotic keystroke to insert it. See my first post!!
                        Tell them to fix it so it does insert! :-) I hold Q_PROPERTY up as an example.

                        Especially connect()

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by mrjj
                        #25

                        @Ian-Bray
                        Hi
                        You are the first ever to ask for that.
                        Can i ask why you want that text since it just lists possible parameters?
                        You would have to replace it with a variable anyways ?

                        For connect you want it to paste something lie
                        alt text
                        ?

                        Would be like
                        connect( const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,Qt::ConnectionType type = Qt::AutoConnection)
                        Im not sure i understand why :)

                        ? 1 Reply Last reply
                        0
                        • mrjjM mrjj

                          @Ian-Bray
                          Hi
                          You are the first ever to ask for that.
                          Can i ask why you want that text since it just lists possible parameters?
                          You would have to replace it with a variable anyways ?

                          For connect you want it to paste something lie
                          alt text
                          ?

                          Would be like
                          connect( const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,Qt::ConnectionType type = Qt::AutoConnection)
                          Im not sure i understand why :)

                          ? Offline
                          ? Offline
                          A Former User
                          wrote on last edited by
                          #26

                          @mrjj What I would do is insert it, and comment it out, and use it as a guide for my own connect or if it was close I'd just edit the necessary bits.

                          mrjjM 1 Reply Last reply
                          0
                          • ? A Former User

                            @mrjj What I would do is insert it, and comment it out, and use it as a guide for my own connect or if it was close I'd just edit the necessary bits.

                            mrjjM Offline
                            mrjjM Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on last edited by
                            #27

                            @Ian-Bray
                            ok, i see :)
                            You can open a request on https://bugreports.qt.io/
                            and if enough people vote for it, they might create such feature.

                            In the mean time, you can
                            ctrl+alt+left click the connect and
                            it opens a split view where you can copy from.

                            ? 1 Reply Last reply
                            1
                            • mrjjM mrjj

                              @Ian-Bray
                              ok, i see :)
                              You can open a request on https://bugreports.qt.io/
                              and if enough people vote for it, they might create such feature.

                              In the mean time, you can
                              ctrl+alt+left click the connect and
                              it opens a split view where you can copy from.

                              ? Offline
                              ? Offline
                              A Former User
                              wrote on last edited by
                              #28

                              @mrjj No, I wouldn't consider it a bug as such. It would be a convenience, that's all. I'm still learning Qt and I'm amazed by the hidden stuff. Click inside a class definition say - class myclass : public qobject {} and hit ctrl+spacebar and it throws up all the functions from the inherited class, I only found that recently. Or type "class" and hit ctrl+spacebar gives you a menu, which autocompletes a class from QObject or QWidget.

                              If all things were treated equally.

                              mrjjM JonBJ 2 Replies Last reply
                              1
                              • ? A Former User

                                @mrjj No, I wouldn't consider it a bug as such. It would be a convenience, that's all. I'm still learning Qt and I'm amazed by the hidden stuff. Click inside a class definition say - class myclass : public qobject {} and hit ctrl+spacebar and it throws up all the functions from the inherited class, I only found that recently. Or type "class" and hit ctrl+spacebar gives you a menu, which autocompletes a class from QObject or QWidget.

                                If all things were treated equally.

                                mrjjM Offline
                                mrjjM Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on last edited by mrjj
                                #29

                                @Ian-Bray
                                Oh, not. its not that way. One can also report feature wishes there.
                                Its perfectly normal.

                                There are many hidden features. Tons in right click and Refactor menu. depends on where u stand.
                                If it shows a little yellow lamp when you change parameters, press alt + enter to apply same change to the .h file ( or cpp if in .h)

                                1 Reply Last reply
                                2
                                • ? A Former User

                                  @mrjj No, I wouldn't consider it a bug as such. It would be a convenience, that's all. I'm still learning Qt and I'm amazed by the hidden stuff. Click inside a class definition say - class myclass : public qobject {} and hit ctrl+spacebar and it throws up all the functions from the inherited class, I only found that recently. Or type "class" and hit ctrl+spacebar gives you a menu, which autocompletes a class from QObject or QWidget.

                                  If all things were treated equally.

                                  JonBJ Online
                                  JonBJ Online
                                  JonB
                                  wrote on last edited by JonB
                                  #30

                                  @Ian-Bray

                                  If all things were treated equally.

                                  All same things are treated equally, but different things are not treated as same.

                                  I tried to explain above that, say in the case of the completion offered for a call to a function, completion is for (what are called) "actual" parameters but not for "formal" parameters (you might like to look these words up to understand the difference).

                                  Note that in all the examples you give of where completion is offered, if you select one of the offerings what you end up with is syntactically correct. OTOH, if it did what you are asking for what you end up with would be syntactically incorrect (because you'd have pasted a formal parameter list where an actual parameter list is required). If you try typing in one of the completions you'd like to be selectable, you'll see you get loads of squigglies for incorrect syntax.

                                  You're asking for apples and oranges to be treated "equally", and all fruits are not equal :)

                                  For the record, MS Visual Studio, for example, does the same "tooltip-but-not-select-paste" principle in the same situation, so the Qt Creator IDE is not unusual in this respect.

                                  1 Reply Last reply
                                  1

                                  • Login

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