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. Qt key Press ShortCuts Error.
Qt 6.11 is out! See what's new in the release blog

Qt key Press ShortCuts Error.

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

    Qt5.4 Linux 64 Bit is in use.

    I am setting a model in TableView and I want to delete a cell row or column by selecting one cell and pressing Ctrl + Delete + C on the keyboard.

    Is there a way to set it in ShoutCut?

    Modeifier is set to Ctrl + shift. It is also problematic to search condition after setting Qt :: Key_Delete and Qt :: Key_C in general.

    SamurayHS 1 Reply Last reply
    0
    • P Pada_

      Qt5.4 Linux 64 Bit is in use.

      I am setting a model in TableView and I want to delete a cell row or column by selecting one cell and pressing Ctrl + Delete + C on the keyboard.

      Is there a way to set it in ShoutCut?

      Modeifier is set to Ctrl + shift. It is also problematic to search condition after setting Qt :: Key_Delete and Qt :: Key_C in general.

      SamurayHS Offline
      SamurayHS Offline
      SamurayH
      wrote on last edited by
      #2

      Hi @Pada_,

      QAction is what you're looking for. It's very easy to use... so for your shortcut try this:

      QAction *rowCellDelAct = new QAction(this); 
      rowCellDelAct->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_Delete, Qt::CTRL+Qt::Key_C));
      connect(rowCellDelAct, &QAction::triggered, &MainWindow::deleteRowCell);
      TableView->addAction(rowCellDelAct);
      

      Note: The action must be added to the widget that is going to have focus when the user is allowed to trigger that action. In your case, it is the TableView.

      "قال رسول الله صلى الله عليه وسلم : " أحب الناس إلى الله أنفعهم للناس

      1 Reply Last reply
      3

      • Login

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