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] How can I click on a cell, in a QTextTable and trigger a signal?
Forum Updated to NodeBB v4.3 + New Features

[solved] How can I click on a cell, in a QTextTable and trigger a signal?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 2.8k 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.
  • P Offline
    P Offline
    pwnstar23
    wrote on 27 Sept 2012, 02:34 last edited by
    #1

    I have a calendar almost the same as the calendar example. I wish to click on one of the cells that represent a day and have an signal fire and trigger a slot on my mainwindow. I have the slot all set up but I can't find which object and signal to connect when a cell is clicked in the table.

    The Tables are in a TextBrowser

    In my code all it needs to do is set a field to the date of the cell clicked. I have this code written as well.

    For a visual aid, the arrow in the pic below points to a cell that I need a signal for when clicked.

    !http://imageshack.us/a/img51/1559/whatsignal.png!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tomuse
      wrote on 27 Sept 2012, 08:03 last edited by
      #2

      http://qt-project.org/doc/qt-4.8/qcalendarwidget.html#clicked

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jeroentjehome
        wrote on 27 Sept 2012, 08:08 last edited by
        #3

        Hi,
        Can't you get a event? In that event check for a click event, then get the currentIndex and your done. Did do this in a QTableView/Model context, but can't imagine that this class doesn't do the same. There are also mouseOver events in case you need some extra information on a cell. Hope this helps just a bit, but again, never used the QTextTable before.
        Greetz

        Greetz, Jeroen

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Rahul Das
          wrote on 27 Sept 2012, 08:25 last edited by
          #4

          Its very easy if its a [[doc:QTableWidget]]

          And a workaround for this issue could be like, catching the cursorchanged signal, and look for the position of the cursor to make sure, that it is in the table.


          Declaration of (Platform) independence.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pwnstar23
            wrote on 28 Sept 2012, 00:02 last edited by
            #5

            [quote author="Rahul Das" date="1348734306"]Its very easy if its a [[doc:QTableWidget]]

            And a workaround for this issue could be like, catching the cursorchanged signal, and look for the position of the cursor to make sure, that it is in the table.[/quote]

            Being new is hard :( I didn't know that the textbrowser way of doing it didn't have click events so I had to rewrite my application using QTableWidget. It was a good learning experience though.

            Thread solved.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Rahul Das
              wrote on 28 Sept 2012, 05:02 last edited by
              #6

              Usually we don't use the documents so interactive as any ui widget right ? Its simply because, when we take a print out of the document, interaction is almost useless! I mean, there is no ui interactions on a paper!

              Still we can make it interactive by customizing our own way.


              Declaration of (Platform) independence.

              1 Reply Last reply
              0

              1/6

              27 Sept 2012, 02:34

              • Login

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