What types of C++ Qt examples would ya'll most like to see.



  • I'm working on a book targeting Qt 5, based on the types of things I've used Qt to build over the last decade. However I want to make sure that I also cover things that I might not think of that other people have had trouble doing. So please leave a comment and let me know what types of tasks you would be interested in seeing examples for.

    Thanks,
    Chuck


  • Moderators

    Cool! Best of luck to you.



  • It took me a long time to find the best way to create and run my threads in QT. This topic is posted all over the web, but there seem to be many answers. I think I have found the "one true" answer (I hope!), but its probably worthy of a mention here : )

    And on that note, slots and signals between threads as well : )



  • [quote author="code_fodder" date="1366356804"]It took me a long time to find the best way to create and run my threads in QT. This topic is posted all over the web, but there seem to be many answers. I think I have found the "one true" answer (I hope!), but its probably worthy of a mention here : )

    And on that note, slots and signals between threads as well : )[/quote]

    I definitely agree!

    Another thing would be creating a "shared memory" between multiple processes and realizing properly synchronized inter-process communication using that memory.

    Yet another thing: How to implement your own QAbstractItemModel or QAbstractTableModel around your application-specific data (structures) in order to get your data displayed.

    Last not least: Create a child process via QProcess, parse the process' output and "extract" real-time progress info (probably involves some Signals&Slots magic + proper use of QRegExp's)


  • Moderators

    Not strictly coding related but a lot of people seem to struggle with deployment of Qt5 apps (especially on Windows) so that would be nice. Maybe a word about the recently released installer framework as well.

    Description of differences in ANGLE and OpenGL builds and range of OpenGL supported features in both.

    Also translations and multi lingual/character-set/encodings scenarios support in Qt, like reading and converting network streams of character data or right-to-left layouts.



  • +1 to everything already said!



  • Thanks for the comments guys. These are all very good suggestions that I will add to the list. I know that OpenGL in Qt5 has confused people and I will definitely be spending time trying to make that more clear.



  • The QTextEdit with its QTextDocument backend doesn't seem to quite get the attention it deserves when one tries to find information on how to properly use it. It is very powerful and flexible, but not explained in-depth, in my opinion.



  • Printing with Qt



  • Any tutorials with Qt Quick2 and QML are recommended. Because we Chinese fellow have difficulty getting start with QML.



  • I would certainly like to see more coverage on making applications look and behave natively on different platforms. As I found out and as you probably know well, Qt applications do not quite do that, especially on Mac.

    I am also interested in using ORM or similar data persistence techniques in Qt applications.

    Another interesting subject would be porting an application from a desktop platform to a mobile one.

    Keep us posted about your progress, a good book on Qt 5 will have a lot of value and will go a long way to make Qt a popular choice.



  • @chuckshaw Could you give us some simple examples of how to deploy an app which could upload onto the mac store?This is quite confuse for beginners.

    Edit : I forgot to mention, would you consider on providing several chapters about openGL(qml part and c++ part) and Qt5 for beginners?

    bq. Another interesting subject would be porting an application from a desktop platform to a mobile one.

    +1, I think the examples of android and ios would help many users

    bq. I think I have found the “one true” answer (I hope!), but its probably worthy of a mention here : )

    Could you share it with us?Thanks



  • stereomatching,

    Sorry for my late reply, I did not seem to get a notice about your post :(

    Though its a little off-topic for this thread, here is what I have written within my own code-base as a comment on how to set-up a thread (and objects within the thread) correctly:

    @
    /* QThread notes:
    It is important to understand how QThreads work. The general procedure to using the QThreads is:

    • Make Object to go into thread, assign no parent
    • Make thread
    • Move object into thead using obj->moveToThread(thread)
    • Connect a signal to a slot in the object that will instatiate the object members (if required)
    • Start the thread: thread->start()

    Now once the object receives the signal to instantiate its members they will be
    instantiated within the thread.
    Note: if you call an object method directly from outside the thread (or from another thread)
    which instatiates object members, then these objects will infact be created from outside the
    thread, and you may get warnings saying things like:
    "timers cannot be started from another thread"
    i.e. member functions are not thread-safe.

    // Good example:
    MyObj myObj = new MyObj(0); // 0 = no parent
    QThread* thread = new QThread;
    myObj->moveToThread(thread);
    QObject::connect(thread, SIGNAL(started()), myObj, SLOT(run()));
    thread->start();

    // Bad example:
    MyObj myObj = new MyObj(0); // 0 = no parent
    QThread* thread = new QThread;
    myObj->moveToThread(thread);
    thread->start();
    myObj->run(); //BAD - anything run() instantiates will be in 'this' thread
    */
    @



  • I would most certainly like to see:

    • Some canonical workaround for issues that arise to many people (inheriting signals, which requires multiply inheriting from QObject) designing apps.
    • Some insight into Qt's internals (using C++11 features like perfect forwarding and move semantics used 'inside' Qt (if there are any) and means of utilizing them.

Log in to reply
 

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