Results 1 to 5 of 5

Thread: QT If And Else Error

  1. #1
    Join Date
    Feb 2017
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default QT If And Else Error

    wrong.PNG
    This Return 2 (Error05) in combobox
    What Is Wrong In Code

  2. #2
    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: QT If And Else Error

    If you want to post code, post text, not an image.

    And it would be helpful to state what your actual question or problem is.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT If And Else Error

    As anda_skoa says, post code, not a picture of code.

    What Is Wrong In Code
    Nothing is wrong in the code. The variable "checksam" doesn't contain the string you are looking for, so the code does what you told it to do: it puts the string "ERR05" in the combobox.
    <=== 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.

  4. #4
    Join Date
    Feb 2017
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT If And Else Error

    OK This Is Code
    Qt Code:
    1. void MainWindow::on_pushButton_29_clicked()
    2. {
    3. foreach (const QSerialPortInfo&info, QSerialPortInfo::availablePorts()){
    4. QString checksam;
    5. checksam=info.description();
    6. if (checksam.contains("SAMSUNG MOBILE USB MODEM"))
    7. {
    8. ui.samlogs->append(info.description());
    9. }
    10. else
    11. {
    12. ui.samlogs->append("NO SAMSUNG MOBILE FOUND PLEASE CONECT YOUR PHONE");
    13. }
    14. {
    15. }
    16. }
    17. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 5th March 2017 at 09:27. Reason: missing [code] tags

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT If And Else Error

    And so what exactly is your problem? If you have a question, ask it, just don't post code and say nothing about it.
    <=== 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.

Similar Threads

  1. Replies: 3
    Last Post: 19th November 2014, 19:44
  2. Replies: 4
    Last Post: 29th April 2014, 16:20
  3. : error: [\NokiaQtSDK\Symbian\SDK\epoc32\release\gcce\udeb\V ideo.exe] Error 1
    By ranjit.kadam in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 1st May 2011, 22:11
  4. Replies: 3
    Last Post: 23rd January 2011, 12:15
  5. fatal error C1001: An internal error has occurred in the compiler
    By noodles in forum Installation and Deployment
    Replies: 0
    Last Post: 12th August 2010, 11: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.