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. Testing designed widgets
Forum Updated to NodeBB v4.3 + New Features

Testing designed widgets

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 3.0k 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.
  • S Offline
    S Offline
    soroush
    wrote on last edited by
    #1

    Hello forum

    I started to write a widget library in Qt. I found that testing a newly designed widget is very error prone and a little boring! Currently I'm doing this:

    Compile project

    Install it system-wide (sudo make uninstall && sudo make install)

    Restrart Qt Creator

    Open testing application (which is a test application using widgets) and recompile it

    When found a small bug, I have to do all above steps again...

    I think there should be some tool for this. Something that let developers to test widgets in widget application itself (without actually installing it in system)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      No, you need to do so much things ;-)

      Step1, Write your own custom widget. (which include x.h, x.cpp and optional x.ui, x.qrc, ...)

      Step1.5(Optional), Make such a custom widget as a shared or static libaray.

      Step2, Write A test application which use your above widget.

      Step3(Optional), Write a plugin for designer if you want.


      BTW, it's not required to create plugin if such a custom widget used in you designer not very often. Promote method will be easy and convenient to use in such cases. However, If your custom widgets will be used by many projects or by many user, feel free to implement one plugin.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        soroush
        wrote on last edited by
        #3

        @1+1-2

        Currently I'm sharing widget files (h+cpp+ui) between a test application (in a folder other than widget library), and a widget plugin project. Someone should write add a feature to Qt Creator for it.

        Thanks.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dbzhang800
          wrote on last edited by
          #4

          [quote author="soroush" date="1337631794"]1+1-2

          Currently I'm sharing widget files (h+cpp+ui) between a test application (in a folder other than widget library), and a widget plugin project. Someone should write add a feature to Qt Creator for it.

          Thanks.[/quote]

          Sorry for my poor English, I can not fully catch up with you.

          Perhaps a normal custom widgets library like this:

          @
          rootdir
          |-- project.pro (TEMPLATE=subdirs )
          |-- libwidget
          | |-- libwidget.pro (TEMPLATE=lib, static or shared library)
          | |-- x.h
          | |-- x.cpp
          | -- ... |-- tests\ | |-- tests.pro (TEMPLATE=app, depends on above library) | |-- tst_x.cpp | -- ...
          -- designerplugin(optional)\ |-- designerplugin.pro (TEMPLATE=lib, dpends on above library) -- main.cpp
          @

          And IMO, all the features more or less have been provided by QtCreator.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            soroush
            wrote on last edited by
            #5

            This looks like to be a better solution. I'm going to convert project to that structure.

            Thank you :)

            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