Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • 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; }@
  • How to add manually a column to a treewidget?

    8
    0 Votes
    8 Posts
    13k Views
    G
    Hi Leon did you look at tzhe fiunctions I pointed you to? QTreeWidget::setHeaderItem QTreeWidget::setHeaderLabel QTreeWidget::setHeaderLabels [quote author="Gerolf" date="1311327187"]You can use "QTreeWidget::setHeaderItem":http://doc.qt.nokia.com/4.7/qtreewidget.html#setHeaderItem or some similar functions.[/quote]
  • Can QTCPSocket be converted to QNetworkRequest?

    3
    0 Votes
    3 Posts
    4k Views
    A
    You should google a bit on "Qt webserver". There is plenty of code to be found that goes into the direction you're interested in, but as peppe said: QNAM and friends are geared towards the client end of business, not the server end.
  • 0 Votes
    3 Posts
    3k Views
    R
    Thank you for the reply! And what's more it worked like a charm! Thanks a ton! BR Rupesh
  • QTreeView ans setTabStopWidth

    6
    0 Votes
    6 Posts
    3k Views
    A
    You might want to step up and add the feature yourself, after which you can request it to be merged into Qt.
  • How to get the file names from folder

    5
    0 Votes
    5 Posts
    11k Views
    A
    [[Doc:QDirIterator]] is also worth taking a look at, depending on your use case.
  • Regarding Datatypes

    3
    0 Votes
    3 Posts
    2k Views
    A
    If you don't want to use Qt and Qt datatypes in your win32 console application, then your library methods should not return Qt data types. So, either: Link the win32 console app to Qt Core, and be able to use the Qt data types, or Do not use Qt data types in your library API but limit yourself to standard data types.
  • Need underline ONE word in QPlainTextEdit [SOLVED]

    9
    0 Votes
    9 Posts
    10k Views
    EddyE
    Bugs are not covered in the docs. You could file a bugreport in the "bugtracker.":https://bugreports.qt.nokia.com/secure/Dashboard.jspa If you feel your experience/workaround can help others, please add it as a doc note.
  • Having problerm with QTextBlock::isVisible in QTextEdit

    Locked
    2
    0 Votes
    2 Posts
    3k Views
    G
    Please, don't double post your stuff. You already posted the same 7 hours ago with "this thread":http://developer.qt.nokia.com/forums/viewthread/8000/ If you have additional information, add them to the previous thread. --> thread closed
  • Buffered sound (wav) distorted at end

    6
    0 Votes
    6 Posts
    5k Views
    EddyE
    bq. Example: Original file http://dl.dropbox.com/u/6552350/buy_one_free.wav This is how the distorted file sounds: http://dl.dropbox.com/u/6552350/distorted.wav I tested both on windows 7 and as you said I can play them. But on iOS 4 the first couldn't be played. I know that's not a solution to your problem but could be interesting te know. "Did you follow the following installation instructions ? ":http://developer.qt.nokia.com/doc/qt-4.7/phonon-overview.html#id-13ad5cd8-5ffa-4fdb-b3ec-a6a0bd57e92b bq. On Windows, building Phonon requires DirectX and DirectShow version 9 or higher. You'll need additional SDKs you can download from Microsoft. "Also did you know this about Phonon":http://labs.qt.nokia.com/2011/05/12/qt-modules-maturity-level-the-list/ bq. Overall module state: Done inside Qt, Maintained outside of Qt Reasoning: QtMultimediaKit recommended instead; development of Phonon continues and is maintained outside of Qt, by the KDE community. It could be worth a try using QtMultimediakit I couldn't find a similar bug in the "bugtracker :":https://bugreports.qt.nokia.com/secure/QuickSearch.jspa You could add your bug report if the above requirements are met.
  • [SOLVED] QFrame subclass not keeping properties set in Qt Designer

    5
    0 Votes
    5 Posts
    5k Views
    Y
    yeah I have already done this with QWidget::keyPressEvent() and other sub-event functions but it just did not dawn on me that I was cutting of all sub events() by reimplementing event(), I simply considered that both the event and sub-event functions would get called.
  • Moc does not support preprocess?

    3
    0 Votes
    3 Posts
    3k Views
    T
    I was reading some moc related material today, and this was one point that I came across.. http://doc.qt.nokia.com/latest/moc.html see under "Limitations" section.
  • [SOLVED] Automatically increment a build number

    4
    0 Votes
    4 Posts
    9k Views
    Y
    I ended up adding these lines to the .pro file: QMAKE_EXTRA_TARGETS += buildNo buildNo.commands = ./buildNoScript PRE_TARGETDEPS += buildNo # adding this removes the necessity to use .target Then I made a simple script called buildNoScript that calls a small program that updates build info in a file (it reads the build no from that file first then increments it and writes it back).
  • 0 Votes
    9 Posts
    12k Views
    L
    Well, I've put [Solved] since I worked around it. But at least thanks for this very clear hard and fast rule. This would've spared me the experimenting.
  • [SOLVED]print html text

    3
    0 Votes
    3 Posts
    6k Views
    E
    Sorry, the painter is useless, I solved the problem. Here's the solution if some are interest : @ QPrinter Printer(QPrinter::HighResolution); QString htmlText(Text->toHtml()); QPrintDialog PrintDialog(&Printer;, this); if (PrintDialog.exec()) { Printer.setFullPage(true); QTextDocument TextDocument; TextDocument.setHtml(htmlText); TextDocument.print(&Printer;); }@ tha,ks
  • [SOLVED]QLineEdit With Model

    6
    0 Votes
    6 Posts
    8k Views
    M
    I think it needs a lot of work, anyway thank you Andre, that's what I was looking for.
  • Resize a QGraphicsItem into a QGraphicsScene

    2
    0 Votes
    2 Posts
    9k Views
    Z
    Here's one way to do it: Make your item selectable (setFlag()) If the item is selected, have your custom item class paint a resize handle in each corner and edge In your custom item class, override the mousePress(), mouseMove(), and mouseRelease() virtual functions. In the mousePress() function add code to check if the mouse press is over one of the handles. If it is set a flag that says you are in "resize mode". In the mouseMove() function, if you are in "resize mode" then resize (and maybe reposition) your item as determined by the moved amount. Remember to call prepareGeometryChange() to ensure the item gets repainted. In the mouseRelease() function flag that you are no longer in "resize mode". HTH.