Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.0k Posts
  • Qt scanner generator

    2
    0 Votes
    2 Posts
    3k Views
    Z
    I've found one way that gets me part way there with flex which is to simply use the under-documented function yy_scan_string() and pass in QByteArray.constData() as the argument before calling the yyparse() function. ie: @ ... QByteArray ba = myString.toUtf8(); YY_BUFFER_STATE string_buffer = yy_scan_string( ba.constData() ); yyparse(); yy_delete_buffer(string_buffer); @ That will probably get me close enough for this little project as I am not expecting to have to worry about UTF16.
  • QGLWidget and JPEG

    5
    0 Votes
    5 Posts
    4k Views
    D
    I post all code. I think what I don't need mixture OpenGL and Qt functions.
  • How to display Widgets in the midle of a Window

    2
    0 Votes
    2 Posts
    3k Views
    EddyE
    You didn't use stackLayout.
  • [Solved] Making filter in QTableWidget

    4
    0 Votes
    4 Posts
    8k Views
    EddyE
    You're welcome. Please add [Solved] in front of your title. That way others know this is solved.
  • [Solved] QDataWidgetMapper with two models

    5
    0 Votes
    5 Posts
    3k Views
    T
    Ok, it's solved, I messed up something with manual submit of the two models, setting their policy to "OnRowChange" made the whole thing working. Thanks a lot anyway!
  • How To Load Images into UI ?!

    6
    0 Votes
    6 Posts
    6k Views
    D
    Or just a QListView in iconmode, a custom delegate and a (proxy) model which supplies the image data.
  • Silly newb question, regarding text inputs and the return key

    3
    0 Votes
    3 Posts
    2k Views
    EddyE
    "Here is a good chat network example :":http://developer.qt.nokia.com/doc/qt-4.7/network-network-chat.html#id-5c32885a-244d-40f7-95b1-054e0e80ffb7 There they use signal slots
  • QSettings is not saving my data

    4
    0 Votes
    4 Posts
    8k Views
    Q
    Wow, thanks for that guys, Sorry I've been late but I just had the time to be back, have a great day ;) Ahmed
  • Some question as i am begginer in Qt and want to do a lot !

    8
    0 Votes
    8 Posts
    5k Views
    M
    [quote author="Green_AciD" date="1311368004"]Thanks everyone, for your help, let me explain what exactly i need to do: [/quote] This aspect is already being discussed in "this thread":http://developer.qt.nokia.com/forums/viewthread/7891/ you created. Please don't duplicate the content here.
  • [SOLVED] getting notified that the app has started

    10
    0 Votes
    10 Posts
    3k Views
    R
    Got it mlong, thanks!
  • How to create a listbox with custom listbox items?

    5
    0 Votes
    5 Posts
    7k Views
    A
    Thanks again, ZapB!
  • DialogBox.show() issue in MainWindow [SOLVED]

    7
    0 Votes
    7 Posts
    9k Views
    EddyE
    Sorry, my mistake. I didn't test it first. If you use show, you should use setModal first. "Here is the full explanation.":http://developer.qt.nokia.com/doc/qt-4.7/qdialog.html#id-8f49114e-2fb8-4525-8a9d-af84f69df7e6
  • [SOLVED] Building Qt 4.8 beta fails on "./configure"

    4
    0 Votes
    4 Posts
    6k Views
    R
    done.
  • Python and Qt4 form designer

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • [Solved] Setting size of QTableView Header

    3
    0 Votes
    3 Posts
    6k Views
    A
    Hey Thanks, I think this is good for me.
  • Bug with QPushButton hit-testing under OS X.

    5
    0 Votes
    5 Posts
    3k Views
    R
    Can I re-build Qt on OSX Lion at all? 4.7.3 failed on some errors. I have Xcode 4.1 there. Is that the reason? Will 4.8 beta build on OSX Lion?
  • How to successfully create a debuggable Qt application on Mac OS X?

    2
    0 Votes
    2 Posts
    5k Views
    M
    OK, I am back again. In the meantime I understood - thanks to an advice from Ian Wadham - that the configure option @-no-separate-debug-info@ could be used when building QT4. In the configure options setup I also found that @-debug-and-release@ was actually set which always produced both lib versions being very likely the reason for unintended linking between release and debug library version, eventually being responsible for the crashing debug version of the application under test... So, I changed the configure options now to @configure.args-append -debug -no-separate-debug-info@ I can verify that now only debug versions of the respective QT libs are installed: @... /opt/macports-test.new/lib/libQtCore_debug.4.7.3.dylib /opt/macports-test.new/lib/libQtCore_debug.4.7.dylib /opt/macports-test.new/lib/libQtCore_debug.4.dylib /opt/macports-test.new/lib/libQtCore_debug.dylib /opt/macports-test.new/lib/libQtCore_debug.la /opt/macports-test.new/lib/libQtCore_debug.prl ... @ But above you can see that all debug libraries have the extension "_debug". When I try to build other applications using QT4 (here kdelibs4) I therefore run into other trouble: @... :info:build cd /opt/macports-test/var/macports/build/_Users_marko_WC_MacPorts_ports_kde_kdelibs4/work/build/kdecore && /opt/macports-test/bin/automoc4 /opt/macports-test/var/macports/build/_Users_marko_WC_MacPorts_ports_kde_kdelibs4/work/build/kdecore/kauth_backend_plugin_automoc.cpp /opt/macports-test/var/macports/build/_Users_marko_WC_MacPorts_ports_kde _kdelibs4/work/kdelibs-4.6.5/kdecore /opt/macports-test/var/macports/build/_Users_marko_WC_MacPorts_ports_kde_kdelibs4/ work/build/kdecore /opt/macports-test/bin/moc /opt/macports-test/bin/cmake:info:build dyld: Library not loaded: /opt/macports-test/lib/libQtCore.4.dylib :info:build Referenced from: /opt/macports-test/bin/automoc4 :info:build Reason: image not found :info:build /bin/sh: line 1: 82423 Trace/BPT trap /opt/macports-test/bin/automoc4 /opt/macports-test/var/macpo rts/build/_Users_marko_WC_MacPorts_ports_kde_kdelibs4/work/build/kdecore/kauth-policy-gen_automoc.cpp /opt/macports-tes t/var/macports/build/_Users_marko_WC_MacPorts_ports_kde_kdelibs4/work/kdelibs-4.6.5/kdecore /opt/macports-test/var/macp orts/build/_Users_marko_WC_MacPorts_ports_kde_kdelibs4/work/build/kdecore /opt/macports-test/bin/moc /opt/macports-test /bin/cmake ...@ Above you can see that the build process of kdelibs4 expects to find libQtCore.4.dylib which, of course, cannot be found in my current setup. I am wondering what can be done to make cmake build QT4 a debug version without appending the "_debug" prefix to the library names.
  • What will be the most suitable input method implmentation?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Link failures when defined private/protected to public

    7
    0 Votes
    7 Posts
    5k Views
    L
    [quote author="timoph" date="1311314706"] [quote author="fifth" date="1311311328"]As for the trick, our unit test framework does so to make every protected/private method testable. [/quote] To me this just sounds wrong. I wouldn't trust in the results coming from those unit tests since the tested thing will be different than the actual release. [/quote] That's a better phrasing of what I wanted to say, and states my exact concerns!
  • Real-time Audio Processing with Qt

    6
    0 Votes
    6 Posts
    25k Views
    V
    Ryan: you have to take care of the "len" - parameters, they can change on every call. you could implement the buffer as some sort of circular buffer and check your write and read positions ... this should work: @qint64 myProcessing::writeData(const char *data, qint64 len) { qint16* aVal; qint64 numSamples = len / 2; qint64 posSamples = 1; aVal = (qint16*) data; while (posSamples <= numSamples) { mBuffer[mBufWritePos] = doSomething(*aVal); mBufWritePos = (mBufWritePos+1) % bufSize; aVal++; posSamples++; } mBufFill += len; return len; } qint64 myProcessing::readData(char *data, qint64 maxlen) { if (mBufFill<=0) return 0; qint64 toDo = qMin(maxlen, (qint64) mBufFill); if (toDo / 2 + mBufReadPos > bufSize) { qint64 firstNum = (bufSize - mBufReadPos) * 2; memcpy( data, &mBuffer;[mBufReadPos], firstNum ); memcpy( data + firstNum, &mBuffer;[0], toDo - firstNum); } else { memcpy(data, &mBuffer;[mBufReadPos], toDo); } mBufReadPos = (mBufReadPos + toDo/2) % bufSize; mBufFill -= toDo; return toDo; }@