Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.1k Posts
  • Creating events instead of signals/slots

    30
    0 Votes
    30 Posts
    16k Views
    G
    Another solution (which I personally prefer) is to make a "Controller" object (derived from QObject) which encapsulates the non Qt interface (your C-backend) in a "facade design pattern":http://en.wikipedia.org/wiki/Facade_pattern . This goes to the direction -Andrea- Andre posted before the state machine. This controller object then sends signals which can be connected to anyone, who needs to know them... This is something we do often here with COM interfaces we have to use. It works well. Edit: my name is Andre
  • Non Native Gui

    4
    0 Votes
    4 Posts
    3k Views
    K
    okay I will look into those thank you.
  • Post data to php form

    9
    0 Votes
    9 Posts
    14k Views
    D
    You're absolutely right -- perhaps I expressed myself badly before. You CAN do it as of now using QNetworkAccessManager. The only culprit is that in 4.7 there's nothing to help you for making multipart/form-data POST requests. application/x-www-form-urlencoded POST requests are easy to deal with (by hand or using QUrl).
  • Scaling problems in Ubuntu using QPixmap and QPainter

    8
    0 Votes
    8 Posts
    5k Views
    Z
    Ah OK I think I understand now. I am not entirely sure what the limiting factor is in the rate at which mouse mouse events are generated. It could well be tied into the resolution used by your X mouse driver - probably a setting in xorg.conf but depend on which version of X you have - one day they'll settle on a configuration method ;-). One thing to try would be to try changing the mouse driver resolution and seeing if that affects the frequency of your mouse move events. Let us know how you get on.
  • Bounding Text Being Rendered Using QPainter?

    5
    0 Votes
    5 Posts
    4k Views
    D
    Actually I was replying to OP, edited the post to make that clear.
  • Unresolved externals in QtSql.lib (VS 2010 x64 Build)

    9
    0 Votes
    9 Posts
    7k Views
    W
    For what it's worth I agree with Raul, a serious waste of time, effort and no doubt money. If it's of any help make sure you link with the odbc libraries found in your Windows SDK. This should of course happen by default assuming your SDK's library path in referenced in your environment. -- Regards, William
  • QRegExp for Searching HTML Files?

    5
    0 Votes
    5 Posts
    3k Views
    A
    Good point. I think you are right, and QTextDocument::find() is the way to go.
  • QFileSystemWatcher

    10
    0 Votes
    10 Posts
    5k Views
    A
    I have requested "bug 172":http://bugreports.qt.nokia.com/browse/QTBUG-172 be re-opened. That has been done. You can vote for it now, if you want. Don't count on this being fixed any time soon though, seeing that the priority is not that high.
  • Is it possible to auto connect all object's signals to another object?

    9
    0 Votes
    9 Posts
    9k Views
    Z
    Yes that is a good approach too. It depends on the relationship of your objects as to which is more suitable. Anyway you have a few options to try now. :-)
  • How can I observe a custom qobject's slot?

    9
    0 Votes
    9 Posts
    5k Views
    A
    Yes, of course. It would only catch invocations through the signal/slot system. Sorry, I missed that part in your post.
  • QPixmap QBitmap, How to achieve this?

    3
    0 Votes
    3 Posts
    3k Views
    T
    Thanks for looking into this. The following code works fine for 3.3. It does not work for 4.6. I look into Qt 3.3 and Qt 4.6 's QPixamp setMask(). They are quite different. Not sure how to make the following code work for Qt 4.6. -Todd @ ///--- BEGIN QPixmap workPix(_guCanvas->getBuffer()->size()); for (int i = 0; i < _numLayerBmaps; i++) { workPix.fill(_guCanvas,0,0); // fill workPix with the background of guCanvas, which is balck QPainter p; if (_shapeViaVisibleAry[i]) { // <----- a QBitmap if (_shapeViaBmapsFill[i].isNull()) { continue; } // Use QPainter to fill workPix with color patterns p.begin(&workPix); if (i % 2) { // fill with pattern in foregorund p.fillRect(workPix.rect(), QBrush(ppColor[i], ppBrushPattern[PAT_VIA_CUT])); } else { p.fillRect(workPix.rect(), QBrush(ppColor[i], ppBrushPattern[PAT_SHAPE])); } p.end(); // // I want to do AND operation on workPix using shapeViaBmapsFill[i] // if the bit on shapeViaBmapsFill[i] is '1', I want workPix to store workPix's // original foreground, if it's '0', workPix to store background. // workPix.setMask(_shapeViaBmapsFill[i]); } } //---- END --- @ Edit: please use the @ tags to format your code and deleted double post of code section; Andre
  • [SOLVED] QTextStream and std::endl

    5
    0 Votes
    5 Posts
    26k Views
    A
    Whoops, did not paste the correct line. Ought to be: @out << "Username | " << username << endl << "Password | " << password << endl;@ And thanks for the advice. Worked like a charm.
  • [Solved][QCA] Missing library for -lqca/-lqca_debug on compile

    4
    0 Votes
    4 Posts
    4k Views
    M
    Hi there ! Finally, I think I've solved my issue alone T_T ... In fact, in the crypto.prf, I saw this: @mac: { framework_dir = $$QCA_LIBDIR exists($$framework_dir/qca.framework) { #QMAKE_FRAMEWORKPATH *= $$framework_dir LIBS += -F$$framework_dir INCLUDEPATH += $$framework_dir/qca.framework/Headers LINKAGE = -framework qca } }@ Which opened my eyes, telling me that the header I've modified is not good. As Qt will "use" the QCA_INCDIR to look for QtCrypto, this "define" must point to the "Headers" inside "/qca.framework/". THEN !! I saw that it uses the QCA_LIBDIR to find the libs, by adding the same directory as above, to assign it to the "INCLUDEPATH" config... So, here is my new crypto.prf head: @QCA_INCDIR = /Library/Frameworks/qca.framework/Headers QCA_LIBDIR = /Library/Frameworks/ #QCA_INCDIR = /usr/local/include #Old #QCA_LIBDIR = /usr/local/lib #Old@ No more compiling issue :) Thank you for your help anyway =) (But I don't change the title to "Solved", because I'mnot sure yet I won't have another issue with that) EDIT: BTW, with the earlier QtSDK, Qt's Frameworks are located in: ~/QtSDK/Desktop/Qt/472/gcc/lib/, so... I've moved the qca.framework directory inside it, and changed the QCA_INCDIR & QCA_LIBDIR definition. Without doing it, Qt didn't complain on compile, but I had to add "INCLUDEPATH += /Library/Frameworks/qca.framework/Headers" to get the help and the auto-completion. Now I'm done :) Except that if you want to install (& compile) qca-ossl on a mac, you will need this: http://pastebin.com/nVkaiGWP Cheers!
  • QFileDialog being slow when clicking on "My Computer"

    5
    0 Votes
    5 Posts
    4k Views
    P
    ya I could try that I guess. Running 4.7.2. I am compiling it with minigw not sure if thats related.
  • [SOLVED]Object::connect: No such slot...

    4
    0 Votes
    4 Posts
    6k Views
    A
    Whoops. Sorry for not including the exact error message. And, thank you for your assistance. I did not realize you had to declare the slots to be slots. Thanks again.
  • Windows messages to Qt window

    1
    0 Votes
    1 Posts
    4k Views
    No one has replied
  • Qt 4.7.2 build failure on QtWebKit using Visual Studio 2010

    4
    0 Votes
    4 Posts
    4k Views
    F
    It works. Something was wrong on PATH. I included "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" in PATH for using nmake instead of using Visual Studio Command Prompt (2010).
  • Image processing and sizes

    15
    0 Votes
    15 Posts
    9k Views
    Z
    Yeah for me it also depends upon the context in which the loop(s) occur. If I am iterating over rows then I'll use "row". Usually I try to use something that makes it obvious to which the counter refers.
  • Placing widget below dock area in MainWindow.

    5
    0 Votes
    5 Posts
    3k Views
    L
    Nope, I tried that. You still get a title bar, but no close/minimise/float buttons. My method completely removes the title bar. The window, as of now, looks like this: !http://img218.imageshack.us/img218/1456/asofnow.png(image)!
  • DrawText (single line) and Ellipsis

    2
    0 Votes
    2 Posts
    6k Views
    Z
    Take a look at the "docs":http://doc.qt.nokia.com/latest/qfontmetrics.html#elidedText for QString QFontMetrics::elidedText ( const QString & text, Qt::TextElideMode mode, int width, int flags = 0 ) const. That should do what you need. You can then paint the resulting string with QPainter as usual.