Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. International
  3. Portuguese
  4. Erro evento clicked() not declared de um pushButton
Qt 6.12 LTS is out! See what's new in the release blog

Erro evento clicked() not declared de um pushButton

Scheduled Pinned Locked Moved Solved Portuguese
2 Posts 1 Posters 1.3k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Olá, estou iniciando em Qt, criei um novo projeto para teste, inseri um botoão e estou querendo associar o evento de clique a uma ação (função), porém não estou conseguindo, ao compilar acontece este erro:

    • error: 'Clicked' was not declared in this scope
      segue codigo:

    • Código
      #include "mainwindow.h"
      #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    connect(ui->pushButton,signal(Clicked()),
    this,
    SLOT(close()));
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    ? 1 Reply Last reply
    0
    • ? A Former User

      Olá, estou iniciando em Qt, criei um novo projeto para teste, inseri um botoão e estou querendo associar o evento de clique a uma ação (função), porém não estou conseguindo, ao compilar acontece este erro:

      • error: 'Clicked' was not declared in this scope
        segue codigo:

      • Código
        #include "mainwindow.h"
        #include "ui_mainwindow.h"

      MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
      {
      ui->setupUi(this);
      connect(ui->pushButton,signal(Clicked()),
      this,
      SLOT(close()));
      }

      MainWindow::~MainWindow()
      {
      delete ui;
      }

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @Vicius_Souza
      Descobri com ajuda do fórum internacional, e compartilho aqui, segue link para solução do meu problema.
      New_Signal_Slot_Syntax

      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
      • Unsolved