Results 1 to 10 of 10

Thread: Connect lambda, sender argument must be string from array

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,233
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Connect lambda, sender argument must be string from array

    Maybe something like:

    Qt Code:
    1. for ( int i = 0; i < pagecounter; i++ )
    2. {
    3. // initialize btnTest[i]
    4. }
    To copy to clipboard, switch view to plain text mode 

    You should have learned that in the first couple of weeks of your C++ class...
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2
    Join Date
    Aug 2016
    Posts
    36
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Connect lambda, sender argument must be string from array

    What I really want to do is disable the btnTest buttons when they are clicked a couple of times. But after invoking
    Qt Code:
    1. void MyWidget::onaddbutton_clicked()
    2. {
    To copy to clipboard, switch view to plain text mode 
    a second time, and then clicking on the old btnTest button of the first time, they do not get disabled. Any ideas of how to do this?

    The disabling methods are placed here:
    Qt Code:
    1. void MyWidget::systembutton_clicked(int j, int k, QVBoxLayout *vbox)
    2. {
    3. ...
    4. if(...){
    5. btnTest[j].setEnabled(false);
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Aug 2016
    Posts
    36
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Connect lambda, sender argument must be string from array

    According to the btnTest2[i].isEnabled() function the button is disabled, but in the program the btnTest2[i] remains clickable.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Connect lambda, sender argument must be string from array

    You onaddbutton_clicked() creates a new array of buttons every time, maybe you disabled only one of these sets.

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 25th August 2016, 16:24
  2. Replies: 6
    Last Post: 12th February 2012, 04:52
  3. Cast QString array to std::string array
    By Ishtar in forum Newbie
    Replies: 4
    Last Post: 15th July 2011, 08:28
  4. Replies: 1
    Last Post: 12th January 2009, 18:05
  5. QtScript : passing array as argument into function
    By derek_r in forum Qt Programming
    Replies: 4
    Last Post: 27th October 2007, 10:46

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.