<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Button does nothing]]></title><description><![CDATA[<p dir="auto">Hi all, okay, now I have a push button on the app but it can do nothing :(<br />
I tried several methods, but nothing seem to activate it:</p>
<ul>
<li>I tried this tuto: <a href="https://www.youtube.com/watch?v=VigUMAfE2q4&amp;ab_channel=ProgrammingKnowledge" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.youtube.com/watch?v=VigUMAfE2q4&amp;ab_channel=ProgrammingKnowledge</a></li>
<li>and this one: <a href="https://www.youtube.com/watch?v=dOovH6TvaY4&amp;ab_channel=VoidRealms" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.youtube.com/watch?v=dOovH6TvaY4&amp;ab_channel=VoidRealms</a></li>
</ul>
<p dir="auto">Any help please? To make something that works a bit?</p>
]]></description><link>https://forum.qt.io/topic/140160/button-does-nothing</link><generator>RSS for Node</generator><lastBuildDate>Thu, 18 Jun 2026 20:16:45 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/140160.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Oct 2022 17:57:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 20:09:48 GMT]]></title><description><![CDATA[<p dir="auto">You're absolutly right! I changed it to a textEdit, it compiles nicely :)</p>
]]></description><link>https://forum.qt.io/post/733187</link><guid isPermaLink="true">https://forum.qt.io/post/733187</guid><dc:creator><![CDATA[homnislash]]></dc:creator><pubDate>Tue, 18 Oct 2022 20:09:48 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 20:26:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/homnislash">@<bdi>homnislash</bdi></a><br />
You seem like an intelligent person.  What I do not understand is that you would/should have got a compiler error.  Did you not think it was relevant to say "it does not compile on this line" rather than "button does nothing"?  I don't mean to sound rude, just this was terribly relevant!</p>
]]></description><link>https://forum.qt.io/post/733188</link><guid isPermaLink="true">https://forum.qt.io/post/733188</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 18 Oct 2022 20:26:06 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 20:09:48 GMT]]></title><description><![CDATA[<p dir="auto">You're absolutly right! I changed it to a textEdit, it compiles nicely :)</p>
]]></description><link>https://forum.qt.io/post/733187</link><guid isPermaLink="true">https://forum.qt.io/post/733187</guid><dc:creator><![CDATA[homnislash]]></dc:creator><pubDate>Tue, 18 Oct 2022 20:09:48 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 20:04:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/homnislash">@<bdi>homnislash</bdi></a> said in <a href="/post/733178">Button does nothing</a>:</p>
<pre><code>void MyButton::on_pushButton_clicked()
{
    ui-&gt;lineEdit-&gt;setText("Hi");
}
</code></pre>
<p dir="auto">I see a slot which I believe will be called correctly.</p>
<p dir="auto">But I see no widget named <code>lineEdit</code> (or for that matter any <code>QLineEdit</code>) anywhere in the <code>ui_...h</code> file.  I would therefore conclude that your statement <code> ui-&gt;lineEdit-&gt;setText("Hi");</code> will not compile.</p>
]]></description><link>https://forum.qt.io/post/733185</link><guid isPermaLink="true">https://forum.qt.io/post/733185</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 18 Oct 2022 20:04:02 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 19:36:59 GMT]]></title><description><![CDATA[<p dir="auto">thanks for clarifying, here you go:</p>
<pre><code>/********************************************************************************
** Form generated from reading UI file 'mybutton.ui'
**
** Created by: Qt User Interface Compiler version 6.4.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/

#ifndef UI_MYBUTTON_H
#define UI_MYBUTTON_H

#include &lt;QtCore/QVariant&gt;
#include &lt;QtWidgets/QApplication&gt;
#include &lt;QtWidgets/QHBoxLayout&gt;
#include &lt;QtWidgets/QMainWindow&gt;
#include &lt;QtWidgets/QMenuBar&gt;
#include &lt;QtWidgets/QPushButton&gt;
#include &lt;QtWidgets/QStatusBar&gt;
#include &lt;QtWidgets/QTextEdit&gt;
#include &lt;QtWidgets/QWidget&gt;

QT_BEGIN_NAMESPACE

class Ui_MyButton
{
public:
    QWidget *centralwidget;
    QWidget *widget;
    QHBoxLayout *horizontalLayout;
    QTextEdit *textEdit;
    QPushButton *pushButton;
    QMenuBar *menubar;
    QStatusBar *statusbar;

    void setupUi(QMainWindow *MyButton)
    {
        if (MyButton-&gt;objectName().isEmpty())
            MyButton-&gt;setObjectName("MyButton");
        MyButton-&gt;resize(800, 600);
        centralwidget = new QWidget(MyButton);
        centralwidget-&gt;setObjectName("centralwidget");
        widget = new QWidget(centralwidget);
        widget-&gt;setObjectName("widget");
        widget-&gt;setGeometry(QRect(50, 5, 222, 211));
        horizontalLayout = new QHBoxLayout(widget);
        horizontalLayout-&gt;setObjectName("horizontalLayout");
        horizontalLayout-&gt;setContentsMargins(0, 0, 0, 0);
        textEdit = new QTextEdit(widget);
        textEdit-&gt;setObjectName("textEdit");

        horizontalLayout-&gt;addWidget(textEdit);

        pushButton = new QPushButton(widget);
        pushButton-&gt;setObjectName("pushButton");

        horizontalLayout-&gt;addWidget(pushButton);

        MyButton-&gt;setCentralWidget(centralwidget);
        menubar = new QMenuBar(MyButton);
        menubar-&gt;setObjectName("menubar");
        menubar-&gt;setGeometry(QRect(0, 0, 800, 22));
        MyButton-&gt;setMenuBar(menubar);
        statusbar = new QStatusBar(MyButton);
        statusbar-&gt;setObjectName("statusbar");
        MyButton-&gt;setStatusBar(statusbar);

        retranslateUi(MyButton);

        QMetaObject::connectSlotsByName(MyButton);
    } // setupUi

    void retranslateUi(QMainWindow *MyButton)
    {
        MyButton-&gt;setWindowTitle(QCoreApplication::translate("MyButton", "MyButton", nullptr));
        pushButton-&gt;setText(QCoreApplication::translate("MyButton", "PushButton", nullptr));
    } // retranslateUi

};

namespace Ui {
    class MyButton: public Ui_MyButton {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_MYBUTTON_H

</code></pre>
<p dir="auto">What do you have in mind?</p>
]]></description><link>https://forum.qt.io/post/733183</link><guid isPermaLink="true">https://forum.qt.io/post/733183</guid><dc:creator><![CDATA[homnislash]]></dc:creator><pubDate>Tue, 18 Oct 2022 19:36:59 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 19:18:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/homnislash">@<bdi>homnislash</bdi></a><br />
The file requested is the <code>ui_mybutton.h</code> one, not the <code>mybutton.h</code> you show.  It should be in the <em>build</em> directory you are compiling in, not the source directory.  It is the result of running <code>uic</code> on the <code>.ui</code> file which was saved from Designer.</p>
]]></description><link>https://forum.qt.io/post/733181</link><guid isPermaLink="true">https://forum.qt.io/post/733181</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 18 Oct 2022 19:18:35 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 19:11:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> Thanks for the reply, I am not sure to understand, I have a .h file, is this what you want to see?</p>
<pre><code>#ifndef MYBUTTON_H
#define MYBUTTON_H

#include &lt;QMainWindow&gt;

QT_BEGIN_NAMESPACE
namespace Ui { class MyButton; }
QT_END_NAMESPACE

class MyButton : public QMainWindow
{
    Q_OBJECT

public:
    MyButton(QWidget *parent = nullptr);
    ~MyButton();

private slots:
    void on_pushButton_clicked();

private:
    Ui::MyButton *ui;
};
#endif // MYBUTTON_H
</code></pre>
]]></description><link>https://forum.qt.io/post/733180</link><guid isPermaLink="true">https://forum.qt.io/post/733180</guid><dc:creator><![CDATA[homnislash]]></dc:creator><pubDate>Tue, 18 Oct 2022 19:11:13 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 19:01:10 GMT]]></title><description><![CDATA[<p dir="auto">Please show the content of ui_mybutton.h and also please don't use the auto-connect feature but do the connects by yourself.</p>
]]></description><link>https://forum.qt.io/post/733179</link><guid isPermaLink="true">https://forum.qt.io/post/733179</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 18 Oct 2022 19:01:10 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 19:01:36 GMT]]></title><description><![CDATA[<p dir="auto">Thank you so much for your help, I could display some text through the button clic via this tuto :<br />
<a href="https://www.youtube.com/watch?v=Pb-XC5Q5zLU&amp;ab_channel=ParwizForogh" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.youtube.com/watch?v=Pb-XC5Q5zLU&amp;ab_channel=ParwizForogh</a></p>
<p dir="auto">Here is a snippet of my code to illustrate: the cpp file:</p>
<pre><code>#include "mybutton.h"
#include "./ui_mybutton.h"

MyButton::MyButton(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MyButton)
{
    ui-&gt;setupUi(this);
}

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


void MyButton::on_pushButton_clicked()
{
    ui-&gt;lineEdit-&gt;setText("Hi");
}

</code></pre>
<p dir="auto">I had a hard time trying to have an interaction to find a solution to display some text. See you soon!</p>
]]></description><link>https://forum.qt.io/post/733178</link><guid isPermaLink="true">https://forum.qt.io/post/733178</guid><dc:creator><![CDATA[homnislash]]></dc:creator><pubDate>Tue, 18 Oct 2022 19:01:36 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 18:04:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/homnislash">@<bdi>homnislash</bdi></a><br />
Not many people here are going to want to watch videos.  The idea is you show a bit of code ---  code you can paste --- you are trying.  And you explain what is wrong or what is not working.</p>
]]></description><link>https://forum.qt.io/post/733172</link><guid isPermaLink="true">https://forum.qt.io/post/733172</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 18 Oct 2022 18:04:00 GMT</pubDate></item><item><title><![CDATA[Reply to Button does nothing on Tue, 18 Oct 2022 18:02:54 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Please show your code.</p>
<p dir="auto">That said, beside YouTube, the Qt documentation is full of examples to get you started. You might want to dig in it a bit.</p>
]]></description><link>https://forum.qt.io/post/733171</link><guid isPermaLink="true">https://forum.qt.io/post/733171</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 18 Oct 2022 18:02:54 GMT</pubDate></item></channel></rss>