<?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[[SOLVED] textEdit not letting me access any of its functions]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am trying to run what seems to be a very simple example. I have done it many times, but now that I have it incorporated into a larger project with multiple classes it does not seem to want to work. I have the following code:</p>
<p dir="auto">void BasicGui::displayProgram(QString aPath)<br />
{<br />
QFile programFile(aPath);<br />
programFile.open(QIODevice::ReadOnly);<br />
QTextStream textStream(&amp;programFile);<br />
QString line = textStream.readAll();<br />
programFile.close();</p>
<pre><code>qDebug() &lt;&lt; line;
ui-&gt;programTextEdit-&gt;setPlainText(line);
ui-&gt;runButton-&gt;setEnabled(true);
ui-&gt;pauseButton-&gt;setEnabled(true);
</code></pre>
<p dir="auto">}</p>
<p dir="auto">I am just trying to print out the contents of "line" to my textEdit box called "programTextEdit". I know I am getting info because I can print out line in my debug window. However, when I try the function setPlainText() or anything within the textEdit features I get the following error:</p>
<p dir="auto">error: C2227: left of '-&gt;programTextEdit' must point to class/struct/union/generic type</p>
<p dir="auto">I don't understand how this is possible. Any thoughts...</p>
]]></description><link>https://forum.qt.io/topic/27302/solved-textedit-not-letting-me-access-any-of-its-functions</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 00:36:06 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/27302.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 May 2013 11:21:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 17:36:19 GMT]]></title><description><![CDATA[<p dir="auto">OK. I will do some HW. Thanks!</p>
]]></description><link>https://forum.qt.io/post/179497</link><guid isPermaLink="true">https://forum.qt.io/post/179497</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 17:36:19 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 16:16:41 GMT]]></title><description><![CDATA[<p dir="auto">Your code looks like it's getting messy. You are starting to have pointers to objects not directly related to those you are using.</p>
<p dir="auto">May I suggest reading some of the examples from the Qt documentation ?</p>
<p dir="auto">Typically updating your line edit content from another widget should be done using signals and slots (Unless I misunderstood your code). Or if SelectFile is a dialog to select a file (like the name suggests) why not use QFileDialog from BasicGui and directly update the line edit ?</p>
]]></description><link>https://forum.qt.io/post/179492</link><guid isPermaLink="true">https://forum.qt.io/post/179492</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 16 May 2013 16:16:41 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 16:06:29 GMT]]></title><description><![CDATA[<p dir="auto">I got it to work. I didn't make an object of BasicGui in my SelectFile class. I did the following for it to work:</p>
<p dir="auto">@public:<br />
explicit SelectFile(QWidget *parent = 0);<br />
~SelectFile();<br />
BasicGui *basicgui;<br />
@</p>
<p dir="auto">Then I made a call to basicgui-&gt;displayProgram()</p>
]]></description><link>https://forum.qt.io/post/179489</link><guid isPermaLink="true">https://forum.qt.io/post/179489</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 16:06:29 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 16:02:08 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="raven-worx" date="1368719638"]@<br />
ui-&gt;displayProgram(aPath);<br />
@[/quote]</p>
<p dir="auto">displayProgram() is from another class (Ui::BasicGui) so when I do that it says that displayProgram is not a member of the class that I am making the call in (which in this case is called Ui::SelectFile).</p>
]]></description><link>https://forum.qt.io/post/179488</link><guid isPermaLink="true">https://forum.qt.io/post/179488</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 16:02:08 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 15:53:58 GMT]]></title><description><![CDATA[<p dir="auto">@<br />
ui-&gt;displayProgram(aPath);<br />
@</p>
]]></description><link>https://forum.qt.io/post/179487</link><guid isPermaLink="true">https://forum.qt.io/post/179487</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Thu, 16 May 2013 15:53:58 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 15:45:14 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="SGaist" date="1368717950"]So you are trying to modify a private class member from a static function ?</p>
<p dir="auto">That's not allowed[/quote]</p>
<p dir="auto">OK, I made the function non-static, but am now getting a function saying "error: C2352: 'BasicGui::displayProgram' : illegal call of non-static member function" when trying to call the function from another class/file with the following code:</p>
<p dir="auto">@    BasicGui::displayProgram(aPath);@</p>
]]></description><link>https://forum.qt.io/post/179486</link><guid isPermaLink="true">https://forum.qt.io/post/179486</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 15:45:14 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 15:25:50 GMT]]></title><description><![CDATA[<p dir="auto">So you are trying to modify a private class member from a static function ?</p>
<p dir="auto">That's not allowed</p>
]]></description><link>https://forum.qt.io/post/179481</link><guid isPermaLink="true">https://forum.qt.io/post/179481</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 16 May 2013 15:25:50 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 15:24:09 GMT]]></title><description><![CDATA[<p dir="auto">Yup. See below (displayProgram):</p>
<p dir="auto">@#ifndef BASICGUI_H<br />
#define BASICGUI_H</p>
<p dir="auto">#include &lt;QMainWindow&gt;<br />
#include &lt;QtGui&gt;<br />
#include &lt;QtCore&gt;</p>
<p dir="auto">namespace Ui {<br />
class BasicGui;<br />
}</p>
<p dir="auto">class BasicGui : public QMainWindow<br />
{<br />
Q_OBJECT</p>
<p dir="auto">public:<br />
explicit BasicGui(QWidget *parent = 0);<br />
~BasicGui();<br />
static void displayProgram(QString);</p>
<p dir="auto">private slots:<br />
void on_selectProgramButton_clicked();<br />
void on_loadProgramButton_clicked();</p>
<p dir="auto">private:<br />
Ui::BasicGui *ui;</p>
<p dir="auto">};</p>
<p dir="auto">#endif // BASICGUI_H@</p>
]]></description><link>https://forum.qt.io/post/179479</link><guid isPermaLink="true">https://forum.qt.io/post/179479</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 15:24:09 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 15:21:10 GMT]]></title><description><![CDATA[<p dir="auto">Is your separate function a member of BasicGui ?</p>
]]></description><link>https://forum.qt.io/post/179480</link><guid isPermaLink="true">https://forum.qt.io/post/179480</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 16 May 2013 15:21:10 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 15:03:16 GMT]]></title><description><![CDATA[<p dir="auto">I played around. If I put the following lines:</p>
<p dir="auto">@    ui-&gt;programTextEdit-&gt;setPlainText(line);<br />
ui-&gt;runButton-&gt;setEnabled(true);<br />
ui-&gt;pauseButton-&gt;setEnabled(true);@</p>
<p dir="auto">in the constructor, I get no build error. The errors only come up if I throw it in a separate function within my source file. Why is that?</p>
]]></description><link>https://forum.qt.io/post/179475</link><guid isPermaLink="true">https://forum.qt.io/post/179475</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 15:03:16 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 13:05:58 GMT]]></title><description><![CDATA[<p dir="auto">Just to clarify, nothing in my textEdit ("programTextEdit") works. I get the same error when I try accessing anything in the ui.</p>
]]></description><link>https://forum.qt.io/post/179457</link><guid isPermaLink="true">https://forum.qt.io/post/179457</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 13:05:58 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 12:20:32 GMT]]></title><description><![CDATA[<p dir="auto">Yes, I did clean the project and run qmake. Sorry, I forgot to mention that in my last post.</p>
]]></description><link>https://forum.qt.io/post/179454</link><guid isPermaLink="true">https://forum.qt.io/post/179454</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 12:20:32 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 12:13:31 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="raven-worx" date="1368705257"]If so, try to clean your project, run qmake again and build the project again.[/quote]</p>
<p dir="auto">Did you do this already? If not, try it please.</p>
]]></description><link>https://forum.qt.io/post/179453</link><guid isPermaLink="true">https://forum.qt.io/post/179453</guid><dc:creator><![CDATA[itsmemax]]></dc:creator><pubDate>Thu, 16 May 2013 12:13:31 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 12:10:46 GMT]]></title><description><![CDATA[<p dir="auto">I checked the ui_basicgui.h header and found it there:</p>
<p dir="auto">@class Ui_BasicGui<br />
{<br />
public:<br />
QWidget *centralWidget;<br />
QGroupBox *groupBox;<br />
QGridLayout *gridLayout;<br />
QHBoxLayout *horizontalLayout;<br />
QRadioButton *radioButton;<br />
QRadioButton *radioButton_2;<br />
QRadioButton *radioButton_3;<br />
QPushButton *machineOnButton;<br />
QPushButton *machineOffButton;<br />
QGroupBox *groupBox_4;<br />
QGridLayout *gridLayout_5;<br />
QGroupBox *groupBox_2;<br />
QFormLayout *formLayout;<br />
QLineEdit *lineEdit;<br />
QGridLayout *gridLayout_2;<br />
QPushButton *zPlusButton;<br />
QPushButton *yPlusButton;<br />
QPushButton *xMinusButton;<br />
QPushButton *xPlusButton;<br />
QPushButton *yMinusButton;<br />
QPushButton *zMinusButton;<br />
QGroupBox *groupBox_8;<br />
QGridLayout *gridLayout_3;<br />
QRadioButton *radioButton_4;<br />
QRadioButton *radioButton_5;<br />
QGroupBox *groupBox_6;<br />
QGridLayout *gridLayout_7;<br />
QTextEdit *programTextEdit;<br />
QPushButton *selectProgramButton;<br />
QGroupBox *groupBox_7;<br />
QGridLayout *gridLayout_8;<br />
QSlider *horizontalSlider;<br />
QPushButton *eStopButton;<br />
QWidget *layoutWidget;<br />
QVBoxLayout *verticalLayout_4;<br />
QGroupBox *groupBox_3;<br />
QGridLayout *gridLayout_10;<br />
QGridLayout *gridLayout_4;<br />
QLabel *label_4;<br />
QLabel *xPosActualLabel;<br />
QLabel *label_5;<br />
QLabel *yPosActualLabel;<br />
QLabel *label_6;<br />
QLabel *zPosActualLabel;<br />
QGroupBox *groupBox_5;<br />
QGridLayout *gridLayout_11;<br />
QGridLayout *gridLayout_6;<br />
QLabel *label_7;<br />
QLabel *xVelActualLabel;<br />
QLabel *label_8;<br />
QLabel *yVelActualLabel;<br />
QLabel *label_9;<br />
QLabel *zVelActualLabel;<br />
QWidget *layoutWidget1;<br />
QHBoxLayout *horizontalLayout_3;<br />
QPushButton *runButton;<br />
QPushButton *pauseButton;<br />
QPushButton *loadProgramButton;<br />
QToolBar *mainToolBar;<br />
QStatusBar *statusBar;@</p>
]]></description><link>https://forum.qt.io/post/179452</link><guid isPermaLink="true">https://forum.qt.io/post/179452</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 12:10:46 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 11:54:17 GMT]]></title><description><![CDATA[<p dir="auto">and you are sure Ui::BasicGui has a QTextEdit named "programTextEdit"?<br />
If so, try to clean your project, run qmake again and build the project again.</p>
]]></description><link>https://forum.qt.io/post/179449</link><guid isPermaLink="true">https://forum.qt.io/post/179449</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Thu, 16 May 2013 11:54:17 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 11:46:42 GMT]]></title><description><![CDATA[<p dir="auto">Hey, thanks for the quick responses and sorry about the code tags.</p>
<p dir="auto">I did include ui_basicgui.h in my project. It wasn't &lt;QTextEdit&gt; either. Here is the code again:</p>
<p dir="auto">@#include "basicgui.h"<br />
#include "ui_basicgui.h"<br />
#include "loadfile.h"<br />
#include "ui_loadfile.h"<br />
#include "ui_selectfile.h"<br />
#include "selectfile.h"<br />
#include &lt;QtDebug&gt;</p>
<p dir="auto">BasicGui::BasicGui(QWidget *parent) :<br />
QMainWindow(parent),<br />
ui(new Ui::BasicGui)<br />
{<br />
ui-&gt;setupUi(this);<br />
}</p>
<p dir="auto">BasicGui::~BasicGui()<br />
{<br />
delete ui;<br />
}</p>
<p dir="auto">void BasicGui::on_loadProgramButton_clicked()<br />
{<br />
LoadFile loadFileDialog;<br />
loadFileDialog.setModal(true);<br />
loadFileDialog.exec();<br />
}</p>
<p dir="auto">void BasicGui::on_selectProgramButton_clicked()<br />
{<br />
SelectFile selectFileDialog;<br />
selectFileDialog.setModal(true);<br />
selectFileDialog.exec();<br />
}</p>
<p dir="auto">void BasicGui::displayProgram(QString aPath)<br />
{<br />
QFile programFile(aPath);<br />
programFile.open(QIODevice::ReadOnly);<br />
QTextStream textStream(&amp;programFile);<br />
QString line = textStream.readAll();<br />
programFile.close();</p>
<pre><code>qDebug() &lt;&lt; line;
ui-&gt;programTextEdit-&gt;setPlainText(line);
ui-&gt;runButton-&gt;setEnabled(true);
ui-&gt;pauseButton-&gt;setEnabled(true);
</code></pre>
<p dir="auto">}<br />
@</p>
]]></description><link>https://forum.qt.io/post/179446</link><guid isPermaLink="true">https://forum.qt.io/post/179446</guid><dc:creator><![CDATA[rizoritis]]></dc:creator><pubDate>Thu, 16 May 2013 11:46:42 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 11:34:19 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Please encode your code in coding tags that will make it readable.</p>
<p dir="auto">Your are missing<br />
@#include &lt;QTextEdit&gt;@</p>
<p dir="auto">in your cpp file so the compiler doesn't know what it is</p>
<p dir="auto">edit: getting closer :D<br />
edit2: I missread the error, you are missing your ui_xxx include. The compiler doesn't know what ui is.</p>
]]></description><link>https://forum.qt.io/post/179443</link><guid isPermaLink="true">https://forum.qt.io/post/179443</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 16 May 2013 11:34:19 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] textEdit not letting me access any of its functions on Thu, 16 May 2013 11:33:37 GMT]]></title><description><![CDATA[<p dir="auto">first of all use code tags.</p>
<p dir="auto">the error message tells you that the compiler doesn't know the type of "programTextEdit". Did you include your ui-header file?</p>
]]></description><link>https://forum.qt.io/post/179439</link><guid isPermaLink="true">https://forum.qt.io/post/179439</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Thu, 16 May 2013 11:33:37 GMT</pubDate></item></channel></rss>