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. [Moved] Extending the Shape-Changing Dialog
Forum Updated to NodeBB v4.3 + New Features

[Moved] Extending the Shape-Changing Dialog

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.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.
  • D Offline
    D Offline
    dodomac
    wrote on last edited by
    #1

    Hi,

    I am a newbie to Qt and I'm trying to extend the Shape-Changing Dialog (Chapter 2, fig 2.11, Blanchette & Summerfield) example as suggested at the end of the section by calling setText() but have encountered some problems.

    Following the example this is what I did in addition:

    1. Called 'moreButton->setText(tr("Advanced"));' in the constructor. The button changes text from 'More' to 'Advanced' as expected.

    2. Created the SLOT 'void Sort::on_moreButton_toggled(bool toggled)' thinking that if I test the bool within the method I can change the text accordingly.

    However the SLOT never gets called! I have tried SLOTS 'void Sort::on_moreButton_toggled()' and 'void Sort::on_moreButton_clicked()' but neither are invoked!

    I didn't specify the connect() call for these expecting them to be automatically setup. However, I added them to see if this was the problem but got the same results, i.e. the SLOTs are not invoked.

    I even tried breaking the connection in QtDesigner between the moreButton and secondary & tertiary SLOTs setVisible(bool) and manually setting them, but to no avail.

    I have looked at the example "Expandable dialog example":http://doc.trolltech.com/4.7/dialogs-extension.html but this is not what I want as I want Qt to automatically set this up.

    Can someone suggest how to get this working and what I am doing wrong? Also, what is the term used to described the automatic creation and setup of signals to slots?

    Thanks.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dodomac
      wrote on last edited by
      #2

      "I even tried breaking the connection in QtDesigner between the moreButton and secondary & tertiary SLOTs setVisible(bool) and manually setting them, but to no avail."

      Just to make it clear. I had done the following that works:

      @
      connect(moreButton, SIGNAL(toggled(bool)), secondaryGroupBox, SLOT(setVisible(bool)));
      @

      But the automatic connections still didn't work! I.e. 'on_moreButton_toggled(bool toggled)'.

      [EDIT: code formatting, please use @-tags, Volker]

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vcsala
        wrote on last edited by
        #3

        Have you connected in the Qt Designer your new slot with the button clicked signal (as it is described for the in the same chapter in the book you mentioned)?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dodomac
          wrote on last edited by
          #4

          Yes and they all work as the example describes.
          I simply want to extend the More button to be renamed to Advanced, and each time it is pressed have the 'on_moreButton_toggled(bool toggled)’ SLOT invoked.

          I define it but do not connect it as this should be done automatically. It is never called! Even if I do manually connect it, it still isn't called!

          Maybe you could try the example and see if you can get it to work :) I am not sure what I'm doing wrong.

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hanooz
            wrote on last edited by
            #5

            yeah i had the same problem but realized that i should have removed the
            private var ui for the program to run

            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