Skip to content
QtWS25 Last Chance
  • 0 Votes
    1 Posts
    32 Views
    No one has replied
  • Building a DLL on macOS for a non Qt application

    Solved General and Desktop mac dll macos thread
    9
    0 Votes
    9 Posts
    740 Views
    B
    @IgKh Thank you for your precious help, things are a lot clearer now. Further tests have shown that most of the features I need still work without a call to exec(). I still can't quite understand what in my example started the event loop or if Qt just plugs in the existing NSApplication's event loop. @IgKh said in Building a DLL on macOS for a non Qt application: Had no effect on the main issue though Can you, just for sake of clarity, state the remaining issues? The main issue i refered to was me wanting to have a separate thread with a QApplication in it and the Qt::AA_PluginApplication attribute had no effect on this. The other issues I have are not within the scope of this topic though. Thank you very much !
  • Qt 6, Qt.Future .then freezess app

    Unsolved General and Desktop qfuture thread
    6
    0 Votes
    6 Posts
    431 Views
    D
    @SGaist I have QApplication - gui one. ah yes the int main() is just a quick hack/example... there full widget app with buttons running :- ) Also I got it to work, I ended up getting nested futures, and the path to fix that is .unwrap()>https://doc.qt.io/qt-6/qfuture.html#unwrap Seems to work! :D Threading and linking to context still seem to be broken tho o.o
  • undefined reference on emit function

    Unsolved General and Desktop thread emit signal connect
    4
    0 Votes
    4 Posts
    573 Views
    jsulmJ
    @JuanNunez I deleted my first response as I did not realised that it was about a signal and one does not have to implement a signal. Did you try a complete rebuild after adding signal? Delete build folder, run qmake and build.
  • How to use the connect

    Unsolved General and Desktop thread connect
    3
    0 Votes
    3 Posts
    410 Views
    J.HilkJ
    @JuanNunez said in How to use the connect: unresolved overloaded function type addItem has multiple overloads and the connect cont resolve which one to use. https://doc.qt.io/qt-5/qtglobal.html#qOverload also don't use threads. I'm 90% sure you don't know what your doing, and don't need them in the first place
  • 0 Votes
    24 Posts
    3k Views
    jsulmJ
    @Dean21 Please show your current code if something does not work...
  • How can I use functions from a class in a thread?

    Unsolved General and Desktop thread qthread
    2
    0 Votes
    2 Posts
    312 Views
    JonBJ
    @Uriel-Machado Hello and welcome. Before you go any further: since it is a Qt rule you must not access any UI stuff in a secondary thread --- quite apart from the need for mutexes --- what do you think you are going to access in RadarGUI from a thread anyway? Threads can send signals to advise the UI thread of something happening and the UI thread can perform the UI action for them.
  • Plotting chart using lots of data

    Solved General and Desktop thread chart chartview
    8
    0 Votes
    8 Posts
    2k Views
    jsulmJ
    @StudyQt1 said in Plotting chart using lots of data: Is there a generic way to decide? Use a profiler. If you're using GCC you can use https://www.thegeekstuff.com/2012/08/gprof-tutorial/ Easier way which is often enough is simply to put debug output at the beginning and end of your methods/functions with timestamps and then check the output of your application while it is running.
  • 0 Votes
    5 Posts
    897 Views
    SGaistS
    Hi, Following @KH-219Design suggestion, you should have a task manager rather than relying on the task object itself to do all the job.
  • 0 Votes
    7 Posts
    948 Views
    JonBJ
    @Vivek_A I note that all your questions are about mongodb, its performance, and so on. Have you tried joining some mongodb forum where these might be better answered?
  • 0 Votes
    2 Posts
    1k Views
    VRoninV
    @LRDPRDX said in In what thread would a QObject be deleted if it was moved to another QThread?: the dtor must be called and executed in the secondary thread not the main one. Am I right? Correct, that's what connect(thread, &QThread::finished, worker, &QObject::deleteLater); does and as you noted> No more events will be processed in the thread, except for deferred deletion events. Do the deleteLater will still picked up after the finished is emitted and the destructor will run in the secondary thread
  • 0 Votes
    3 Posts
    468 Views
    SGaistS
    Hi, In addition to @Christian-Ehrlicher, what exactly are you trying to achieve ?
  • It does not create a chart

    Unsolved General and Desktop qt5 chart thread
    14
    0 Votes
    14 Posts
    1k Views
    jsulmJ
    @suslucoder What exactly can't you understand? In the documentation @SGaist posted there is even an example with signal/slot with parameter...
  • 0 Votes
    11 Posts
    3k Views
    D
    @Christian-Ehrlicher thank you, i understand my mistake and solve it.
  • 0 Votes
    5 Posts
    3k Views
    D
    @eyllanesc said in PySide2 & Threading... how to set data on widget from thread?: @Dariusz said in PySide2 & Threading... how to set data on widget from thread?: Do not implement the same logic in the same class so "manager" should only process the data and send it, then connect that signal to the GUI so that it updates the information. Class Worker(QObject): sendData = Signal(str) def process(self): value = "foo" self.sendData.emit(value) class GUI(QWidget): def apply_data(self, text): self.foo.setText(text) worker = Worker() thread = QThread() worker.moveToThread(thread) gui = GUI() worker.sendData.connect(gui.apply_data) QTimer.singleShot(0, worker.process) By default in the connection AutoConnection is used so since the sender lives in the second thread and the receiver in the main thread then QueuedConnection will be used. Hmmm thank you, but will this work with python Thread ? As the worker thread, I got is not Qt...
  • 0 Votes
    4 Posts
    806 Views
    SGaistS
    Hi, In your class declaration. Note that this is basic C++. If you do not know that, I highly encourage you to first improve your C++ knowledge before going further.
  • 0 Votes
    4 Posts
    3k Views
    C
    @jsulm: Thank you for your reply. The part I missed is "The default implementation simply calls exec()." @J.Hilk: Thank you for the great set of examples. IMHO, this should be placed in the QThread Class Documentation.
  • Can you create slots in main.cpp file?

    Solved General and Desktop thread connection slots signals
    20
    0 Votes
    20 Posts
    5k Views
    Pablo J. RoginaP
    @ples76 said in Can you create slots in main.cpp file?: I have solved the problem with all of your help Great, so please don't forget to mark your post as solved! I am trying to find the easiest solution to this since I am under the gun to get this done asap Although you find a solution now, you may want to take into account that having such a main() function is not a good idea as @Christian-Ehrlicher pointed out. So time (and stakeholders) permitting, you might want to look at refactoring your code...
  • GUI Freezes When Loop is Started

    Solved QML and Qt Quick qml qml dynamic loop function thread
    7
    0 Votes
    7 Posts
    2k Views
    C
    @jsulm U are da king! I am dealing with QML for months, and just learning the property variables! That kinda saved my life mate! Thank you very much!
  • messageBox not shown correctly

    Solved General and Desktop messagebox processevent thread
    4
    0 Votes
    4 Posts
    1k Views
    D
    Hi guys I solved this problem by adding a sleeping time duration in my worker thread preventing it from returning too quick. Then the message box gets shown properly and closed properly. // member function to do the job bool MainWindow::waitReply() { // Here to sleep for a while QThread::sleep(2); bool received_valid_reply = false; while (!m_waitReplyCancelled) { if (Something Is Received) { received_valid_reply = true; return received_valid_reply; } } return received_valid_reply; }