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. Singal is no longer transmitted when QComboBox index is changed
Forum Updated to NodeBB v4.3 + New Features

Singal is no longer transmitted when QComboBox index is changed

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 4 Posters 345 Views 2 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hey, I have a question. My singal from the QListView is no longer submitted when I change my QComboBox index.

    Do I still have to set a signal on the QComboBox here?

    In my constructor of mainwindow.cpp I have following signal:

        connect(ui->fungusList->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::onCurrentChanged);
    
    

    It works until I change the index in a QComboBox and another model is loaded to QListView.

    artwawA Christian EhrlicherC 2 Replies Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by
      #2

      You probably have to set up another connection after you change the model. From the documentation:

      "Note that, if you call setModel() after this function, the given selectionModel will be replaced by one created by the view."

      1 Reply Last reply
      0
      • ? A Former User

        Hey, I have a question. My singal from the QListView is no longer submitted when I change my QComboBox index.

        Do I still have to set a signal on the QComboBox here?

        In my constructor of mainwindow.cpp I have following signal:

            connect(ui->fungusList->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::onCurrentChanged);
        
        

        It works until I change the index in a QComboBox and another model is loaded to QListView.

        artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by
        #3

        @Gabber can you please describe how your view is set up? What is the relation between the selection, what is fungusList (I assume some view?) and so on?

        For more information please re-read.

        Kind Regards,
        Artur

        1 Reply Last reply
        0
        • ? A Former User

          Hey, I have a question. My singal from the QListView is no longer submitted when I change my QComboBox index.

          Do I still have to set a signal on the QComboBox here?

          In my constructor of mainwindow.cpp I have following signal:

              connect(ui->fungusList->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::onCurrentChanged);
          
          

          It works until I change the index in a QComboBox and another model is loaded to QListView.

          Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Gabber said in Singal is no longer transmitted when QComboBox index is changed:

          It works until I change the index in a QComboBox and another model is loaded to QListView.

          Because when you set a new model, also a new selection model is created. You have to connect() to the new model then.

          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
          3
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Thanks for all your help. @mchinand tip was the solution. Thanks!

            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