×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Nokia Developer Expert
    Join Date
    Jun 2009
    Posts
    36

    Question QMaemo5ValueButton/picker signals - unexpected bahaviour?

    Hi,

    Using Qt creator from SDK RC.

    I have a QMaemo5ValueButton * widget, say buttonCrop that presents a list via a QMaemo5ListPickSelector * called selectorCrop.

    When an item on the selector list is chosen I want another widgets value to change using a signal.

    I've tried using QMaemo5ValueButton clicked() signal but this seems be be sent as the button is clicked not as the selection is made. I would have expected the clicked() event (or released which behaves the same way) to happen once the pick selection had been made.

    I've tried using the click event of buttonCrop->selectorCrop->selected(QString) but the connect fails on execution.

    Both these fail on execution with no signal found

    connect( selectorCrop, SIGNAL(selectorCrop->selected(dummy)),this, SLOT(on_SelectorCropFactor_selected()));

    connect ( buttonCrop, SIGNAL(buttonCrop->pickSelector()->selected(QString)), this, SLOT(on_SelectorCropFactor_selected()));

    Any advice welcome.
    BR David

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QMaemo5ValueButton/picker signals - unexpected bahaviour?

    Quote Originally Posted by davidmct View Post
    I've tried using QMaemo5ValueButton clicked() signal but this seems be be sent as the button is clicked not as the selection is made. I would have expected the clicked() event (or released which behaves the same way) to happen once the pick selection had been made.
    Why do you have such expectation as clicked() is implemented in QAbstractButton?

    Quote Originally Posted by davidmct View Post
    Both these fail on execution with no signal found

    connect( selectorCrop, SIGNAL(selectorCrop->selected(dummy)),this, SLOT(on_SelectorCropFactor_selected()));

    connect ( buttonCrop, SIGNAL(buttonCrop->pickSelector()->selected(QString)), this, SLOT(on_SelectorCropFactor_selected()));
    I would be surprised, if this worked. Please, read documentation how do you properly connect signals and slots
    http://doc.trolltech.com/4.6/signalsandslots.html

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2009
    Posts
    36

    Re: QMaemo5ValueButton/picker signals - unexpected bahaviour?

    Hi,

    I've read through all the documentation I could find and also tried various versions. The QMaemo5AbstractPickSelector Class has a signal selected (QString &) which I would like to use to trigger a field update. No matter what form of reference I use a run time error similar to the line below is always output:

    Object::connect: No such signal QMaemo5ListPickSelector::this->selectorCrop->selected(QSTRING &) in ..

    Maybe I should ask a better framed and more accurate question. How can I emit a signal when a QMaemo5ValueButton pickSelector list item is selected?

    The usage is to update a manual entry field to reflect the users choice but still provide the ability to enter a new value if the pickselector list does not provide enough choice for a numeric value. There are a defined set of standard values that can be choosen from but in exceptional circumstances variance needs to be allowed.

    Many thanks

    David

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QMaemo5ValueButton/picker signals - unexpected bahaviour?

    http://doc.qt.nokia.com/4.6/qobject.html#connect
    Second and forth parameters are simply strings, representing signal and slot signatures.
    Code:
    connect(selectorCrop, SIGNAL(selected(QString &)),
            this, SLOT(on_SelectorCropFactor_selected()));
    connect(buttonCrop->pickSelector(), SIGNAL(selected(QString &)),
            this, SLOT(on_SelectorCropFactor_selected()));

  5. #5
    Nokia Developer Expert
    Join Date
    Jun 2009
    Posts
    36

    Re: QMaemo5ValueButton/picker signals - unexpected bahaviour?

    Hi Daniil,

    I've tried these signatures but always get a run time error. I've also tried to work out what is happening from the moc file but no joy. Are my options reimplementing the pickselector class and defining a signal with the behaviour I want or just redesign this part of the UI without using the QMaemoValueButtom picker?

    Other suggestions on how to get a signal when the pickselector value is selected would be very much appreciated.

    BR David

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QMaemo5ValueButton/picker signals - unexpected bahaviour?

    Signature has constant parameter
    Code:
    connect(selectorCrop, SIGNAL(selected(const QString &)),
            this, SLOT(on_SelectorCropFactor_selected()));
    connect(buttonCrop->pickSelector(), SIGNAL(selected(const QString &)),
            this, SLOT(on_SelectorCropFactor_selected()));

  7. #7
    Nokia Developer Expert
    Join Date
    Jun 2009
    Posts
    36

    Re: QMaemo5ValueButton/picker signals - unexpected bahaviour?

    Perfect! Thanks Daniil.

Similar Threads

  1. how to add QMaemo5ValueButton to an QAction?
    By fily_love in forum Nokia N9
    Replies: 1
    Last Post: 2010-03-22, 07:57
  2. catching signals
    By juannoguera in forum Symbian
    Replies: 5
    Last Post: 2009-10-15, 12:23
  3. Canvas based calendar/date picker
    By barrueco in forum Symbian
    Replies: 6
    Last Post: 2009-07-29, 19:05
  4. DateTime Picker in MIDP
    By bapithanc in forum Mobile Java General
    Replies: 2
    Last Post: 2008-08-09, 05:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×