Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Very basic deployment questions

Very basic deployment questions

Scheduled Pinned Locked Moved Installation and Deployment
13 Posts 2 Posters 3.4k Views
  • 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.
  • N Offline
    N Offline
    nxshar2
    wrote on last edited by
    #1

    Very new to qt so please excuse my ignorance.
    I already have a console command line program which i want to port to a ui.
    The console program will either run on ubuntu server/ red hat linux without a graphical interface.
    The basic idea I formed after some research was to use a client server model like fortune example.
    I tried to deploy the fortune server to my ubuntu server but it failed with libQt5widgets.so dependency.

    So first question is, do I need to install qt on all systems I intend to run programs on? I was under the impression that I could deploy them prepackaged once developed.

    second, even after hours of googling and going through docs, I didn't find a way to deploy qt libraries etc. to non X server systems like ubuntu server and red hat. What libraries will i need to install on each system assuming I don't need ui components. I already have qt creator installed on my dev system.

    Thirdly, Is there an option of creating a remote ui kind of setup where my code runs on the remote machine without ui but ui gets rendered on a client machine which can be windows/ ubuntu 12.04 standard desktop. This might be just me daydreaming but if possible this could avoid me a lot of event handling etc.

    Finally for this scenario where I only want ui on the client machine which fires basic calls etc, what should i look into qtTcpsocket or event slot and listen?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Since you are probably not using any widget, edit your pro file and look for something like
      @QT += widgets@

      Remove that line, so the dependency will be dropped.

      You don't need to install all the libraries, you can package your application with only what your application needs. Look "here":http://qt-project.org/doc/qt-5/linux-deployment.html for instructions.

      You only need to provide what your application is needing. c.f. the link above.

      It's a typical client/server implementation. You an e.g. expose a web service that will control you command line application or build your own server like the fortune example.

      Hope it helps

      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
      • N Offline
        N Offline
        nxshar2
        wrote on last edited by
        #3

        Thanks Sgaist,
        When I removed QT += widgets, it started giving me all sorts of error in server.cpp and server.h with all Qt files like Qtdialog etc. don't think it's as straightforward as that or am i not understanding something very basic. Granted it's been more than 8 hours on this issue for me.
        The web service thought has crossed my mind more than once. Only question is if I have to go that route why not drop Qt alltogether and use something like cgi etc though I am inclined to learn Qt for long term benefits.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Well, if you are using widget related stuff in your server code the your can't drop the dependency. Since the code is meant to be command line only (if I understood your correctly) then don't put any widgets in there. Make a separate application that knows how to talk to your cli application.

          You an also write it in Qt ;-)
          But it is up to you. Use the tool that is best suited for your needs :-)

          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
          • N Offline
            N Offline
            nxshar2
            wrote on last edited by
            #5

            Sgaist,
            thanks again. but to confirm one of the important points, it is possible to use qt with server side installs like ubuntu server or redhat.
            granted, I will have to look into details into static compiles of dependencies etc.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Yes, it's possible, take a loot at the Qt Cloud Services

              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
              • N Offline
                N Offline
                nxshar2
                wrote on last edited by
                #7

                That is a seperate product right?
                does that mean standard products developed using QtCreator only can't be run on non X environments like ubuntu server?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Indeed, it's a new service Digia is offering.

                  Yes they can, but you need to deploy the thing properly using e.g. the offscreen plugin. The real question here is: does make sense to have the GUI builtin that server software or should it rather be a pure CLI where you provide a secondary GUI software that uses that CLI ?

                  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
                  • N Offline
                    N Offline
                    nxshar2
                    wrote on last edited by
                    #9

                    Thanks Sgaist,
                    My plan is to have two softwares only. One a pure cli which is run on server side and a command ui which communicates with the CLI.
                    I want gui to be able to just start stop the cli and retrieve some data from cli when needed.
                    Also, want to be able to see all the std output from cli on the gui side.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Then QProcess is your friend

                      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
                      • N Offline
                        N Offline
                        nxshar2
                        wrote on last edited by
                        #11

                        SGaist,
                        I was trying to play around with QProcess. I built a ui with widgets and added just one button. on button click I added a Qprocess code to start a precompiled c++ executable. Here it is. But when I click the button it fails and crashes. I picked the code from QProcess page on the site itself.

                        @
                        void MainWindow::on_startButton_clicked()
                        {
                        QObject * parent;
                        QString program = "./path/exec";
                        QStringList arguments;
                        arguments << "";

                          QProcess *myProcess = new QProcess(parent);
                          myProcess->start(program, arguments);
                        

                        }
                        @

                        [edit: added missing coding tags @ SGaist]

                        1 Reply Last reply
                        0
                        • N Offline
                          N Offline
                          nxshar2
                          wrote on last edited by
                          #12

                          I changed the code in click function to below.
                          Now it doesn't give any errors but still I don't see any result files generated by the execution

                          @
                          QString program = "./path/exec";
                          QProcess *myProcess = new QProcess(this);
                          myProcess->start(program);
                          @

                          [edit: added missing coding tags @ SGaist]

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            In you first example parent is not initialized hence the crash.

                            "./path/exec" is a relative path to the current path. You should rather give the fullpath to exec.

                            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