1. Ich habe 2 verschiedene tabs das erste ist im mainwindow als Globales
tab im MainWindow.ui erstellt

und 2. eine weiteren tab extern im GroupsTab.ui

ich will per Button klick den externen tab in meinem Globalen tab angehängt haben.
Nun klappt es leider noch nicht mit:
Code: Alles auswählen
connect( ui.Buttonok, SIGNAL(clicked()), this, SLOT(addgrouptab())); später wenn das klappen sollte, soll es per removeTab() wieder den tab entfernen.
hier mein sourcen:
Code: Alles auswählen
#include "JoinDialog.h"
#include "gui/groups/GroupsTab.h"
#include <QTabWidget>
/* Define the format used for displaying the date and time */
#define DATETIME_FMT "MMM dd hh:mm:ss"
/** Default constructor */
JoinDialog::JoinDialog(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
connect( ui.Buttonok, SIGNAL(clicked()), this, SLOT(addgrouptab()));
}
void
JoinDialog::show()
{
//loadSettings();
if(!this->isVisible()) {
QDialog::show();
}
}
void JoinDialog::addgrouptab()
{
tabWidget = new QTabWidget;
tabWidget->addTab(new GroupsTab(), tr("General"));
}Code: Alles auswählen
#include <QtGui>
#ifndef _JOINDIALOG_H
#define _JOINDIALOG_H
#include "ui_JoinDialog.h"
class JoinDialog : public QDialog
{
Q_OBJECT
public:
/** Default constructor */
JoinDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */
public slots:
/** Overloaded QWidget.show */
void show();
protected:
void closeEvent (QCloseEvent * event);
private slots:
void addgrouptab();
private:
QTabWidget *tabWidget;
Ui::JoinDialog ui;
};
#endifCode: Alles auswählen
<widget class="QTabWidget" name="tabWidget" >
Code: Alles auswählen
"<widget class="QTabWidget" name="grouptabWidget" >"das MainWindow.ui befindet such unter gui/MainWindow.ui/
mein JoinDialog.cpp/h befindet sich unter gui/join/JoinDialog.cpp/.h
nun habe ich nirgends was gelesen wie man von einem .ui das tab hinzufügen kann in einem mainwindow tab?
