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__passive_
QtWS25 Last Chance

__qt__passive_

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 4 Posters 707 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 last edited by
    #1

    wath _qt_passive do ?
    and why it doesn't work with QListView?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @MehdiGh said in __qt__passive_:

      wath _qt_passive do ?
      and why it doesn't work with QListView?

      When you don't know what it is why do you say that it does not work with QListView?

      I don't know either what you mean with _qt_passive - there is neither a variable nor a define somehwere in the Qt sources

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

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

        Hi
        Not even Google has ever heard about _qt_passive
        so please show how its defined and used.

        Could be a #define in your project maybe.

        M 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          @MehdiGh said in __qt__passive_:

          wath _qt_passive do ?
          and why it doesn't work with QListView?

          When you don't know what it is why do you say that it does not work with QListView?

          I don't know either what you mean with _qt_passive - there is neither a variable nor a define somehwere in the Qt sources

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @Christian-Ehrlicher , @mrjj

          __qt__passive_...:

          https://stackoverflow.com/questions/18830689/access-custom-qtdesigner-plugins-child-widget-from-qtdisgner/
          https://falsinsoft.blogspot.com/2016/02/qt-designer-develop-custom-widget.html

          :)

          Basically you need to set a name to all the objects of your widget you want to have "mouse interactive" inside the Qt Designer using the special prefix in red:
          pMyConrolObject->setObjectName("__qt__passive_ObjectName");

          M 1 Reply Last reply
          2
          • mrjjM mrjj

            Hi
            Not even Google has ever heard about _qt_passive
            so please show how its defined and used.

            Could be a #define in your project maybe.

            M Offline
            M Offline
            MehdiGh
            wrote on last edited by
            #5

            so please show how its defined and used.

            so i try to create a Qt Designe's custom widget plugin just like QTabWidget but insted of using tab i want to work with listview and use items to navigate between pages so i started from this source that show how to create custom multi-page plugin for Qt Designer and they use QCombobox for the navigation. i did the same steps but i used Qlistview for the navigation and when i installed the custom widget in the Qt Designer it seem it doesn't receive the down and up mouse events with the result ican not move between pages of your widget.

            my code:
            MultiPageWidget::MultiPageWidget(QWidget *parent)
            : QWidget(parent)
            , stackWidget(new QStackedWidget)
            , listView (new QListView)
            , listModel (new ListModel)
            {

            listView->setEditTriggers(QAbstractItemView::NoEditTriggers);
            listView->setSelectionRectVisible(true);
            listView->setModel(listModel);
            listView->setMouseTracking(true);
            
            listView->setObjectName(QStringLiteral("__qt__passive_listView"));
            
            connect(listView, SIGNAL(clicked(QModelIndex)), this, SLOT(setCurrentIndex(QModelIndex)));
            QHBoxLayout *layout = new QHBoxLayout(this);
            layout->addWidget(listView,1);
            layout->addWidget(stackWidget,2);
            

            }
            the documentation code:

            MultiPageWidget::MultiPageWidget(QWidget *parent)
            : QWidget(parent)
            , stackWidget(new QStackedWidget)
            , comboBox(new QComboBox)
            {
            comboBox->setObjectName(QStringLiteral("__qt__passive_comboBox"));

            connect(comboBox, QOverload<int>::of(&QComboBox::activated),
                    this, &MultiPageWidget::setCurrentIndex);
            
            QVBoxLayout *layout = new QVBoxLayout(this);
            layout->addWidget(comboBox);
            layout->addWidget(stackWidget);
            

            }

            1 Reply Last reply
            0
            • JonBJ JonB

              @Christian-Ehrlicher , @mrjj

              __qt__passive_...:

              https://stackoverflow.com/questions/18830689/access-custom-qtdesigner-plugins-child-widget-from-qtdisgner/
              https://falsinsoft.blogspot.com/2016/02/qt-designer-develop-custom-widget.html

              :)

              Basically you need to set a name to all the objects of your widget you want to have "mouse interactive" inside the Qt Designer using the special prefix in red:
              pMyConrolObject->setObjectName("__qt__passive_ObjectName");

              M Offline
              M Offline
              MehdiGh
              wrote on last edited by
              #6

              __qt__passive_...:

              https://stackoverflow.com/questions/18830689/access-custom-qtdesigner-plugins-child-widget-from-qtdisgner/
              https://falsinsoft.blogspot.com/2016/02/qt-designer-develop-custom-widget.html

              thank you. i already seen these and it doesn't work with QListView i don't know why

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                This is some undocumented stuff which you can't rely upon.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

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

                  Hi
                  For an undocumented features, its odd even the examples use it.

                  alt text

                  So I guess the only fix for the listview would to include an extra property that
                  can change the active tab since its not possible to click on it.

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

                    Hi

                    • Regarding why it dont work on ListView.

                    It has a viewport widget that actually gets the events.
                    So maybe you should add the "tag"

                    listView->viewport()->setObjectName(QStringLiteral("__qt__passive_listViewViewPort"));

                    M 1 Reply Last reply
                    3
                    • mrjjM mrjj

                      Hi

                      • Regarding why it dont work on ListView.

                      It has a viewport widget that actually gets the events.
                      So maybe you should add the "tag"

                      listView->viewport()->setObjectName(QStringLiteral("__qt__passive_listViewViewPort"));

                      M Offline
                      M Offline
                      MehdiGh
                      wrote on last edited by
                      #10

                      @mrjj said in __qt__passive_:

                      listView->viewport()->setObjectName(QStringLiteral("__qt__passive_listViewViewPort"));

                      Thank you very much, it works well

                      mrjjM 1 Reply Last reply
                      1
                      • M MehdiGh

                        @mrjj said in __qt__passive_:

                        listView->viewport()->setObjectName(QStringLiteral("__qt__passive_listViewViewPort"));

                        Thank you very much, it works well

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @MehdiGh
                        Perfect.
                        I also learned a new thing as I have not seen that "tag" before but
                        did fight with the same issue for a Designer plugin.

                        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