Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • QtMobility 1.1 / WindowsXP / Messaging Framework and MinGW

    6
    0 Votes
    6 Posts
    4k Views
    F
    From a maintenance point of view it makes sense calling the OS/vendor API, especially when it concerns closed protocols.
  • [Solved] How can Icapture QDialog´s load/show event?

    4
    0 Votes
    4 Posts
    9k Views
    F
    That is indeed the solution you need to go for.
  • [Solved] Cannot build an app for desktop

    5
    0 Votes
    5 Posts
    4k Views
    K
    I just installed 4.7.1, set a path to the qmake and it did the trick. Thank you!
  • 0 Votes
    8 Posts
    4k Views
    W
    Oh and one more thing, i need to dynamically generate these widgets based upon user input.( That might help things make more sense)
  • Different output in VS2010 than ... everything else

    3
    0 Votes
    3 Posts
    3k Views
    T
    There are several ways to do UI file integration into C++ classes (as "documented":http://doc.qt.nokia.com/4.7/designer-using-a-ui-file.html#the-direct-approach). VS Plugin and Qt Creator both implement a flavor of "the direct approach". I doubt that there is any more specific reason than personal preferences of the developers that actually did the wizards to set them up. Having said this and being a Creator guy myself I have to point out that QObjects should be allocated on the heap and thus you should prefer Qt Creator's way of doing things. Welcome aboard by the way... I fully understand why you do not want to go back to MFC by the way:-)
  • Animate buttons

    2
    0 Votes
    2 Posts
    3k Views
    A
    If I understand your question correctly it may be simpler to connect the button click event to a state machine that makes the transition from one state to the other. Depending on which button was pressed, a different transition could be chosen in the connect. That is assuming you want to go to the new state regardless of the order the buttons were clicked and regardless of the previous state. If you want to change states in some predictable order you must always enter the state machine with the same transition and carry forward the destination state before exit. From your description it seems more straightforward to start animation state machines (separate ones for each of the selected buttons) to do the animation and just use conventional signal/slot mechanics for the button clicks.
  • QComboBox always crashes in 64-bit release mode (Qt 4.7)

    7
    0 Votes
    7 Posts
    6k Views
    ?
    thanks @ chantivlad :)
  • 0 Votes
    4 Posts
    3k Views
    F
    No problem.
  • [Solved] Weird Qt Trojan Error

    4
    0 Votes
    4 Posts
    3k Views
    G
    I've replaced Logger::debug("hello"); in the destructor with a simple cout statement, and now everything is fine.
  • Event handler does not get fired after postEvent

    4
    0 Votes
    4 Posts
    4k Views
    F
    Could you mock up a simple fully working example that shows the exact problem you're having (and use the code tags when posting it)? Of course you can also tar/zip it. Based on gut feeling I'd say that the event loop is being flooded.
  • Multi-line Elided text

    2
    0 Votes
    2 Posts
    7k Views
    O
    Ok, I have worked out a work-around, not the prettiest solution but it works... Basically, the code uses the QTextLayout to calculate the (natural) lengths of each line and adds them up and does this for n-1 lines. For the last line it simply adds the full width available and then creates an elided string with all the widths as if they were intended to be on one long line. Then the painter simply draw the text with word wrapping. @ QTextLayout textLayout(text); textLayout.setFont(font); int widthUsed = 0; int lineCount = 0; textLayout.beginLayout(); while (++lineCount < LINE_LIMIT) { QTextLine line = textLayout.createLine(); if (!line.isValid()) break; line.setLineWidth(availableWidth); widthUsed += line.naturalTextWidth(); } textLayout.endLayout(); widthUsed += availableWidth; QString newText = painter->fontMetrics().elidedText(text, Qt::ElideRight, widthUsed); painter->drawText(textRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, newText); @
  • How to retrieve a HTML page ?

    2
    0 Votes
    2 Posts
    3k Views
    G
    You should have a look at "QNetworkAccessManager":http://doc.trolltech.com/4.7/qnetworkaccessmanager.html, "QNetworkRequest":http://doc.trolltech.com/4.7/qnetworkrequest.html and "QNetworkReply":http://doc.trolltech.com/4.7/qnetworkreply.html Look at the "Detailed Description" of QNetworkAccessManager, this might be already what you want or gives you a good start.
  • [SOLVED] Hi, again :D Problem with Layouts...

    8
    0 Votes
    8 Posts
    5k Views
    Z
    I solved it finnaly. Thanks Volker i figured that in the process. Problem is that multiple layouts "create problems" (just in my head :D). The problem that i was trying to solve is that i wanted to my QFrame and QLabel occupy less space then given by outer layout. Finally i found solution by not giving my custom control additional space by putting QSpacerItem in outer layout that will force my controls to minimum (wanted) size. Thanks for help!
  • Problem with v4.7.1 on Ubuntu

    15
    0 Votes
    15 Posts
    9k Views
    A
    Well /etc/ld.so.conf only has one entry that says include *.conf in /etc/ld.so.conf.d In /etc/ld.so.conf.d there is only libc.conf libasound2.conf GL.conf i686-linux-gnu.conf i486-linux-gnu.conf I would have expected that since phonon is not a part of the SDK that the wrapper would use the webkit phonon I have and the webkit phonon version (as long as it is backward compatible i.e. 4.6.3+) would not matter. Maybe that is a mistaken assumption on my part.
  • Having problems with running VideoWidget example

    2
    0 Votes
    2 Posts
    2k Views
    B
    If anybody has similar problem, here's what I have done to solve it: I copied all the files in QtMobility's lib folder to /usr/local/Troll..../lib and now it's ok.
  • [Solved] Adding new items to model (MVC)

    4
    0 Votes
    4 Posts
    4k Views
    U
    It works! It works! Thank you wery much!
  • [Solved] Only one instance of application

    4
    0 Votes
    4 Posts
    6k Views
    Y
    Also if your app is simple and don't want any new command line arguments Simple use QProcess to check process exits or not if yes say stop running the app. Obviously QtSingleApplication is good solution but not for simple apps.
  • [Solved] QGraphisItem Events not called

    8
    0 Votes
    8 Posts
    4k Views
    G
    Thank you very much Antonio. It works now.
  • LabRat 'Gotcha' moc not seeing namespace.

    8
    0 Votes
    8 Posts
    6k Views
    ?
    good it worked :)
  • Triangle button - Geometry

    3
    0 Votes
    3 Posts
    6k Views
    G
    Thanks, I will look at QGraphicsView. The second option you mentioned wouldn't work so well, my buttons can actually be any shape/polygon in any position