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

cannot add spaces to arguments of slots in slots definitions in designer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.6.2
    • Tools: Designer
    • None
    • Qt 4.6.2

    Description

      One can define slots in designer, and connect them to signals. But when defining slots one cannot add spaces to arguments, so it is impossible to e.g. have a slot
      mySlot(const QString&)
      because you cannot type space between const and QString...

      • open designer
      • add new dialog without buttons
      • in signal-slot editor dock widget: connect dialog's signal "accepted()" to dialogs slot "hide()"
      • change edit mode to "edit signal-slots" using toolbar button
      • you should see your signal-slot connection as red-frame boxes inside the dialog
      • double-click on one of the boxes in the dialog (e.g. the one which says in vertical way "hide()")
      • you see now "Configure connection" dialog where you see all signals and slots of your Dialog form
      • click on Edit
      • this opens "Signals/Slots of Dialog" window
        (Side remark: this is really terrible way of accessing this dialog; it would be great if this dialog was available in some easier way;
        I guess it's only useful for the top-level form, so maybe it could be just a button, e.g. in "Signal/Slot Editor" dock widget?)
      • now in "Signals/Slots of Dialog" window you can click on "+" below the top (slot) view -> this adds new slot with text "slot1()"
      • you can change this slot's definition to
        mySlot(QString)
        but you cannot change this slot's definition to:
        mySlot(const QString&)
        => you can type "mySlot(const" but then you cannot type space...

      You also cannot paste here expressions containing spaces (you can paste [e.g. using context menu] expressions like "mySlot(QString)" without any problems).

      BTW: if you add the slot "mySlot(QString)" and then edit .ui file in a text editor and change

       <slots>
        <slot>mySlot(QString)</slot>
       </slots>
      

      to

       <slots>
        <slot>mySlot(const QString&amp;)</slot>
       </slots>
      

      save and open the form in designer, and then go through the chore of getting to "Signals/Slots of Dialog" window and there double-click on the slot, then ... it seems that you are able to add extra spaces, but then there is no way to exit editing of slot while preserving your changes. I.e. you see:
      mySlot(const QString&)
      you can change it to, e.g.
      mySlot(const QString)
      (without &) but then if you press Enter nothing happens and if you select another slot your slot's name gets back to
      mySlot(const QString&)
      or you can change it to something like what you could have typed in without editing .ui in external editor, e.g.
      mySlot(int)
      => then either pressing Enter or selecting a different item changes definition of this slot to "mySlot(int)".

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            wiecko Marek Wieckowski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes