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. How to designed the program that without UI

How to designed the program that without UI

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.1k 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.
  • V Offline
    V Offline
    victor wang
    wrote on last edited by
    #1

    Hi All,
    I'm using QT5.5 on my computer and linux+QT for my OS system.
    I wanna designed a program that can send the command to MCU via RS232.
    I want to do it without any UI.
    How can I do that?

    Thanks in Advanced!

    1 Reply Last reply
    0
    • JohanSoloJ Offline
      JohanSoloJ Offline
      JohanSolo
      wrote on last edited by
      #2

      When creating your project, simply select "Qt Console Application".

      `They did not know it was impossible, so they did it.'
      -- Mark Twain

      V 1 Reply Last reply
      1
      • JohanSoloJ JohanSolo

        When creating your project, simply select "Qt Console Application".

        V Offline
        V Offline
        victor wang
        wrote on last edited by
        #3

        @JohanSolo
        Thanks!
        But I am facing the other problem.
        I can't find this file when I included.

        #include <stdio.h>
        #include <string.h>
        

        This is my .pro file.

        QT +=core
        QT+=serialport
        QT-=gui
        
        TARGET=mcu
        CONFIG+= console
        CONFIG+=app_bundle
        
        TEMPLATE=app
        
        SOURCES+=main.cpp
        

        Why I can't find it in QT console?
        And I can find the file when i create in QT Application?

        Thanks in Advanced!

        jsulmJ 1 Reply Last reply
        0
        • JohanSoloJ Offline
          JohanSoloJ Offline
          JohanSolo
          wrote on last edited by
          #4

          AFAIK CONFIG += app_bundle is only valid for macOS, but I don't know whether it hurts (I guess not).

          How did you install Qt (QT is Apple's QuickTime)?

          Is is possible you don't have the dev C++ libs? Btw stdio.h is a C header, the C++ one is cstdio, and in a similar way, use cstring instead of string.h.

          `They did not know it was impossible, so they did it.'
          -- Mark Twain

          1 Reply Last reply
          0
          • V victor wang

            @JohanSolo
            Thanks!
            But I am facing the other problem.
            I can't find this file when I included.

            #include <stdio.h>
            #include <string.h>
            

            This is my .pro file.

            QT +=core
            QT+=serialport
            QT-=gui
            
            TARGET=mcu
            CONFIG+= console
            CONFIG+=app_bundle
            
            TEMPLATE=app
            
            SOURCES+=main.cpp
            

            Why I can't find it in QT console?
            And I can find the file when i create in QT Application?

            Thanks in Advanced!

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by jsulm
            #5

            @victor-wang said in How to designed the program that without UI:

            #include <stdio.h>
            #include <string.h>

            Why do you want to use C instead of C++?
            If you really want do it like this

            #include <cstdio>
            #include <cstring>
            

            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