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. Terminal example [SOLVED]

Terminal example [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 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.
  • C Offline
    C Offline
    c77asper
    wrote on last edited by
    #1

    Hey :)

    @void SettingsDialog::fillPortsInfo()
    {
    ui->serialPortInfoListBox->clear();
    static const QString blankString = QObject::tr("N/A");
    QString description;
    QString manufacturer;
    foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
    QStringList list;
    description = info.description();
    manufacturer = info.manufacturer();
    list << info.portName()
    << (!description.isEmpty() ? description : blankString)
    << (!manufacturer.isEmpty() ? manufacturer : blankString)
    << info.systemLocation()
    << (info.vendorIdentifier() ? QString::number(info.vendorIdentifier(), 16) : blankString)
    << (info.productIdentifier() ? QString::number(info.productIdentifier(), 16) : blankString);

        ui->serialPortInfoListBox->addItem(list.first(), list);
    }
    

    }
    @

    .pro file:
    @greaterThan(QT_MAJOR_VERSION, 4) {
    QT += widgets serialport
    } else {
    include($$QTSERIALPORT_PROJECT_ROOT/src/serialport/qt4support/serialport.prf)
    }

    TARGET = terminal
    TEMPLATE = app

    SOURCES +=
    main.cpp
    mainwindow.cpp
    settingsdialog.cpp
    console.cpp

    HEADERS +=
    mainwindow.h
    settingsdialog.h
    console.h

    FORMS +=
    mainwindow.ui
    settingsdialog.ui

    RESOURCES +=
    terminal.qrc
    @

    i says that "info" is not declared in scope?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      frankiefrank
      wrote on last edited by
      #2

      Do you have
      @
      #include <QtSerialPort/QSerialPortInfo>
      @
      either in your .h or .cpp file?

      "Roads? Where we're going, we don't need roads."

      1 Reply Last reply
      0
      • JeroentjehomeJ Offline
        JeroentjehomeJ Offline
        Jeroentjehome
        wrote on last edited by
        #3

        He, c77asper.
        You started a post couple of days ago. I did send you some code (which I partly see in this post). Now please first set the previous post to [SOLVED] on your first post. Then you could continue with this one.
        The solution is probably what frankieFrank says. Include the proper classes and it should work.

        Greetz, Jeroen

        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