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. Merge QDialog project into a QWindow project
Forum Updated to NodeBB v4.3 + New Features

Merge QDialog project into a QWindow project

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 259 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.
  • E Offline
    E Offline
    epicQt
    wrote on last edited by
    #1

    I have two separate projects, one is a QDialog and another is a QWindow.

    I would like to integrate the QDialog into the QWindow project.

    My QDialog .pro file contains this:

    QT += core gui
    QT += serialport
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    CONFIG += c++11
    
    # You can make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
        main.cpp \
        dialog.cpp
    
    HEADERS += \
        dialog.h \
    
    FORMS += \
        dialog.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    

    I won't copy the QWindow.pro file because is very long, but can tell you that:

    • It doesn't contain the QT += core gui QT += serialport lines that the QDialog has
    • It doesn't contain any Forms

    How can merge the QDialog into the QWindow project?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      You can just add
      dialog.cpp
      dialog.h
      dialog.ui

      To your QWindow project and simply
      create an instance of the dialog and show it.

      Copy the files first to the QWindow project folder
      then right click in Creator and use the Add existing files.
      Then select the files.
      alt text

      Since dialog project use
      QT += serialport

      you might want to add that to the project file if it does need qserialport class.

      1 Reply Last reply
      2
      • E Offline
        E Offline
        epicQt
        wrote on last edited by
        #3

        This worked.

        Thanks!

        1 Reply Last reply
        1

        • Login

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