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. Open the selected port
QtWS25 Last Chance

Open the selected port

Scheduled Pinned Locked Moved Unsolved General and Desktop
serial portqt5combobox
5 Posts 3 Posters 719 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.
  • D Offline
    D Offline
    deleted286
    wrote on last edited by
    #1

    How can i get the current ports on a combo box and then open the choosen port?
    I want to open it when i run the program

    void MainWindow::open_Serial()
    {
        serial->setPortName("/dev/ttyUSB0");
        serial->setBaudRate(QSerialPort::Baud115200);
        serial->setDataBits(QSerialPort::Data8);
        serial->setParity(QSerialPort::NoParity);
        serial->setStopBits(QSerialPort::OneStop);
        serial->setFlowControl(QSerialPort::NoFlowControl);
    
        if (serial->open(QIODevice::ReadWrite))
        {
            qDebug() << "ttyUSB0  is Open ";
            serial->clear();
            write_Json();
            connect(serial, &QSerialPort::readyRead, this, &MainWindow::on_Serial_Read);
        }
    
        if(serial->isOpen())
        {
            ui->Open->setChecked(true);
        }
        else
        {
            ui->Close->setChecked(true);
         }
    }
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Do you think posting a question after it has answered already 1 week ago will give you another answer?
      https://forum.qt.io/topic/124316/find-the-current-port-and-open-it

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      D 1 Reply Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        Do you think posting a question after it has answered already 1 week ago will give you another answer?
        https://forum.qt.io/topic/124316/find-the-current-port-and-open-it

        D Offline
        D Offline
        deleted286
        wrote on last edited by
        #3

        @Christian-Ehrlicher what will change if i think it?
        Im just searching a solution to my problem. I solved it, you can delete my post.

        Pablo J. RoginaP 1 Reply Last reply
        0
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @suslucoder said in Open the selected port:

          you can delete my post.

          Why should I delete your post? I just asked why you open a new thread for a question which was answered for you one week ago.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1
          • D deleted286

            @Christian-Ehrlicher what will change if i think it?
            Im just searching a solution to my problem. I solved it, you can delete my post.

            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @suslucoder said in Open the selected port:

            I solved it, you can delete my post.

            No, the solved posts don't get deleted. They remain for the benefit of other forum users having same/similar issues.
            It's a community driven approach, opposite to a "my problem only" driven approach

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            3

            • Login

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