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 config a QT plugin with qbs
Forum Updated to NodeBB v4.3 + New Features

How to config a QT plugin with qbs

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 553 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.
  • Pham HoangP Offline
    Pham HoangP Offline
    Pham Hoang
    wrote on last edited by Pham Hoang
    #1

    hi.
    there is a example of QT plugin on .pro. how can i create/config a QT plugin with .qbs. do you have any examples for it?

    1 Reply Last reply
    0
    • Maaz MominM Offline
      Maaz MominM Offline
      Maaz Momin
      wrote on last edited by
      #2

      Re: How to config a QT plugin with qbs

      If you download qt-creator source. Please check the qbs file there. But for your reference this is how cppeditor plugin qbs looks like

      import qbs 1.0
      import qbs.FileInfo

      QtcPlugin {
      name: "CppEditor"

      Depends { name: "Qt.widgets" }
      Depends { name: "CPlusPlus" }
      Depends { name: "Utils" }
      
      Depends { name: "Core" }
      Depends { name: "CppTools" }
      Depends { name: "TextEditor" }
      Depends { name: "ProjectExplorer" }
      
      Depends { name: "app_version_header" }
      
      pluginTestDepends: [
          "QmakeProjectManager",
      ]
      
      files: [
          "cppautocompleter.cpp",
          "cppautocompleter.h",
          "cppcodemodelinspectordialog.cpp",
          "cppcodemodelinspectordialog.h",
          "cppcodemodelinspectordialog.ui",
          "cppdocumentationcommenthelper.cpp",
          "cppdocumentationcommenthelper.h",
          "cppeditor.cpp",
          "cppeditor.h",
          "cppeditorwidget.cpp",
          "cppeditorwidget.h",
          "cppeditor.qrc",
          "cppeditor_global.h",
          "cppeditorconstants.h",
          "cppeditordocument.cpp",
          "cppeditordocument.h",
          "cppeditorenums.h",
          "cppeditorplugin.cpp",
          "cppeditorplugin.h",
          "cppfunctiondecldeflink.cpp",
          "cppfunctiondecldeflink.h",
          "cpphighlighter.cpp",
          "cpphighlighter.h",
          "cppincludehierarchy.cpp",
          "cppincludehierarchy.h",
          "cppinsertvirtualmethods.cpp",
          "cppinsertvirtualmethods.h",
          "cpplocalrenaming.cpp",
          "cpplocalrenaming.h",
          "cppminimizableinfobars.cpp",
          "cppminimizableinfobars.h",
          "cppoutline.cpp",
          "cppoutline.h",
          "cppparsecontext.cpp",
          "cppparsecontext.h",
          "cpppreprocessordialog.cpp",
          "cpppreprocessordialog.h",
          "cpppreprocessordialog.ui",
          "cppquickfix.cpp",
          "cppquickfix.h",
          "cppquickfixassistant.cpp",
          "cppquickfixassistant.h",
          "cppquickfixes.cpp",
          "cppquickfixes.h",
          "cpptypehierarchy.cpp",
          "cpptypehierarchy.h",
          "cppuseselectionsupdater.cpp",
          "cppuseselectionsupdater.h",
          "resourcepreviewhoverhandler.cpp",
          "resourcepreviewhoverhandler.h",
      ]
      
      Group {
          name: "Tests"
          condition: qtc.testsEnabled
          files: [
              "cppdoxygen_test.cpp",
              "cppdoxygen_test.h",
              "cppeditortestcase.cpp",
              "cppeditortestcase.h",
              "cppincludehierarchy_test.cpp",
              "cppquickfix_test.cpp",
              "cppquickfix_test.h",
              "cppuseselections_test.cpp",
              "fileandtokenactions_test.cpp",
              "followsymbol_switchmethoddecldef_test.cpp",
          ]
      
          cpp.defines: outer.concat(['SRCDIR="' + FileInfo.path(filePath) + '"'])
      }
      

      }

      1 Reply Last reply
      1
      • Pham HoangP Offline
        Pham HoangP Offline
        Pham Hoang
        wrote on last edited by
        #3

        hi @Maaz-Momin
        thank for your help. but i cannot load

        pluginTestDepends: [
        "QmakeProjectManager",
        ]

        what is in the pluginTestDepends?

        1 Reply Last reply
        0
        • Pham HoangP Offline
          Pham HoangP Offline
          Pham Hoang
          wrote on last edited by
          #4

          i found it. it is simple more than what it think from start. @_@!

          Project {

          CppApplication {
              name: "mainCoding"
          
              Depends { name: "PLUGIN1" }
              Depends { name: "Qt.widgets" }
          
              files: [
                  "main.cpp",
                  "echointerface.h",
                  "echowindow.h",
                  "echowindow.cpp"
              ]
          
              Group {     // Properties for the produced executable
                  fileTagsFilter: "application"
                  qbs.install: true
                  qbs.installDir: "bin"
              }
          }
          
          DynamicLibrary {
              name: "PLUGIN1"
              type: "dynamiclibrary"
          
              Depends { name: "cpp" }
              Depends { name: "Qt.widgets" }
              Depends { name: "Qt.bluetooth" }
          
              files: [
                  "plugin/echoplugin.h",
                  "plugin/echoplugin.cpp"
              ]
          
              Group {
                  name: "PLUGIN1"
                  fileTagsFilter: type
                  qbs.install: true
                  qbs.installDir: "bin"
              }
          }
          

          }

          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