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. QTableView open Window on double Click
Forum Updated to NodeBB v4.3 + New Features

QTableView open Window on double Click

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 3.4k 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.
  • F Offline
    F Offline
    Fuel
    wrote on 28 Jul 2017, 07:30 last edited by
    #1

    I have a Column in a QTableView that has a QDate as QString. Now i want to edit this Date. My Purpose is to use a QCalendarWidget to edit this Date. My Idea is now to open a new Window with a QCalendarWidget and an Ok Button. But at the moment i dont know how to solve that.

    My first Attempt was to use my Delegate for this. I just returned a QCalendarWidget in createEditor() Method, but the Problem is i dont know how to confirm my Date select in the Widget. It never leaves the EditMode. Another Problem is the Size of the QCalendarWidget.

    Should i just use my first Attempt or is a new Window a better Idea? If yes, how?

    J 1 Reply Last reply 28 Jul 2017, 07:34
    0
    • F Fuel
      28 Jul 2017, 07:30

      I have a Column in a QTableView that has a QDate as QString. Now i want to edit this Date. My Purpose is to use a QCalendarWidget to edit this Date. My Idea is now to open a new Window with a QCalendarWidget and an Ok Button. But at the moment i dont know how to solve that.

      My first Attempt was to use my Delegate for this. I just returned a QCalendarWidget in createEditor() Method, but the Problem is i dont know how to confirm my Date select in the Widget. It never leaves the EditMode. Another Problem is the Size of the QCalendarWidget.

      Should i just use my first Attempt or is a new Window a better Idea? If yes, how?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 28 Jul 2017, 07:34 last edited by
      #2

      @Fuel You could use http://doc.qt.io/qt-5/qabstractitemview.html#doubleClicked connect a slot to it and show a dialog with QCalendarWidget there.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4
      • F Offline
        F Offline
        Fuel
        wrote on 28 Jul 2017, 08:17 last edited by
        #3

        I didnt saw that. That works great. Thanks again

        1 Reply Last reply
        0

        1/3

        28 Jul 2017, 07:30

        • Login

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