Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Try
![]()
Source code
1 mdiArea->setVisible(true);
It works for me.
This post has been edited 1 times, last edit by "herk" (Jul 24th 2009, 12:25pm)
Hm.. very very strange...
evendoes not work correctly.
![]()
Source code
1 ui->mdiArea->removeSubWindow(.....);
This post has been edited 1 times, last edit by "herk" (Jul 25th 2009, 12:43pm)
1)
reimplement
void QWidget::closeEvent( QCloseEvent * ev )
or better
clear flag deleteOnClose
setAttribute(Qt::WA_DeleteOnClose, false);|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
class MainWindow1 : public QMainWindow
{
Q_OBJECT
public:
MainWindow1(QWidget *parent = 0);
~MainWindow1();
// THIS IS A POINTER TO CLASS WITH QTabWidget
DanePrzychodni * dp_table;
public slots:
void w1_action_dane_przychodni();
private:
Ui::MainWindow1 * ok1;
};
MainWindow1::MainWindow1(QWidget *parent)
: QMainWindow(parent),ok1(new Ui::MainWindow1)
{
ok1->setupUi(this);
// CREATE OBJECT
dp_table = new DanePrzychodni;
}
MainWindow1::~MainWindow1()
{
if(ok1)
{
delete ok1;
ok1 = 0;
}
}
void MainWindow1::w1_action_dane_przychodni()
{
dp_table->show();
// SHOW TAB WIDGET
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
class DanePrzychodni : public QTabWidget
{
Q_OBJECT
public:
DanePrzychodni(QWidget *parent = 0);
~DanePrzychodni();
private:
Ui::DanePrzychodni * DP;
};
DanePrzychodni::DanePrzychodni(QWidget *parent)
: QTabWidget(parent),DP(new Ui::DanePrzychodni)
{
DP->setupUi(this);
}
DanePrzychodni::~DanePrzychodni()
{
if(DP)
{
delete DP;
DP = 0;
}
}
|