QTableView open Window on double Click



  • 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?


  • Moderators

    @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.



  • I didnt saw that. That works great. Thanks again


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.