Results 1 to 10 of 10

Thread: A few questoins about Qt

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Guangzhou,China
    Posts
    89
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    17

    Default A few questoins about Qt

    1 By default, that's not a minimize button in the Qt widget in windows, but a help ("?" symbol) button. If I want to add a minimize button for a dialog at the same remove the help symbol. What I should do.

    2 Why I write a file in the patten in a console window:
    QFile file("C:\abc\test.txt");
    it doesn,t work. But it work in this way : QFile file("C:\\abc\\test.txt"); At the same time, I get the file name from QFileDialog::getOpenFileName and do not need to replace '\' with "\\". and it work fine. Why?

    3 My code fragment is showed as the following:
    Qt Code:
    1. if(cloudCheckBox->checkState()==Qt::Checked);
    2. {
    3. for(size_t i=9;i<17;++i)
    4. {
    5. trimCloud(list[i]);
    6. }
    7. }
    To copy to clipboard, switch view to plain text mode 
    It's strange that even I do not click the CheckBox, but it still execute the above code fragment. I try cloudCheckBox->isChecked() instead, I got the same result. Why?

    By the way, in the constructor function, I set the CheckBox true.
    Qt Code:
    1. cloudCheckBox->setChecked(true);
    2. windSpeedCheckBox->setChecked(true);
    To copy to clipboard, switch view to plain text mode 

    When i run the app, I click to remove the "√".



    4 From my perspective, I do think that try my thinking in a console window is very useful. Also because that I don't know how to test my code in a GUI program, it's very trival.
    How do you solve this problem?

    Thanks! Any relpy is appreciated!
    Last edited by HelloDan; 22nd February 2009 at 09:00.

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.