Qt-interest Archive, April 2007
how to remove a tab and how to remove a tab but page leaves?
Message 1 in thread
hi,
first say sorry if i confuse the concepts of tab,tabwidget,tabbar and page
QTabWidget *tabwidget=new QTabWidget(this);
QTextEdit *te1=new QTextEdit(this,"te1");
QTextEdit *te2=new QTextEdit(this,"te2");
tabwidget->addTab(te1,"tab1");
tabwidget->addTab(te2,"tab2");
setCentralWidget(tabwidget);
tabwidget->show();
tabwidget->showPage(te2);
now have create a tabwidget with two tabs ,each tab has a QTextEdit widget;
i want to remove a tab:
tabwidget->removePage(tabwidget->currentPage()); //here what
does 'Page' stand for?
and one tab disappears // if tab2 disappears,does qt free te2?
i want to remove a tab but leaves the QTextEdit widget:
(now only one tab exists)
first i use this :
tabwidget->removePage(tabwidget->currentPage()); // i cannot see te1;
so i use this:
tabwidget->hide();
setCentralWidget(te1); // not work
te1->raise();
tel->show();
then i use this:
setCentralWidget(te1);
delete tabwidget; // crash, does qt free te1 if i delete
tabwidget? but te1 is not tabwidget'
// child,
so i dont know how to remove a tab but leaves all widgets of this tab
( think firefox or konqueror , if you open a new tab with
'Location|New Tab' in konqueror, there will be
two tabs ,each has a ' text browse widget ' . if i close one tab,
this tab with its ' text browse widget'
disappears, and another tab also disappears but its 'text browser
widget ' leaves!! )
regards
jiang jefix
( Sorry if i wrote bad English )
--
[ signature omitted ]
Message 2 in thread
On 30.04.07 16:12:08, jiang jefix wrote:
> hi,
> first say sorry if i confuse the concepts of tab,tabwidget,tabbar and page
Are you ever reading any answers that people give you? I already told
you twice that you should be looking into hiding only the tabbar instead
of removing the tab.
> QTextEdit *te1=new QTextEdit(this,"te1");
> tabwidget->addTab(te1,"tab1");
>
> then i use this:
> setCentralWidget(te1);
> delete tabwidget; // crash, does qt free te1 if i delete
> tabwidget? but te1 is not tabwidget'
> // child,
When you execute addTab the given widget is reparented to the tabwidget,
thats why it crashes at that point.
Andreas
--
[ signature omitted ]
Message 3 in thread
i'm sorry but this is the first time i asked here...
please tell me how to fix it
i have tried my best to fix it for several days, but i cannot solve it,
please please give me some help
thanks
2007/4/30, Andreas Pakulat <apaku@xxxxxx>:
> On 30.04.07 16:12:08, jiang jefix wrote:
> > hi,
> > first say sorry if i confuse the concepts of tab,tabwidget,tabbar and page
>
> Are you ever reading any answers that people give you? I already told
> you twice that you should be looking into hiding only the tabbar instead
> of removing the tab.
>
> > QTextEdit *te1=new QTextEdit(this,"te1");
> > tabwidget->addTab(te1,"tab1");
> >
> > then i use this:
> > setCentralWidget(te1);
> > delete tabwidget; // crash, does qt free te1 if i delete
> > tabwidget? but te1 is not tabwidget'
> > // child,
>
> When you execute addTab the given widget is reparented to the tabwidget,
> thats why it crashes at that point.
>
> Andreas
>
> --
> You'll wish that you had done some of the hard things when they were easier
> to do.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]
Message 4 in thread
On 30.04.07 22:32:23, jiang jefix wrote:
> i'm sorry but this is the first time i asked here...
Yes, but you asked the same thing already twice on kde-devel.
> please tell me how to fix it
>
> i have tried my best to fix it for several days, but i cannot solve it,
> please please give me some help
I already gave you the answer in two mails on kde-devel.
Andreas
--
[ signature omitted ]
Message 5 in thread
i'm so stupid!!
mail form kde-devel in my gmail box title with 'kde-devel Digest, Vol
*, Issue *'
i never see my subject post in kde-devel,i thought there's no answer,
well,it all comes with 'kde-devel Digest, Vol *, Issue *'
why not kde-devel post mails single as qt-devel does?
so that i wouldnt check every 'kde-devel Digest, Vol *, Issue *' to look for my
post,
thanks for your suggestions and answers, i will try it later :-)
2007/4/30, Andreas Pakulat <apaku@xxxxxx>:
> On 30.04.07 22:32:23, jiang jefix wrote:
> > i'm sorry but this is the first time i asked here...
>
> Yes, but you asked the same thing already twice on kde-devel.
>
> > please tell me how to fix it
> >
> > i have tried my best to fix it for several days, but i cannot solve it,
> > please please give me some help
>
> I already gave you the answer in two mails on kde-devel.
>
> Andreas
>
> --
> Let me put it this way: today is going to be a learning experience.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]
Message 6 in thread
hi,again...
i have tried your suggestion
////// tabwidget->addTab(e,"tab1");
SLOT_closeTab()
{
if(tab_nums==1)
return;
else if(tab_nums==2){
tabwidget->removePage(tabwidget->currentPage());
setCentralWidget(e);
tabwidget->setTabBarHidden(true);
e->raise();
e->show();
tab_nums--;
return;
}
else{
tab_nums--;
tabwidget->removePage(tabwidget->currentPage());
}
it almost reach !!!
if there's two tabs and i click closeTab( SLOT_closeTab())
no tab exists, e is shown,but there's a white area between
menubar and e ( it's the place of original tab and tabbars)
i have set tabbar hidden,why leaves a white area?
thanks,
2007/4/30, jiang jefix <jefix214@xxxxxxxxx>:
> i'm so stupid!!
> mail form kde-devel in my gmail box title with 'kde-devel Digest, Vol
> *, Issue *'
> i never see my subject post in kde-devel,i thought there's no answer,
> well,it all comes with 'kde-devel Digest, Vol *, Issue *'
> why not kde-devel post mails single as qt-devel does?
> so that i wouldnt check every 'kde-devel Digest, Vol *, Issue *' to look for my
> post,
>
> thanks for your suggestions and answers, i will try it later :-)
>
> 2007/4/30, Andreas Pakulat <apaku@xxxxxx>:
> > On 30.04.07 22:32:23, jiang jefix wrote:
> > > i'm sorry but this is the first time i asked here...
> >
> > Yes, but you asked the same thing already twice on kde-devel.
> >
> > > please tell me how to fix it
> > >
> > > i have tried my best to fix it for several days, but i cannot solve it,
> > > please please give me some help
> >
> > I already gave you the answer in two mails on kde-devel.
> >
> > Andreas
> >
> > --
> > Let me put it this way: today is going to be a learning experience.
> >
> > --
> > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> > List archive and information: http://lists.trolltech.com/qt-interest/
> >
> >
>
--
[ signature omitted ]
Message 7 in thread
On 30.04.07 23:51:31, jiang jefix wrote:
> i'm so stupid!!
> mail form kde-devel in my gmail box title with 'kde-devel Digest, Vol
> *, Issue *'
> i never see my subject post in kde-devel,i thought there's no answer,
> well,it all comes with 'kde-devel Digest, Vol *, Issue *'
> why not kde-devel post mails single as qt-devel does?
Because you configured it that way in the mailman interface when you
subscribed. By default the "use a digest" is off.
Andreas
--
[ signature omitted ]
Message 8 in thread
yes,
please take a look at pre-post
thanks
2007/5/1, Andreas Pakulat <apaku@xxxxxx>:
> On 30.04.07 23:51:31, jiang jefix wrote:
> > i'm so stupid!!
> > mail form kde-devel in my gmail box title with 'kde-devel Digest, Vol
> > *, Issue *'
> > i never see my subject post in kde-devel,i thought there's no answer,
> > well,it all comes with 'kde-devel Digest, Vol *, Issue *'
> > why not kde-devel post mails single as qt-devel does?
>
> Because you configured it that way in the mailman interface when you
> subscribed. By default the "use a digest" is off.
>
> Andreas
>
> --
> Look afar and see the end from the beginning.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]