Results 1 to 2 of 2

Thread: Changing text label depending on combobox selection

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2012
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Changing text label depending on combobox selection

    Hi,
    I have a problem that is probably very simple, but I don't know how to do it.
    I have a basic contacts book where essentially there is a combo box that you can use to scroll through names and once a name is selected it should change a text box with the persons phone number. The problem it all seems to work exept the query of the phone number.

    QString *phone = ui->cmbMembers->currentText();
    phone = "SELECT phone FROM contacts WHERE name = " + phone + ";";

    QSqlQuery queryNumbers(phone);
    ui->lblPhone->clear();
    ui->lblPhone->setText(phone);

    Thanks
    Attached Files Attached Files

Similar Threads

  1. Depending Combobox
    By cia.michele in forum Qt Programming
    Replies: 1
    Last Post: 10th January 2012, 17:11
  2. Replies: 0
    Last Post: 23rd February 2011, 00:07
  3. Changing color of combobox placed in toolbar?
    By Jennie Bystrom in forum Qt Programming
    Replies: 0
    Last Post: 7th May 2010, 08:08
  4. changing QPushButton label
    By Ferric in forum Newbie
    Replies: 3
    Last Post: 31st January 2010, 09:57
  5. label Text is not changing using Qt Linguist
    By thomasjoy in forum Qt Tools
    Replies: 59
    Last Post: 8th October 2007, 15:24

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
  •  
Qt is a trademark of The Qt Company.