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

QTableView open Window on double Click

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 3.9k 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 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?

    jsulmJ 1 Reply Last reply
    0
    • F Fuel

      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?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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 last edited by
        #3

        I didnt saw that. That works great. Thanks again

        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