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 "make a copy of QDesigner form"
Forum Updated to NodeBB v4.3 + New Features

How to "make a copy of QDesigner form"

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 223 Views 2 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

    I do not like to reinvent the wheel...

    I like to
    duplicate submenu "action" - Configure _Extended.

    reuse the original submenu dialog code and make a copy / duplicate of the original dialog form

    I can easy make copies of files, but I like to learn how to do this by changing function parameters ,. constructor etc,

    Is there a sample / guide to follow ?
    At least conceptually .

    I have few issues
    The original subemu processing - C++ code and form - was not build using QTDesigner , hence I cannot just use "go to slot " option to debug (trace / copy) the original code and also to add the new submeny.

    I was hoping I can modify this original code

    #include "ui_mainwindow_Serial.h"
    #include "console.h"
    #include "settingsdialog.h"
    
    #include <QLabel>
    #include <QMessageBox>
    
    //! [0]
    MainWindow_Serial::MainWindow_Serial(QWidget *parent) :
        QMainWindow(parent),
        m_ui(new Ui::MainWindow_Serial),
        m_status(new QLabel),
        m_console(new Console),
        m_settings(new SettingsDialog),
    //! [1]
        m_serial(new QSerialPort(this))
    

    something like

    #include "ui_mainwindow_Serial_Extended .h"
    #include "console.h"
    #include "settingsdialog_Ext.h"
    
    #include <QLabel>
    #include <QMessageBox>
    
    //! [0]
    MainWindow_Serial::MainWindow_Serial(QWidget *parent) :
        QMainWindow(parent),
        m_ui(new Ui::MainWindow_Serial),
        m_status(new QLabel),
        m_console(new Console),
        m_settings(new SettingsDialog_Extended ),
    //! [1]
        m_serial(new QSerialPort(this))
    

    I can mange to duplicate the original form, but I could use help to duplicate / modify exiting dialog. I understand I just cannot copy the cpp/h files in QT / C++.

    Pl45m4P 1 Reply Last reply
    0
    • A Anonymous_Banned275

      I do not like to reinvent the wheel...

      I like to
      duplicate submenu "action" - Configure _Extended.

      reuse the original submenu dialog code and make a copy / duplicate of the original dialog form

      I can easy make copies of files, but I like to learn how to do this by changing function parameters ,. constructor etc,

      Is there a sample / guide to follow ?
      At least conceptually .

      I have few issues
      The original subemu processing - C++ code and form - was not build using QTDesigner , hence I cannot just use "go to slot " option to debug (trace / copy) the original code and also to add the new submeny.

      I was hoping I can modify this original code

      #include "ui_mainwindow_Serial.h"
      #include "console.h"
      #include "settingsdialog.h"
      
      #include <QLabel>
      #include <QMessageBox>
      
      //! [0]
      MainWindow_Serial::MainWindow_Serial(QWidget *parent) :
          QMainWindow(parent),
          m_ui(new Ui::MainWindow_Serial),
          m_status(new QLabel),
          m_console(new Console),
          m_settings(new SettingsDialog),
      //! [1]
          m_serial(new QSerialPort(this))
      

      something like

      #include "ui_mainwindow_Serial_Extended .h"
      #include "console.h"
      #include "settingsdialog_Ext.h"
      
      #include <QLabel>
      #include <QMessageBox>
      
      //! [0]
      MainWindow_Serial::MainWindow_Serial(QWidget *parent) :
          QMainWindow(parent),
          m_ui(new Ui::MainWindow_Serial),
          m_status(new QLabel),
          m_console(new Console),
          m_settings(new SettingsDialog_Extended ),
      //! [1]
          m_serial(new QSerialPort(this))
      

      I can mange to duplicate the original form, but I could use help to duplicate / modify exiting dialog. I understand I just cannot copy the cpp/h files in QT / C++.

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @AnneRanch

      Copy the class (cpp, h and ui) and add the changes you want to.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      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