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. Showing calendar on date edit in TableView (using models)
Qt 6.11 is out! See what's new in the release blog

Showing calendar on date edit in TableView (using models)

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.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.
  • Z Offline
    Z Offline
    Zhenya
    wrote on last edited by
    #1

    Hello everybody!

    I'm developing Qt application(obvious, but to start with).
    I have tableview which has tablemodel written by me in the background.
    I have a date field that I want to be edited. I return QVariant od QDate type (I tried DateTime and so on) and my field looks like dd-mm-YYYY with up and down arrows. When I was working with QSqlTableModel I noticed, that they have a calendar popup to edit date. I strongly need to do the same thing. There was no delegates in the source files but maybe I am wrong. Please tell me how to show calendar when a user edits date. Thank you!

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      Zhenya
      wrote on last edited by
      #2

      Answer is to create user-delegate from DateEdit widget and set popupCalendar(true)

      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