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. Is it possible to replace "this,SLOT" with "a command"?

Is it possible to replace "this,SLOT" with "a command"?

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

    i have this, which works great.
    @settingsMenu_->addAction(tr("Quit"), this, SLOT(on_actionQuit_triggered()), QKeySequence(tr("Ctrl+Q")));

    void MainWindow::on_actionQuit_triggered()
    {
    qApp->exit(0);
    }@

    but it seems to me such a waste of lines that i call one function to run one command. So i am wondering if something like this could happen:
    @settingsMenu_->addAction(tr("Quit"), qApp->exit(0), QKeySequence(tr("Ctrl+Q")));@

    P.S newbie question i know, but need to ask, curiosity...

    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