Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • 0 Votes
    10 Posts
    4k Views
    I
    ok thanks gerolf..
  • Custom Signal/Slot Implementation for a QPushButton

    5
    0 Votes
    5 Posts
    15k Views
    C
    @connect( ViewRawData, SIGNAL( output( StrainID ) ), this, SLOT( InvokeRawDataTable( StrainID ) ) );@ is wrong. The corect form is: @connect( ViewRawData, SIGNAL( output( int ) ), this, SLOT( InvokeRawDataTable( int ) ) );@ You send and receive a data type using Signal Slot, not the variable name.
  • 0 Votes
    17 Posts
    10k Views
    H
    [quote author="Andre" date="1305271263"]Calling the base class implementation of a function you reimplement is usually a good idea. Unless you are certain that you completely want to override everything the base class did (or you know it does nothing), you should call the base implementation by default. [/quote] Lots of thanks to both Andred and sigrid.. this forum is really paradis for Qt users
  • How to acces MainWindow objects from QGraphicsItem

    3
    0 Votes
    3 Posts
    3k Views
    A
    Hi Gerolf, thanks for the tips, I like number 1, seems easy to do and I thought about that before but still my problem was how to read the state of "run" button stored in MainWindow from inside a dialog class of a QGraphicsItem inside a QGraphicsScene. Can you give me some help there too? Thanks.
  • Https and SSL...what's the trick to get it to work?

    7
    0 Votes
    7 Posts
    16k Views
    P
    Was able to figure out a work around... http://developer.qt.nokia.com/forums/viewthread/5861/
  • Trouble subclassing QSlider

    14
    0 Votes
    14 Posts
    8k Views
    D
    Figured out why the wrong setValue was being used. the ui_xxx.h file was not being updated due to the way I was building the project. Once I deleted the offending ui_xxx.h file and pointed the include directory to the right location of the correct ui_xxx.h file, things worked better. Now to set the signals such that updating the slider changes the spinbox and the reverse...
  • Question regarding overriding QGraphicsScene

    3
    0 Votes
    3 Posts
    4k Views
    J
    Apologies for the late reply, that's completely solved my problem with the background image thank you! It appears the reason for drawItems() not being called is because I missed the bit about requiring the Indirect flag to be set since Qt 4.6. I'll perform all my rendering for items in the foreground processing then as I had no intention of using the scene's default implementation. Thank you for the help.
  • Open html page

    8
    0 Votes
    8 Posts
    5k Views
    L
    Hi, I see that the issue is already solved thanks to Volker but I want to advertise two very simple code snippets related to the topic that I have added lately to the wiki :) "Open Web Page in QWebView":http://developer.qt.nokia.com/wiki/Open_Web_Page_in_QWebView "How to launch Web Browser":http://developer.qt.nokia.com/wiki/How_to_Launch_Web_Browser Cheers, Leon
  • How will MainWindow get notified when in event loop.

    13
    0 Votes
    13 Posts
    8k Views
    S
    Hi guys, apologies for not having replied any sooner. Soution to this was to create a single shot timer. It ensured that I had a valid event loop by the time the signal was handled. As for the reason to wait for the event loop, well there were many. But the most prominent was for elegance. I could have put the code for the login dialog inside the MainWindow c'tor but that will look awkward. And besides once the login is handled the initial download should commence which is gonna need the event loop. But what I found out in the process was that the one wudnt have to wait for the exec() call to see if the events are being processed. exec() is merely an endless loop which waits for events and processes them. It's something which the code enters into when it dont have anything to do (like creating windows, setting properties, opening files etc.) and wait until the user quits. I hope this helps out anyone in the future. edit: I wanted to say, single shot timer is more elegant than waiting on show event. Show Events get called even before the exec() is called for the app. But the timer is only fired after exec() is called for.
  • Auto expanding QLabel

    7
    0 Votes
    7 Posts
    6k Views
    J
    Right now it has a fixed size. But I would like to switch to the behavior i mentionned in my first post. I tried to remove all spacers, set the QLael policy to minimum expanding, and set a base size. -> aspect ratio is lost -> when docked it takes too much space.
  • Applying StyleSheet to Custom Window

    11
    0 Votes
    11 Posts
    10k Views
    G
    That does not work at all. If you have a custom drawn widget, it can't be styled. Only if you do some basic style sheet stuff and paint on it later...
  • How to move selection from top to bottom in list widget

    3
    0 Votes
    3 Posts
    3k Views
    S
    Worked great. Thanks!
  • How delete list of actions or 1 among this actions

    7
    0 Votes
    7 Posts
    4k Views
    R
    Many thanks for you advance!
  • [SOLVED] What to target on Mac OS X? 32-bit and/or 64-bit?

    7
    0 Votes
    7 Posts
    5k Views
    A
    Thanks, I thought it might have been the case. That's very good to know!
  • 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