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. Qt Designer - expose children widget in Custom Container Widget Plugin
Forum Updated to NodeBB v4.3 + New Features

Qt Designer - expose children widget in Custom Container Widget Plugin

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 255 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.
  • M Offline
    M Offline
    MehdiGh
    wrote on 27 Sept 2021, 16:20 last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • A Offline
      A Offline
      AxelVienna
      wrote on 27 Sept 2021, 18:58 last edited by
      #2

      I hope I got your question right: You have items in a QListView, which you want to address individually when they are double clicked.
      The signal clicked(const QModelIndex &) is indeed emitted by the QListView and not by its items.
      You have to connect your slot to this signal as you did in your constructor.
      In your method setCurrentIndex(const QModelIndex &index) you can obtain the current item's row and column (which is the item that was clicked).

      const int myRow = index->row();
      const int myColumn = index->column();
      

      Depending on how the model of your QListView is designed and how you populate it, this can always direct you to the item in question.

      C++ and Python walk into a bar. C++ reuses the first glass.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        MehdiGh
        wrote on 28 Sept 2021, 11:10 last edited by
        #3

        thank you for yor reaction. my problem is i need the slot to execute in the qt designer becouse a try to create a custom widget plugin just lik the QTabWidget but insted of tab i want to use list to navigate between tha pages. so in the qt designer whene i click on one of the items the entrie widget clicked and not the only the item but whene i use the widget i created in any project and excuted it the wedget behave normally. so my problem is in the qt designer i hope i explained my point wellCapture d’écran 2021-09-28 121014.png

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AxelVienna
          wrote on 28 Sept 2021, 11:39 last edited by
          #4

          @MehdiGh
          If I get you right, your multipagewidget is just like a QTabWidget turned to the left by 90°.
          What you mean by "child" is actually a tab, each of which you want to populate with different widgets.
          You have to look at the implementation of your custom widget. It seems to consist of a QListView, as displayed on the left side. This list view is (probably) on the same hierarchy level as your pages, which seem to be something like a QFrame or so. You need to handle the switching between pages on the level of the QListView inside your custom widget. The most straight forward implementation is to size all the frames (or whatever it is) equally, put them on the same position and hide/unhide them programmatically depending on the current row of the QListView. But I guess you know that.
          If you want to fully integrate your custom widget in Qt Designer, you have to implement a plugin as described here.

          IMHO that is a lot of work for a QTabWidget turned to the left by 90°. I would consider populating your pages programmatically or going with a generic QTabWidget.

          C++ and Python walk into a bar. C++ reuses the first glass.

          1 Reply Last reply
          0

          1/4

          27 Sept 2021, 16:20

          • Login

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