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. [SOLVED] customize QtableWidget with Qdesigner
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] customize QtableWidget with Qdesigner

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.7k 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
    advseo32
    wrote on last edited by
    #1

    Hi every body

    i want to start creating my own widget , but i don't know where i start

    i customise QtableWidget and integrate it in Qt designer

    plz guide me

    1 Reply Last reply
    0
    • X Offline
      X Offline
      xcoder
      wrote on last edited by
      #2

      Aloha,

      Well there are basically two ways you can do it.

      1. Write a class which extends the QTableWidget with all your customizations. And then just add the QTableWidget in your designer and promote it to your custom class. You can do it by right clicking the widget and clicking Promote to and entering the name of your class.

      2. Is slightly more complicated, but if you had done quick Google search you would find "this example":http://qt-project.org/doc/qt-4.8/designer-creating-custom-widgets.html
        With the second approach you're actually making a plugin for the designer.

      I've written a plugin only once, most of the times, promoting widgets to my class is good enough.

      Happy Coding.

      Only a biker knows why a dog sticks his head out of a car window.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        advseo32
        wrote on last edited by
        #3

        "Write a class which extends the QTableWidget with all your customizations. And then just add the QTableWidget in your designer"

        You mean that, i need to extends QtableWidget using Qtcreator

        then i will add the .cpp and .h in Qt designer ??

        1 Reply Last reply
        0
        • A Offline
          A Offline
          advseo32
          wrote on last edited by
          #4

          Ok i have figured out what you mean

          go to Qtcreator " Edit code area"

          1- create Extends class form desired widget

          2- make your custimisation on .cpp

          go to "Design aread -- Qt designer "

          right click on desired widget and hit promote then chose the header file of your custom widget

          1 Reply Last reply
          0
          • A Offline
            A Offline
            advseo32
            wrote on last edited by
            #5

            thank's xcoder

            good day :)

            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