[SOLVED] Downloadable Documentation for 5.1



  • Good Afternoon,

    I am looking for a downloadable QT 5.1 class reference. I don't always have internet accessibility, thus this request.

    I am moving a client from wxWidgets to QT. So I am rewriting the custom applications I wrote for them in the past. It's custom software unique to their organization.

    It doesn't matter to me if it's a massive PDF file, or a zip file containing the online reference in HTML format.....
    I just need to have it on my system and available offline.

    And yes the context help is working in QT Creator. But that is not the best venue to read to become familiarized with the "feel and use" of QT as a whole, which I need to do.

    I can't seem to find this on any QT related site I go to.

    I would really appreciate a pointer to the downloadable documentation.

    THANKS!

    Sincerely and respectfully,

    Dave


  • Moderators

    Hi,

    Welcome to the world of Qt!

    When you installed Qt, offline documentation is included in the package. Just open Qt Assistant :)



  • Thank You!

    Boy, do I feel stupid!!

    Dave


  • Moderators

    You're most welcome! Please don't feel stupid; we all have things to learn. The community is here to help each other out, no matter how new or how experienced we are.

    All the best with your porting efforts! Feel free to post your questions if you encounter any issues.



  • PK, here are some porting updates:

    I am 56. Been coding in C/C++ since 1984. userland windows drivers, applications, etc. Used the Borland (now Embarcadero family) of products. So there is a brief decsription. I switched because I am now partially disabled due to a stroke, and can;t afford $4k for the embarcadero products.

    QT won the "Which widget set" trials I have been conductinf gor the last 10 days.

    Here are some of the obstacles I've encouterd (and overcome).

    The QString object is not nearly as flexible as an AnsiString object. It doesn't play with QFile read/write operations. In my mind, the QString object should have a "->c_str()" pointer member. Intead, I have to launder data contain in my GUI objects through a std::string, which has a "c_str()" pointer to facilitate file read/writes.

    This is really clumbsy. I know that QString is unicode...... but to not have the QFile object able to take a QString as it's object to write, and forcing us to convert to std::string is an annoyance and a nuisance. If QString has a pointer to a std:string->c_str() it would make QFile much easier to read. My file read/write code as a result is 2x the size compared to Borland because of all the conversions I have to do back and forth in read/write operations to a file.

    You see most screen objects contain their text in QStrings. So reading/writing that data in/out to a file is not native with QFile.

    QT Creator is apleasure to work with. It's easy to customize, and works relatively well. Occasionally if I induce a segfault in my code because of fat-fingering something, I can't get my debugger to stop at breakpoints until I restart the whole GUI. I don't consider this a big deal at all. I've totally locked of Borland/Embarcadero so may times, I'd actually go so far as to stay that CT Creator is significanly more stable.

    On the documentation...I do wish there was more example coding demonstrating the usage of an object, and it's mempers/properties. I find that the terminology between VCL objects/members/properties to be very different. So for me, there is quite the learning curve. HAving more day to day example of code, would make my transition to a new framework easier. I end up having to web search for example on some members, becasue theQT Assistant documentation is not as fleshed out as Borland/Embarcadero's. So I have to web search for examples from others.

    The GUI componetnts in the UI designer could be more fleshed out with dialogs such as save, open, printer, and other stuff.

    These are [b/[i]not[/i][/b] show stoppers. It's just a report.

    I think it will take me probably 6 weeks to become as proficient in QT as I was under Embarcadero/Borland products.

    Overall...I think QT is by far the best IDE out there for Linux.

    Code::Blocks w/wxWidgets....is another good IDE, but the wxWidget set has so much less functionality than the QT widget set.....that I couldn't do the port with wxWidgets becasue the port would loose functionality.

    As far as I am concerned, QT is going to be the DE for me on Linux.

    Sincerlt,

    Dave



  • There is no single "correct" way to make a C-string from a Unicode string. QString provides several conversions to 8-bit encodings:
    QString::toUtf8() (This is what toStdString() uses under Qt5)
    QString::toLatin1()
    QString::toLocal8Bit()

    Each produces a QByteArray with a constData() method returning the equivalent of std::string::c_str().



  • Would it be "Kosher" to do this, or would the compiler throw up:

    [b][i] Here is what I am doing now[/i][/b]
    [code]
    for(int counter = 19;counter<22;counter++)
    {
    //put the QString into the StdString;
    StdString = Data[counter].toStdString();
    // then write the string out.
    results = file.write(StdString.c_str());
    // and add a newline character to separate the data fields from each other.
    results = file.write("\n");
    }
    [/code]

    [b][i] And here is what I would like to do:[/i][/b]

    [code]
    for(int counter = 19;counter<22;counter++)
    {
    // then write the string out.
    results = file.write(QString.toStdString.c_str());
    // and add a newline character to separate the data fields from each other.
    results = file.write("\n");
    }
    [/code]

    Or is there a way to get the display text of a GUI object, and put it directly into a std::string?

    THANK YOU!

    Yes, this is a text file that I want editable by leafpad, pluma, nano, etc...

    Sincerely and respectfully,

    Dave


  • Moderators

    Hi,

    I'm glad to hear you've had a mostly positive experience with Qt so far! If you have suggestions, feel free to post them at http://bugreports.qt-project.org/

    [quote]is there a way to get the display text of a GUI object, and put it directly into a std::string?[/quote]
    @
    // Your idea works fine:
    file.write(myQString.toStdString().c_str());

    // But this is even cleaner:
    file.write(myQString.toUtf8());
    @

    The second line works because QFile takes a QByteArray (which is a high-level version of char[]). This is the conventional way to do it. std::string is rarely needed in a Qt application, unless you're interfacing with another program/library that uses std::string.

    If you're comfortable with streaming API, you can also attach a "QTextSteam":http://qt-project.org/doc/qt-5.1/qtcore/qtextstream.html to your QFile and stream your text straight into the file:

    @
    QFile file("text.txt");
    QTextStream stream(file);
    for (int i = 0; i < myQStringList.size(); ++i)
    {
    stream << myQStringList[i]; << '\n'
    }
    @

    [quote]I do wish there was more example coding demonstrating the usage of an object, and it’s mempers/properties.[/quote]Do you have any specific examples in mind? Qt documentation comes with lots of examples (some say too many, even). See http://qt-project.org/doc/qt-5.1/qtdoc/qtexamplesandtutorials.html

    [quote]The GUI componetnts in the UI designer could be more fleshed out with dialogs such as save, open, printer, and other stuff.[/quote]There's no need to implement your own standard dialogs. Just call them:

    @
    // This launches a full-fledged file selection dialog that
    // blocks processing until the user selects a file or cancels
    QString filename = QFileDialog::getOpenFileName();

    if (!filename.isEmpty())
    {
    QFile file(filename);
    file.open(QFile::ReadOnly|QFile::Text);

    // ...
    

    }
    @

    Similarly, there's QPrintDialog (although this is slightly more involved that QFileDialog)



  • That's nice and concise. The QString,toUTF8 is nice and clean. No laundering necessary!

    That's more like what I am used to! Concise!

    My lack of famiarity (for the short term) with the QT library had me overlooking this little golden nugget!

    THANK YOU!

    Sincerly,

    Dave


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.