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. QAction problem

QAction problem

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

    Hi,

    in my mainwindow.ui I added a new QAction "actionExit", but when i try connect signal to slot like that:

    connect(actionExit, SIGNAL(triggered()), this, SLOT(quit()));

    I get an error during compilation

    'actionExit' was not declared in this scope

    What can I do to make the actionExit object visible in mainwindow?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by Bonnie
      #2

      It is in the ui file, not in the class.
      So you need to use

      ui->actionExit
      

      in mainwindow.cpp

      1 Reply Last reply
      2

      • Login

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