Note that there are some explanatory texts on larger screens.

plurals
  1. POQt problem when working over classes GUI access
    primarykey
    data
    text
    <p>I got 2 classes:<br> - MainWindow (Was the default class)<br> - ExtraClass (That i created myself)</p> <p>Inside the class MainWindow i've made a public function called "logger". This function looks like this:</p> <pre><code>// Takes in a QString and appends it to a QTextEdit. void MainWindow::logger(QString Log_MSG) { ui-&gt;Logg-&gt;append(Log_MSG); } </code></pre> <p>This logger functions works out as expected inside its own Class <code>MainWindow</code> but when i try to pass in a MSG into logger from the class <code>ExtraClas</code>s, it suddenly doesn't work.</p> <p>My approach to accessing logger from <code>MainWindow</code> to <code>ExtraClass</code>:</p> <pre><code>MainWindow Con; Con.logger("The Message the will get appended to ui-&gt;logg"); </code></pre> <p>So the question, what have i missed? I don't get any errors and the text "Log_MSG" that should be appended to the <code>QTextEdit</code> Log don't execute. </p> <ul> <li>Sorry for the style, i just don't understand how to get it to look good.</li> </ul> <p>EDIT:</p> <p>I've already tried to access other functions from "MainWindow class" and that works but when i try to pass a string this particuallry function "logger" from another class nothing happens.</p> <p>For an instance:</p> <p><code>MainWindow MainWindow; </code> <code>int ANumber = MainWindow.GiveMeAValue(); // This works</code></p> <p>But when i'm doing this:</p> <p><code>MainWindow MainWindow; MainWindow.logger("Log MSG"); // This dosen't work</code></p> <p>My guess is that the problem lies in the appendment of a QString passed in into the main class that was automatically created by Qt (have stuff like ui->abc) from another class. But in my current level of understandment of Qt i don't really know where to troubleshoot beocuse i don't even get an error.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload