Note that there are some explanatory texts on larger screens.

plurals
  1. POconnect from a QTab (in a QTabWidget) back to QMainWindow
    text
    copied!<p>The main Part of my Application is a Systray-Menu. For maintenance there should be a normal GUI.</p> <p>My Problem is that now I have to create two Signal/Slot-Connections back to the MainWindow from each Tab. This is for minimizing the GUI and to update the Menu. I don't know how to do this.</p> <p>I tried to connect with <code>this-&gt;parent-&gt;parent</code> from the ManageSession and <code>ui_manag-&gt;session_ui-&gt;minimizeButton</code> from MainWindow. I have a little knot in my head and am asking for help. Or should I re-think my design? I´m using only QtCreator 2.6.1 with Qt 4.8.4.</p> <p><a href="http://firewall.ztweb.de/StackOverflow-Screenshots.jpg" rel="nofollow">Screenshots of the GUI-Elements</a></p> <p>This is the mainwindows.cpp:</p> <pre><code>MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { setWindowTitle(QCoreApplication::applicationName()); QWidget *mainWidget = new QWidget; QTabWidget *ui_manag = new ManageTab; QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout-&gt;addWidget(ui_manag); mainWidget-&gt;setLayout(mainLayout); setCentralWidget(ui_manag); ui_manag-&gt;setCurrentIndex(0); //Here comming Code to setup a TrayIcon, the Database and the Menus } </code></pre> <p>The Tab is completely generated by the Designer:</p> <pre><code>ManageTab::ManageTab(QWidget *parent) : QTabWidget(parent), tab_ui(new Ui::ManageTab) { tab_ui-&gt;setupUi(this); } </code></pre> <p>For each Setting I use the same GUI with multiple inheritance:</p> <pre><code>ManageSession::ManageSession(QWidget *parent) : QWidget(parent), session_ui(new Ui::ManageWidget) { session_ui-&gt;setupUi(this); session_ui-&gt;manageLabel-&gt;setText(tr("Manage Session")); connect(session_ui-&gt;addButton, SIGNAL(clicked()), this, SLOT(addButton_clicked())); connect(session_ui-&gt;editButton, SIGNAL(clicked()), this, SLOT(editButton_clicked())); connect(session_ui-&gt;deleteButton, SIGNAL(clicked()), this, SLOT(deleteButton_clicked())); } //Here follows the Functions for manipulating the TableView // and emmiting a Signal to Update the Menu </code></pre>
 

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