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] Connect from a QListView doesn't work
Forum Updated to NodeBB v4.3 + New Features

[solved] Connect from a QListView doesn't work

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 5.4k 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.
  • E Offline
    E Offline
    ebruurs
    wrote on last edited by
    #1

    Hi,

    I have the following line of code:
    @
    connect(qListView, SIGNAL(clicked()), controller, SLOT(updateActivity()));
    @

    My class controller contains a function updateActivity() en het controller.h file contains the function in the public slot. But still this doesn't work.
    I get the errormessage:
    Object::connect: No such signal QListView::clicked(QListViewItem *) in ....

    Any1 got an idea?

    Thanks in advance

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Is your connect statement show above complete as you have it in your code?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • E Offline
        E Offline
        ebruurs
        wrote on last edited by
        #3

        I think so, got some other connect statements defined in the same way and those doesn't give any errors.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          QListView doesn't have QListViewItems. QListWidget does have QListWidgetItems though. You should monitor the selection (QListView::selectionModel()), to achieve what you want.

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            your error message sais that you are trying to connect to another signal
            [quote author="ebruurs" date="1305713275"]
            Object::connect: No such signal QListView::clicked(QListViewItem *) in ....
            [/quote]

            that would mean that you have a statement:
            @
            connect(qListView, SIGNAL(clicked(QListViewItem *)), controller, SLOT(updateActivity(QListViewItem *)));
            @

            in your code.

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • A Offline
              A Offline
              alexander
              wrote on last edited by
              #6

              [quote author="ebruurs" date="1305713275"]Hi,
              I get the errormessage:
              Object::connect: No such signal QListView::clicked(QListViewItem *) in ....
              [/quote]

              QListView has not signal clicked()
              try next:
              @connect(qListView, SIGNAL(clicked(const QModelIndex&)), controller, SLOT(updateActivity()));@

              1 Reply Last reply
              0
              • E Offline
                E Offline
                ebruurs
                wrote on last edited by
                #7

                Thank you all for your replies. The const QModelIndex& solution worked well for me.

                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