Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. CheckBox stay checked after exit and restart
Qt 6.12 LTS is out! See what's new in the release blog

CheckBox stay checked after exit and restart

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

    Hi,

    I'm programming a GUI app. In my first screen/page, i have a tableview and in my second page, i have a checkbox.
    The problem is when i exit the program with the checkbox checked and i restart it, the tableview don't have the focus (gray selection) and the checkbox is still checked.
    Is the problem come from destructor ?

    Thx

    EDIT : checkbox problem solved but tableview still doesn't have the focus

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      just set focus to it in mainwindow constructor?
      ui->tableview->setFocus(); ?

      1 Reply Last reply
      0
      • ZoptuneZ Offline
        ZoptuneZ Offline
        Zoptune
        wrote on last edited by Zoptune
        #3

        That what i just tried but doesn't work.
        I have used QApplication::focusWidget() to get the widget focused. I don't know why but it is a combobox, even if i set the focus to the table view.

        EDIT : Pffff, i don't know why but the focus policy of the tableview is set to NoFocus ^^

        Thx

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt
        • Unsolved