Results 1 to 3 of 3

Thread: Problem with a combobox

  1. #1
    Join Date
    Jul 2006
    Posts
    7
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Problem with a combobox

    Hi,
    I'm quite e newbie in QT, that's why I need your help for a combobox.
    I wrote this piece of code :
    line_Width_Box=new QComboBox(butoni);
    widths << "0.10" << "0.15" << "0.20" << "0.25" << "0.30" << "0.35" << "0.40" << "0.45" << "0.50"
    << "0.75" << "1.00" << "1.25" << "1.50" << "1.75" << "2.0";
    line_Width_Box->addItems(widths);
    connect(line_Width_Box, SIGNAL(highlighted(index)), this, SLOT(setLineWidth(index)));
    butoni->addWidget(lineLabel);
    butoni->addWidget(line_Width_Box);

    It compiles with no problem, but on runtime I get the message :
    Object::connect: No such signal QComboBox::highlighted(index)

    setLineWidth(index) is supposed to just change the text of a label, that's why I don't post it here.
    And the idea of this combo box is to present the user a list of line widths to be used when drawing primitives.
    Any help will be greatly appreciated

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Problem with a combobox

    It should be:
    Qt Code:
    1. connect(line_Width_Box, SIGNAL(highlighted(int)), this, SLOT(setLineWidth(int)));
    To copy to clipboard, switch view to plain text mode 
    The signal and slot parameters must not contain any variable names, only the type, in the connect statement.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    Tindor (22nd November 2006)

  4. #3
    Join Date
    Jul 2006
    Posts
    7
    Thanks
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Problem with a combobox

    Thank you very much !

Similar Threads

  1. Combobox Signals
    By b1 in forum Qt Programming
    Replies: 3
    Last Post: 1st August 2006, 10:21
  2. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  3. Filling combobox from database
    By Philip_Anselmo in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2006, 17:53
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.