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 insert QProgressBar in QTableWidget cell

    4
    0 Votes
    4 Posts
    10k Views
    A
    Or, take a look at libQxt. It has a "delegate":http://libqxt.bitbucket.org/doc/0.6/qxtitemdelegate.html that can do this without relying on adding widgets explicitly, and that works with data from the model itself.
  • [Closed] Very cheap on moveEvents calls

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    A
    [quote author="Lukas Geyer" date="1332227272"]Duplicate of https://qt-project.org/forums/viewthread/15566/.[/quote] Indeed, so I am closing this one.
  • A new question about database????

    3
    0 Votes
    3 Posts
    2k Views
    A
    And you should select an actual database at that. Not just a driver.
  • 0 Votes
    3 Posts
    2k Views
    L
    On a sidenote: adding multiple punctuation marks at the end or in between your question does not emphasis the importance of your question, it just keeps some people away from reading your post at all, as such a behaviour can be seen as a major annoyance. If you want to get the most of these forums (or forums in general) make sure you have read "this":http://www.catb.org/~esr/faqs/smart-questions.html at least once.
  • Qt Cheap On moveEvent calls...

    4
    0 Votes
    4 Posts
    3k Views
    L
    I don't think that Qt artificially filters move events. If you don't get more Qt doesn't get more either. But I have to admit that I'm not a Mac expert.
  • QTableView and ResizeRows(Columns)ToContents

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • QUdpSocket Echo Server : Client Recv Problem

    5
    0 Votes
    5 Posts
    7k Views
    I
    [quote author="favoritas37" date="1332196902"]You need to call "QAbstractSocket::connectToHost":http://qt-project.org/doc/qt-4.8/qabstractsocket.html#connectToHost function at your client application and you will be fine.[/quote] It's OK. But I think the Qt's Socket Api is much different from typical C socket api. I mean there is no api corresponding to connectToHost in C socket.
  • Control mouse pointer with Qt even outside the Qt application.

    3
    0 Votes
    3 Posts
    5k Views
    K
    i tried to set the focus using SetFocus(GetActiveWindow()); but there was no success. The control jumps to the next window onto which i click using my 'O' key(i have assigned O Key to perform single click). Any remedy for this?
  • 0 Votes
    11 Posts
    25k Views
    A
    Thanks a lot! everything is working fine now. Thanks again!
  • QTcpSocket & QAudioInput

    3
    0 Votes
    3 Posts
    3k Views
    A
    @Client::Client(QObject *parent) : QObject(parent) { Socket = new QTcpSocket(this); connect (this->Socket,SIGNAL(connected()),this, SLOT(SendTocToc())); connect (this->Socket,SIGNAL(error(QAbstractSocket::SocketError)),this,SLOT(getError())); connect (this->Socket,SIGNAL(readyRead()), this, SLOT(readSocket())); QAudioFormat format; // Set up the format, eg. format.setFrequency(32000); format.setChannels(1); format.setSampleSize(8); format.setCodec("audio/pcm"); format.setByteOrder(QAudioFormat::LittleEndian); format.setSampleType(QAudioFormat::UnSignedInt); QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice()); if (!info.isFormatSupported(format)) { qWarning()<<"raw audio format not supported by backend, cannot play audio."; return; } audio = new QAudioOutput(format, this); connect(audio,SIGNAL(stateChanged(QAudio::State)),SLOT(finishedPlaying(QAudio::State))); audio->setBufferSize(512000); } void Client::readSocket() { if (audioincoming) { if (!audio->state() == 0 ) QTimer::singleShot(3000,this,SLOT(startAudio())); return; } //[...] } void Client::startAudio() { audio->start(this->Socket); } @ Now it works. I initialize QAudioOutput only on class constructor but I must delay a bit to "load buffer". So I tried to start QAudioOutput object after 3 secs, but I would to use a more efficient way. If I don't delay, audio lags and QAudioOutput crashes. Any suggestions?
  • How to change fore-ground color of progress-bar

    5
    0 Votes
    5 Posts
    4k Views
    A
    Thanks! perhaps I needed this.
  • New to this, some questions

    4
    0 Votes
    4 Posts
    2k Views
    I
    I have access to the Safari online books thing, and that one happens to be there -- Now i have one to start with. And I did read the documentation, but I suppose i skipped right over the (0) part. I tried it, and it worked perfectly. Thank you both of you!
  • [SOLVED] QMetaObject::invokeMethod thread safety

    8
    0 Votes
    8 Posts
    9k Views
    M
    [quote author="Lukas Geyer" date="1332156728"]It is absolutely valid that multiple threads access the same pointer at the same time for reading. You are in trouble if at least one thread writes to a shared memory location, in which case you will have to serialize access (using locks or mutexes).[/quote] It's clear now, thanks a lot!
  • 'QTableView' with per column 'minimumSectionSize'

    2
    0 Votes
    2 Posts
    2k Views
    G
    Enhancement requests better go into the "public bugtracker":https://bugreports.qt-project.org. This forum is not monitored by the Qt developers.
  • QThread, signal/slots

    3
    0 Votes
    3 Posts
    6k Views
    A
    I don't think a forever loop (or another tight loop) is a bad thing per sé in a separate thread. It may just be the most efficient and/or easiest solution for a specific case. Sure, you won't receive signals, but if you don't need to, I don't see the problem.
  • Qprocess arguments problem

    8
    0 Votes
    8 Posts
    10k Views
    G
    The only suggestion is: Use what works for you! There is no need to change a running system.
  • Can I search for files via QtConcurrent?

    3
    0 Votes
    3 Posts
    2k Views
    G
    Using QtConcurrent can even worse the situation as OS caches might get flushed once the next thread is running and the data needs to be re-read if the first thread is active again.
  • QtcpServer lost message

    6
    0 Votes
    6 Posts
    3k Views
    K
    It is a bit hard to provide a sound advice. Your example is a bit obscure for me. Typically you would have a type of header for a message. This header may have additional information or just the length of information you are sending. I assume that the first byte you are sending in the first line has the function as header. Then you seem to dump a number of bytes. However, how does the counterpart know the number of bytes sent? You could use something like this: @ bool TcpSocket :: write (const std :: string & str) { int len = int (str.length()); if (! write ((char *) & len, sizeof (len))) return false; if (len > 0) if (! write ((char *) & str [0], len)) return false; return true; } @ This writes the number of bytes (here the length of the string). Afterwards the string is sent byte by byte. On the counterpart you would receive the length of teh string and know exactly the number of bytes to follow. My guess is that this is currently your problem. You receive an event and read all bytes, but in fact you are receiving two messages without recognizing that.
  • GetTickCount() in QT ?

    3
    0 Votes
    3 Posts
    8k Views
    R
    i need it for to communicate with DHCP server
  • 0 Votes
    7 Posts
    7k Views
    V
    Actually we are migrating from a very old version of Qt (3.0.4) to Qt(4.8.0). So, along the course, i am trying to use new features provided by Qt, which can be quickly implemented without major change in existing code structure.