Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt library and use QLocalServer
Forum Update on Tuesday, May 27th 2025

Qt library and use QLocalServer

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    red_spider
    wrote on 29 Dec 2014, 19:38 last edited by
    #1

    Hi there this situation

    I wrote on Qt library which should connected to Client, decided to use to connect QLocalServer and QLocalSocket,
    but faced with the fact that QLocalServer need QApplication, I tried to create a new thread, but to no avail.
    now I have no idea how to implement maybe someone knows a solution?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 29 Dec 2014, 21:59 last edited by
      #2

      Hi,

      Something's not clear: should your library be usable with non Qt application ?

      What OS/Qt version are you using ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        red_spider
        wrote on 29 Dec 2014, 23:04 last edited by
        #3

        blender API Python <> my Qt library <> Qt Aplication

        blender load my library through ctypes, a library is to communicate with the main program, the connectivity must work on Windows, Linux, Mac.
        sample used for http://developer.nokia.com/community/wiki/Qt_IPC_using_QLocalSocket_&_QLocalServer

        used Qt 5.3.2

        when sent from the library in the program everything is fine, and Feedback not, because The libraries can not handle QLocalServer because there is no loop events.

        thanks for the help.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          red_spider
          wrote on 24 Jan 2015, 21:47 last edited by
          #4

          I solved the problem)) for example took article http://qtsimple.blogspot.com/2013/10/dll-noqt.html

          using
          @#include <pthread.h>

          void * thread1(void * arg)
          {
          QCoreApplication * app = NULL;
          int argc = 0;
          app = new QCoreApplication(argc, NULL);

          ConLib * loadLib = new ConLib();
          app->exec&#40;&#41;;
          

          }

          void loadLibrary()
          {
          pthread_t tid1;

          int t_arg = 5;
          int err;
          err = pthread_create( &tid1, NULL, &thread1, &t_arg);
          
                  if (err != 0)
                      printf("\ncan't create thread :[%s]", strerror(err));
                  else
                      printf("\n Thread created successfully\n");
          

          }@

          Thank you all for your help.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 24 Jan 2015, 23:41 last edited by
            #5

            Sorry, I've lost track of this thread.

            One thing that puzzles me, you have a memory leak since you instantiate loadLib but never delete it.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved