Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to bulid Qt class with parameters ?
Forum Updated to NodeBB v4.3 + New Features

How to bulid Qt class with parameters ?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 2 Posters 279 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    Is there a recommanded way / procedure using QtCreator to build class with parameters ?

    I can start with project option "add new " and end up with desired class...

    Adding required parameters is OK, but prone to errors and time consuming.

    404ce7ff-6e20-4f48-8e2c-7bc660a98723-image.png

    include "a_bt_tab_dialog_ext.h"
    #include "ui_a_bt_tab_dialog_ext.h"
    // 2 add includes
    #include <QLabel>
    #include <QMdiArea>
    #include <QtSerialPort> // needs in in .,pro QT ??
    
    A_BT_TAB_DIALOG_EXT::A_BT_TAB_DIALOG_EXT(QWidget *parent) :
        QWidget(parent),
        ui(new Ui::A_BT_TAB_DIALOG_EXT),
        // 1 add paramaters
      m_status(new QLabel),
    //  m_console(new Console),
      // insert MDI area here ??
      m_mdiarea(new QMdiArea),
    //  m_settings(new SettingsDialog),
      //! [1]
      //! add rfcomm ??
      m_serial(new QSerialPort(this)
               )
    
    
    {
        ui->setupUi(this);
    }
    
    
    Christian EhrlicherC 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
    • A Anonymous_Banned275

      Is there a recommanded way / procedure using QtCreator to build class with parameters ?

      I can start with project option "add new " and end up with desired class...

      Adding required parameters is OK, but prone to errors and time consuming.

      404ce7ff-6e20-4f48-8e2c-7bc660a98723-image.png

      include "a_bt_tab_dialog_ext.h"
      #include "ui_a_bt_tab_dialog_ext.h"
      // 2 add includes
      #include <QLabel>
      #include <QMdiArea>
      #include <QtSerialPort> // needs in in .,pro QT ??
      
      A_BT_TAB_DIALOG_EXT::A_BT_TAB_DIALOG_EXT(QWidget *parent) :
          QWidget(parent),
          ui(new Ui::A_BT_TAB_DIALOG_EXT),
          // 1 add paramaters
        m_status(new QLabel),
      //  m_console(new Console),
        // insert MDI area here ??
        m_mdiarea(new QMdiArea),
      //  m_settings(new SettingsDialog),
        //! [1]
        //! add rfcomm ??
        m_serial(new QSerialPort(this)
                 )
      
      
      {
          ui->setupUi(this);
      }
      
      
      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You have to add them manually.

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

      A 1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        You have to add them manually.

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @Christian-Ehrlicher ...bummer... Now to figure out correct sequence...of adds...

        Maybe start "at the end " of the class declaration by adding variables one at a time....

        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