Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Date functions

    2
    0 Votes
    2 Posts
    2k Views
    A
    Did you even try to read QDate's documentation? It is right there!
  • Downloading multiple files

    3
    0 Votes
    3 Posts
    4k Views
    G
    You connect both slots to a single signal, so as soon as one of your downloads has finished, both slots are called! The correct way would be to create just one slot, connected to signal finished and save the QNetworkReply pointer returned by QNAM.get() in a class attribute. In your slot compare which request finished (the reply pointer is set in the signal and delivered to the slot) and put the bytes into the respective file.
  • How to intercept console aplication exit ?

    2
    0 Votes
    2 Posts
    4k Views
    ?
    You may try to register a custom function to a signal (i.e.: SIGTERM) so, when the signal is sent to your app, your function does its job, then the app closes as it does now. Code is as follows: @#include <signal.h> void signalHandler(int signal); int main(...){ //... //configure app's reaction to OS signals struct sigaction act, oact; memset((void*)&act, 0, sizeof(struct sigaction)); memset((void*)&oact, 0, sizeof(struct sigaction)); act.sa_flags = 0; act.sa_handler = &signalHandler; sigaction(SIGINT, &act, &oact); sigaction(SIGKILL, &act, &oact); sigaction(SIGQUIT, &act, &oact); sigaction(SIGSTOP, &act, &oact); sigaction(SIGTERM, &act, &oact); sigaction(SIGSEGV, &act, &oact); //... } void signalHandler(int signal) { //print received signal switch(signal){ case SIGINT: printf("SIGINT => "); break; case SIGKILL: printf("SIGKILL => "); break; case SIGQUIT: printf("SIGQUIT => "); break; case SIGSTOP: printf("SIGSTOP => "); break; case SIGTERM: printf("SIGTERM => "); break; case SIGSEGV: printf("SIGSEGV => "); break; default: printf("APPLICATION EXITING => "); break; } //print call stack (needs #include <execinfo.h>) /*int callstack_size = 2048; void* callstack[callstack_size]; int i, frames = backtrace(callstack, callstack_size); char** strs = backtrace_symbols(callstack, frames); for(i = 0; i &lt; frames; i++){ printf("%s\n", strs[i]); } free(strs);*/ //... (do something else) //app ends as expected fprintf(stderr, "Thus ends!!"); QApplication::quit(); }@
  • Distorted icons on multiscreen

    8
    0 Votes
    8 Posts
    3k Views
    T
    Seems like a bug in Qt's X11 graphics system. If I set QT_GRAPHICSSYSTEM environment variable to "raster" then the icons are displayed correctly. It seems to be an acceptable workaround (but it would still be nice to find and fix the actual bug).
  • Looking simple compress/decompress code

    4
    0 Votes
    4 Posts
    4k Views
    A
    We've been over this before. It is even a "FAQ":http://developer.qt.nokia.com/faq/answer/how_to_compress_data_with_qt entry. Please search the resources before asking again.
  • Run-time error "index out of range"

    7
    0 Votes
    7 Posts
    5k Views
    R
    Hi All, I found the my problem. The Logging ! I have my own MessageOutHandler .. this Handler wrote non synchronized directly to the ListWidget and triggers the ASSERT() .. - no need for the work around any more. Volker the article you refer was very nice. Some of the infos help me find my fault. cheers Chris
  • QModelIndex: Get for same column in parent?

    2
    0 Votes
    2 Posts
    3k Views
    A
    You could do something like this: @ QModelIndex parent = someIndex.parent(); QModelIndex parentColumn = someIndex.model().index(parent.parent(), parent.row(), someIndex.column()); @
  • QTreeView: "Auto-Checkboxes" and "Checkbox only"?

    5
    0 Votes
    5 Posts
    6k Views
    N
    Thanks, Andre. I'll take a look.
  • Static linking Qt libraries

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    4 Posts
    10k Views
    D
    Closing thread because of duplicate.
  • QAbstractItemModel: How to signal major change?

    3
    0 Votes
    3 Posts
    3k Views
    N
    Thank you, Volker.
  • Phonon. How to work with subtitles?

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Target deletion when animation is finished

    4
    0 Votes
    4 Posts
    6k Views
    K
    From the documentation. Try having a look at it sometimes. :-P @ void QObject::deleteLater () [slot] @ Schedules this object for deletion. The object will be deleted when control returns to the event loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the event loop is started.
  • Adding semi-transparent widgets on a custom QGLWidget

    3
    0 Votes
    3 Posts
    9k Views
    L
    I am having exactly the same problem. To restate: a partially transparent QWidget renders incorrectly when over a QGLWidget. For me, embedding the transparent widget inside the QGLWidget is not possible, since the widget is confined to the boundaries of the entire window, not just the QGLWidget. Does anyone have a solution? Anyone know if this is definitely not possible?
  • Delegate Min/Max

    3
    0 Votes
    3 Posts
    2k Views
    X
    So, I ended up using UserRoles to get the data from the model to the delegate. I think there's a bug, however. When my delegate's createEditor is called, it is populated with the DisplayRole data, not the EditRole data. This makes for a problem with combo boxes. The DisplayRole is a string, but the EditRole is a list. I need that list type QVariant in the createEditor to create the right QWIdget. I've gotten around this by having another UserRole to ask for the type of component to create, but it would be a whole lot simpler if createEditor was sent the EditRole data.
  • Export C++ class from Qt Library on Windows

    6
    0 Votes
    6 Posts
    11k Views
    K
    It seems no way to set dll library path inside .pro. Anyway, I could set PATH in windows environment so that exe will use to find the dll path.
  • How to reduce Qt Application Binary size ?

    9
    0 Votes
    9 Posts
    10k Views
    A
    IANAL either, but AFAIK, as long as you provide the option to re-link against another version of the library, you are allowed to use static linking using the LGPL Qt libraries. And no, that is probably not too easy to do, but I think Gerolf's comment is incorrect.
  • QGroupBox: sunken frame problem

    3
    0 Votes
    3 Posts
    5k Views
    B
    Thanks for the QFrame suggestion. QFrame allows me to use the setFrameStyle and setLineWidth. This makes the frame deeper.
  • 0 Votes
    7 Posts
    7k Views
    D
    Edit your thread post and change title there.
  • Qt and Flash in a headless environment

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied