Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Trying to get a Database going but I get an error.

    4
    0 Votes
    4 Posts
    5k Views
    G
    You setup the query object in your constructor before the database connection is established. There is absolutely no need to have an object-global query object if you do not need its result across method borders. Just create one when you need it and destroy it afterwards.
  • Huge helper poster !

    6
    0 Votes
    6 Posts
    3k Views
    G
    If you use google, you could find the "class chart of Qt 4.3":http://doc.qt.nokia.com/extras/qt43-class-chart.pdf There were even "other discussions about this on dev net":http://developer.qt.nokia.com/forums/viewthread/6865
  • Qlabel question - answered

    4
    0 Votes
    4 Posts
    2k Views
    G
    Please open new threads for new questions, thanks.
  • Please, remember int!

    8
    0 Votes
    8 Posts
    4k Views
    G
    Why don't you just try what you want to do and report back your experiences? Looks a bit as if you ask for permission to add a line of code each time you have an idea... QSettings usually works pretty flawless, so did you actually incorporate it in your code? Do you have any specific problems with that class?
  • QTableWidget/QTableView accepting QStringList data

    4
    0 Votes
    4 Posts
    5k Views
    G
    As the models are QVariant based, you can pass as QStringList as value for an index without problems. You then pass the string list to the delegate - more correctly, the view calls the delegate with the index in question and the model it belongs to. The delegate is is responsible for splitting it up and displaying it in the way you want. The [[Doc:QAbstractItemDelegate]] API docs show you a small example for a paint method.
  • Is there anything wrong in doing this way with threads?

    4
    0 Votes
    4 Posts
    4k Views
    G
    I would create one class per service. otherwise you have to use a vector of threads internally. From OOPs POV, it makes more sense to make one service = one class. That's why the second proposal looks better to me. One class = one service. And running the servoce can then be done anywhere else (in a "ServiceStarter")
  • Error when include "MSR_NuiApi.h" in project [Kinect,OpenCV]

    2
    0 Votes
    2 Posts
    4k Views
    G
    First of all, it would be nice to also have a question, about what you want to know, so we have to guess. But I will try: You get warnigns and errors from MSR_NuiApi.h, and that is your problem, right? From the errors you get, I assume, that file is written for MSVS (dllimport, pragma warning, are MS tool chain specific things) but you compile your project with mingw (which does not know these things). Also In, Deref_out etc are also MS specifica.
  • [SOLVED] textEdit widget different background color

    9
    0 Votes
    9 Posts
    6k Views
    K
    i finally solved it. what i was looking for was a table in front of the background color code. that way the background is displayed for the full line, not just for the text. here is the code. i hope this helps someone. @ textEdit->insertHtml("&lttable&gt&lt/table&gt&ltp style='white-space: pre-wrap; background-color: #edffff; margin-top:3px; margin-bottom:3px;'&gt&ltfont color='blue'&gtthis&lt/font&gt: test&lt/p&gt");@
  • Can QSharedMemory be assumed to stay in physical memory?

    4
    0 Votes
    4 Posts
    2k Views
    T
    Thank you for your helpful answers.
  • Phonon's AudioOutput volume setting

    2
    0 Votes
    2 Posts
    3k Views
    A
    You should concentrate on the word "internally" when you have access to the source code: @static const qreal LOUDNESS_TO_VOLTAGE_EXPONENT = qreal(0.67); static const qreal VOLTAGE_TO_LOUDNESS_EXPONENT = qreal(1.0/LOUDNESS_TO_VOLTAGE_EXPONENT); void AudioOutput::setVolume(qreal volume) { K_D(AudioOutput); d->volume = volume; if (k_ptr->backendObject() && !d->muted) { // using Stevens' power law loudness is proportional to (sound pressure)^0.67 // sound pressure is proportional to voltage: // p² \prop P \prop V² // => if a factor for loudness of x is requested INTERFACE_CALL(setVolume(pow(volume, VOLTAGE_TO_LOUDNESS_EXPONENT))); } else { emit volumeChanged(volume); } Platform::saveVolume(d->name, volume); }@ I guess, you could call setVolume(pow(yourValue, 1.0/0.67)) if you want to cancel their exponentiation. And according to the gstreamer backend source code, for example, the range is 0.0 - 1.0 (but gstreamer can accept values up to 10.0).
  • Scientific Calculator application in Qt

    4
    0 Votes
    4 Posts
    4k Views
    ?
    You can use it , for example : @ void MainWindow::on_actionCopy_triggered() { ui->textEdit->copy(); } @ [EDIT: code formatting, please wrap in @-tags, Volker]
  • [Solved] Slow program and QProgressDialog problems

    10
    0 Votes
    10 Posts
    8k Views
    F
    Just as a side note, composing query using strings as you do in the switch statement is a bad idea. Use prepared queries instead.
  • Close button pressed signal in the QDockWidget

    17
    0 Votes
    17 Posts
    16k Views
    R
    It was my mistake - override setVisible() Once again thank you for your help!
  • [solved]Can Qt download a setup say .msi/.exe files?

    15
    0 Votes
    15 Posts
    7k Views
    G
    Just as a side note for the archive: In those cases, it's often useful to test the operation with a command line utility like "curl":http://curl.haxx.se/. Calling it with some verbosity switch you can see what's going on, including redirects, the complete HTTP headers, etc. Browsers usually hide that stuff to you.
  • [solved] Exporting a QGraphicsView from one QFrame to another

    5
    0 Votes
    5 Posts
    4k Views
    X
    Qt is incredible! I got the solution in few lines relatively: I create a QDialog based class with my QGraphicsScene object (scene) as constructor parameter Inside the QDialog I created a QGraphicsView variable (graphicsView) I set the Scene to the View doing: graphicsView->setScene(scene); I included the QGraphicsView object inside the Layout of the QDialog: layout->addWidget(graphicsView); When I open the dialog... voilà! I need to work in some details around, but the result is impressive! Thank you again guys :)
  • Populate treelist help

    6
    0 Votes
    6 Posts
    4k Views
    D
    i put a qFatal error into @while (qry.next()){...}@ and seems doesnt enter into while when used by search query
  • GDB cannot find a valid python installation?

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • [solved] Helper class to open a connection to an defined database

    3
    0 Votes
    3 Posts
    2k Views
    F
    Yes Eddy, thanks !
  • QDialog with both Minimize and Help button?

    3
    1 Votes
    3 Posts
    4k Views
    R
    I have been doing this on Windows Vista and Windows 7 so I tried RedHat Linux. On RHEL, only the close (X) button shows up.
  • QSemaphore's release() does not immediately notify waiters?

    3
    0 Votes
    3 Posts
    2k Views
    P
    Thanks for your reply. This is interesting behavior and I'm glad I now know it. I assumed that releasing a resource like a semaphore or mutex would immediately look for waiting threads and perform a context switch to grant them the resource in place. Instead, it looks like OS scheduling continues as normal. I'm sure a lot of this is OS-dependent, but it's good to know that some behave like this. also: "link":http://stackoverflow.com/questions/8003305/qt-qsemaphores-release-does-not-immediately-notify-waiters