Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.2k Topics 455.4k Posts
  • 0 Votes
    16 Posts
    5k Views
    SGaistS
    You're welcome ! Just edit your original post and update the thread title :)
  • Basic Drawing Example getting error´s

    5
    0 Votes
    5 Posts
    1k Views
    Flaming MoeF
    Hm, i got it working. I copied again the content of every provided code file into the creators editor AND i made following change since i had an issue with the puzzle example as well wich was solved by this change: original qrc file: @ <!DOCTYPE RCC><RCC version="1.0"> <qresource> <file>images/brick.png</file> <file>images/qt-logo.png</file> </qresource> </RCC> @ my qrc file @ <!DOCTYPE RCC><RCC version="1.0"> <qresource prefix="/"> <file>images/brick.png</file> <file>images/qt-logo.png</file> </qresource> </RCC> @
  • [Solved] QTcpSocket not writing to socket

    3
    0 Votes
    3 Posts
    4k Views
    P
    Ok... this is really getting aggravating. The only solution I have found so far is to use QTcpSocket.flush(). But even if I set up a signal and socket connection to handle the signal this should generate, nothing happens. So it is time to post some code. Here is the code that generates the tcp socket. It is part of "main" because my splash screen contains the login screen and the login data to send is generated there. w is the main window class instance while a is the application class @ int main(int argc, char *argv[]) { // creates splash // detects network configuration ... saves in w // loads application settings... saves in w // handles arguments // shows login widgets and waits for user input ... while (waitForResponse) { QTcpSocket loginSocket; if (w.getServerAddress() == QString("LOCAL")) loginSocket.connectToHost(w.getHostAddressIn()->toString(), (quint16)ServerPorts::loginRequest); else loginSocket.connectToHost(*w.getServerAddress(), (quint16)ServerPorts::loginRequest); // generate datastream using username and password // code for connecting the socket which works fine... // HERE is the code that calls the code that doesn't get a response... w.sendLoginData(dataStream->data(), &loginSocket); while (w.isSendingLogin()) a.processEvents(); // THE PROGRAM NEVER LEAVES THIS LOOP ... } ... } @ Here are the two functions called by the previous code. It may be important to note that the client engine class referred to is in a separate dll and namespace. My guess is that fact separates the code from the main window's event loop. @ bool MyWindow::isSendingLogin() { return mClientEngine->isSendingData(); } void MyWindow::sendLoginData(const char* data, QTcpSocket* socket) { if (mClientEngine == NULL) mClientEngine = new ClientEngine(this); mClientEngine->sendDataToServer(data, socket); } @ Here is the code from the dynamically loaded engine called by the above functions. This includes the code that performs the flush AND the slot that is supposed to be called as a result. @ void ClientEngine::sendDataToServer(const char* data, QTcpSocket* socket) { mBytesSentCount = 0; mOutgoingSocket = (QTcpSocket*)socket; connect(socket, SIGNAL(bytesWritten(qint64 bytes)), this, SLOT(dataSent(qint64 bytes))); mOutgoingByteCount = socket->write(data); socket->flush(); } void ClientEngine::dataSent(qint64 bytes) // SLOT referred to in above connection that NEVER GETS CALLED { mBytesSentCount += bytes; if (mBytesSentCount >= mOutgoingByteCount) { disconnect(mOutgoingSocket, SIGNAL(bytesWritten(qint64 bytes)), this, SLOT(dataSent(qint64 bytes))); mOutgoingSocket = NULL; } } bool ClientEngine::isSendingData() const { return mOutgoingSocket != NULL; } @ My best guess is that because the engine is in a separate dll, that somehow its signals are being left out of the event loop... Not sure how I would fix that... or if it is even the problem.
  • 0 Votes
    6 Posts
    1k Views
    O
    and what i want is just increase the editbox's width. while the other controls such as lable's width stays unchanged.
  • MQTT3.1.1 Implementation in QT

    4
    0 Votes
    4 Posts
    3k Views
    A
    This library is 2 years old. I don't know when MQTT 3.1.1 was accepted so it is possible that the library is a bit outdated. However if this library implements the required protocol and satisfies your requirements then you can link it as static or shared library to your project.
  • Interacting of graphical Forms

    3
    0 Votes
    3 Posts
    672 Views
    Flaming MoeF
    ^^ yea, don´t know, why i didn´t tjought of typing "qt puzzle" to google... First thing i did totday. Epic fail ;-)
  • Is QDialog the best container to put some ui controls on it?

    2
    0 Votes
    2 Posts
    551 Views
    IamSumitI
    Hi opengpu.. you should know the differences among QDialig,QMainWindow and QWidget. Then decide... but as far as QDialog is concern it is only for short term purpose. see the difference . http://qt-project.org/forums/viewthread/26619 hope it helps
  • Context sample?

    2
    0 Votes
    2 Posts
    644 Views
    A
    Do you mean a "context menu":http://qt-project.org/doc/qt-5/qtwidgets-mainwindows-menus-example.html example ?
  • [SOLVED] - Access stdin from qml/js

    2
    0 Votes
    2 Posts
    642 Views
    dheerendraD
    No you can't access.
  • [SOLVED]my Inherited QImageIOPlugin doesn't work!

    6
    0 Votes
    6 Posts
    2k Views
    N
    thanks. it worked!
  • Using the Qt IDE as a software tool for scripts.

    6
    0 Votes
    6 Posts
    1k Views
    SGaistS
    In the "download":http://qt-project.org/downloads section of the site. Click on Show downloads, scroll to Qt Creator and you have the possibility to download the correct archive (zip for windows, tar.gz for the others)
  • Help laying out dynamically sized window

    Locked
    1
    0 Votes
    1 Posts
    391 Views
    No one has replied
  • 0 Votes
    2 Posts
    2k Views
    SGaistS
    Hi, Without seeing any part of your code, it's crystal ball debugging. Please show us the related classes
  • Drag & drop, modifying the Cursor for IgnoreAction ?

    2
    0 Votes
    2 Posts
    744 Views
    SGaistS
    Hi, If you want that right now, you'll have to build Qt yourself with the modification
  • FullScreen with QVideoWidget under GNU/Linux

    5
    0 Votes
    5 Posts
    3k Views
    gagiDG
    I used this for MainWindow and it's work fine: @ void MainWindow::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Escape) { neki->setParent(this); neki->showNormal(); event->accept(); } else { MainWindow::keyPressEvent(event); } } void MainWindow::fS() { neki->setParent(0); neki->showFullScreen(); } @ But if i try this on QWidget which is child of QMainWindow it fails.
  • QMainWindow showMaximized() only works once...

    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    Hi, Can you show the code where you do both ? Also, what version of Qt on what OS are you running ?
  • [SOLVED] need advice whether using OpenGL or not

    4
    0 Votes
    4 Posts
    1k Views
    Z
    It depends how deep you go into Qt Quick2. If you need custom items you need to understand geometry (positions, colors, other per vertex attributes) and custom materials which then leads into shaders. It all depends what kinds of effects you want to do.
  • 0 Votes
    2 Posts
    1k Views
    SGaistS
    Hi and welcome to devnet, Pretty strange indeed, can you check whether the slider has mouse tracking enabled ? If not, the difference is normal, otherwise there's something wrong. In any case, the valueChanged signal seems more suited to your purpose. Also, what combo of Qt/OS/Compiler are you using ?
  • QString Result from QSettings

    3
    0 Votes
    3 Posts
    1k Views
    A
    In your code I don't see closing endGroup() for @ Recipes.beginGroup(CurrentRecipe->RecipeName); @
  • File permissions

    2
    0 Votes
    2 Posts
    812 Views
    N
    This mean that only the owner (of the directory) has the write permission. Please change the directory and re-try.