Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • My modbus connection status stay on connecting forever.

    Unsolved
    10
    1 Votes
    10 Posts
    1k Views
    Z
    @J-Hilk said in My modbus connection status stay on connecting forever.: connect(modbusDevice, &QModbusTcpClient::errorOccurred, this, [](QModbusDevice::Error error)->void{qDebug() << "error happened :" << error}); check this link you will find a solution: https://forum.qt.io/topic/125391/modbusclient-as-a-console-application-stuck-in-connectingstate-loop/3
  • setIcon crash when i'm using tableView

    Solved
    3
    0 Votes
    3 Posts
    280 Views
    F
    @eyllanesc Thank you! Indeed, the (2,2) case was empty...
  • Is "moc" actually helping to debug?

    Unsolved
    6
    0 Votes
    6 Posts
    848 Views
    kshegunovK
    @AnneRanch said in Is "moc" actually helping to debug?: Let me put this the silliest way - if I do not have an object BT_TabWidget constructed nowhere in the code then I am getting "you are missing destructor SOMEWHERE " from all of this. And I will not ask why I am not getting "no BT_TabWidget (object) found " instead., So I will go back to code and verify all BT_TabWidget CODE myself. When you compile stuff, the assembly is generated for the classes not the objects. There's no requirement that you must have an instance of some class to have the latter compiled into code. Or to put it the silliest way I can think of: classes are not objects, nor vice versa. As far as C++ goes, all virtual functions shall be defined if they're not a pure virtual for the build process to succeed, and if you go through your code I'm sure you're going to find out that this particular class has a destructor, which was declared (hence it's an override due to its base class' destructor being virtual), and that destructor hasn't been defined. @wrosecrans said in Is "moc" actually helping to debug?: I don't have any children. Can you tell me where my son Gary isn't? It's impossible to point to a specific place and say that's where something isn't. lol! If it doesn't exist, it isn't everywhere. We could argue some quantum mechanics about that ... ;)
  • Redirecting all cout statements to textEdit box

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    Kent-DorfmanK
    https://stackoverflow.com/questions/18086193/redirect-stdout-stderr-to-file-under-unix-c-again top link in google search. moving the text from the redirected stream is left as an exercise for the reader. Hint involves a stream reader and a signal linked to the TextEdit::SetText() slot.
  • Update / repaint a QWidget while it is hidden

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    S
    This is solved using self.subtext.repaint() right after the clear() for the QTextEdit, as well as with using a key indicating whether or not the update is finished. We test this key in the paintEvent of the QFrame to effectively paint the new background only when everything is ready.
  • 0 Votes
    5 Posts
    2k Views
    T
    @JonB yes the path to the .dll ist right - the weird thing is that one function works fine but the others won't The error I am receiving is: Unkown error.
  • This topic is deleted!

    Unsolved
    12
    0 Votes
    12 Posts
    45 Views
  • QRect and QAction

    Solved
    16
    0 Votes
    16 Posts
    1k Views
    SGaistS
    Then I think you took the problem from the wrong end. You seem to want to force a conventional GUI to be adapted to an unconventional input device. I think you should rather design your application with unconventional widgets that fits the input device. From the looks of it, your menu's entries will get highlighted one after the other and the user shall click on the button in order to select the action but how will the user get to this menu in the first place ? And even before that, what will be the goal of your application ?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Remove QTableWidget header separator line

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    H
    @SGaist Thank you, the code works now I will try integrating it into my project.
  • Copying external dlls to destination directory

    Solved
    3
    0 Votes
    3 Posts
    307 Views
    U
    @Uday-More said in Copying external dlls to destination directory: copyQtdata.commands += $(COPY_DIR) /f $$shell_path($$(MYLIB_HOME)\bin\mylib.dll) $$shell_path($$DESTDIR) The command has to be changed to copyQtdata.commands += $(COPY_DIR) /f $$shell_quote($$(MYLIB_HOME)\bin\mylib.dll) $$shell_path($$DESTDIR) Note : shell_path has been changed to shell_quote. It works.
  • Disable IME for QML TextField

    Unsolved
    1
    0 Votes
    1 Posts
    256 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    18 Views
    No one has replied
  • QGroupBox, 2 Radio Buttons, not big enough

    Unsolved
    4
    0 Votes
    4 Posts
    270 Views
    SPlattenS
    @JoeCFD , thank you for the response, my widgets are manually positioned and added to groups in code. Yes, I create the QGridLayout first then a QGroupBox, I've resolved this issue now.
  • QCharts, "undeclared identifier"--what's wrong with it?

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    P
    You should add "QT_CHARTS_USE_NAMESPACE" first.
  • Modbusclient as a console application, "Stuck in Connectingstate loop"

    Solved
    5
    0 Votes
    5 Posts
    608 Views
    Z
    @JonB yes it worked now i need to change it to a function.
  • QTimer destructors

    Unsolved
    4
    0 Votes
    4 Posts
    660 Views
    P
    You simply need to defer starting the timer until after the thread is started because the thread has a different event loop and you want the timer running that event loop not the main thread's. Assume you have two objects, a QThread and a QObject-derived object you want to run in that thread, e.g. class MyWorker : public QObject. Create a slot MyWorker::OnThreadStarted and there is where you wire up the timeout and start the timer. The essential code to start the thread is below. // main thread application code MyWorker *worker_ = new MyWorker; // do not parent the QObject QThread worker_thread_; worker_->moveToThread(&worker_thread_); connect(&worker_thread_, &QThread::started, worker_ , &MyWorker::OnThreadStarted); connect(&worker_thread_, &QThread::finished, worker_, &QObject::deleteLater); worker_thread_.start(); N.B. The timer should be a member of MyWorker and parented to MyWorker. It's ok to create the timer in the main thread, e.g. in the constructor of MyWorker, but you must defer starting it until the thread is running. Somewhere else in your main application, perhaps a close event, you would typically stop and wait for (join) the worker thread: worker_thread_.stop(); worker_thread_.quit()
  • 0 Votes
    12 Posts
    2k Views
    J
    Okay, I had absolutely believed that I had tried making the call to my savePos() function to try to diagnose whether the signal had something to do with it, yet when I disable the connect()ion altogether and call it explicitly, now these APIs want to behave like good little children and do what they're supposed to. So, essentially I shot myself in the foot by handling this with modelAboutToBeReset(), which implicitly trashes the internal cache of visible indexes. D'oh! Argh, etc. Thanks for the help, folks.
  • Deployment win10

    Unsolved
    4
    0 Votes
    4 Posts
    570 Views
    JKSHJ
    windeployqt is for deploying Qt applications, as its name suggests. So, it can't be used to deploy a non-Qt app. @bence said in Deployment win10: Is there any other way to run the pure c++ code? You don't need any special tools for that. Just copy and paste the required MinGW DLLs into the same folder as your app. If you try to run your app but a required DLL is missing, you will get a pop-up dialog that tells you which DLL it needs.