wMain :=MaakMain("wMain")
oCW :=Widget():New("oCW",wMain)
oCW :CentralWidgetOF(wMain)
oLB :=LayoutBox():New("oLB",oCW,LAYOUT_TOPTOBOTTOM)
with object oTab:=Tab():New("oTab")
oTP1:=MaakTP1("oTP1",oTab)
oTP2:=MaakTP2("oTP2",oTab)
oTP3:=MaakTP3("oTP3",oTab)
end
OLB:add(oTab)
//oTab:hide() -> good, the tabblad is hide
oTP2:hide() -> doe's not work and
ON KEY F4 OF WMAIN ACTION {|| oTP2:hide() , oTp2:Refresh() } doe's not work
ON KEY F4 OF WMAIN ACTION {|| oTP2:hide() , msgstop("Test") oTab:Hide(), msgstop("Test"),oTab:Show()
The hide of oTab and the show on oTab works good with F4 (oTP2 doesn't hide)
(i have also tried it with oTab -> oTab.oTP2:hide() but does not work)
Any suggestions ?
How to hide a tabpage ?
Moderator: Rathinagiri
Re: How to hide a tabpage ?
oTp2:visible(.f.) has no result.
Re: How to hide a tabpage ?
i can do oTP2:Enabled(.f.)
There is no (not yet a) methode for remove in hmg.4
Something like:
There is no (not yet a) methode for remove in hmg.4
Something like:
Code: Select all
void MainWindow::removeTab(int index)
{
QString classname = ui->tabWidget->widget(index)->metaObject()->className();
ui->tabWidget->removeTab(index);
if (classname == "FormAccounts")
{
delete formAccounts;
formAccounts = 0;
}
ui->listWidget->clearSelection();
ui->listWidget->setCurrentRow(-1);
}
Re: How to hide a tabpage ?
Thank you for the link.mrduck wrote:It seems it is not supported by Qt.
http://lists.trolltech.com/qt-interest/ ... 600-0.html
Re: How to hide a tabpage ?
i have changed svn\samples\demo_1.prg. This to test enabled(.f.)
(add three or four lines)
(add three or four lines)
Code: Select all
#include "hmg.ch"
#include "hbqtgui.ch"
FUNCTION Main
LOCAL oTab
LOCAL oPage1
LOCAL oPage2
LOCAL oWindow
HbQt_ErrorSys()
WITH OBJECT oWindow := MAINWINDOW():New()
:Row := 10
:Col := 10
:Width := 400
:Height := 400
:Title := 'Nice OOP Demo!!!'
:OnInit := { || oWindow:Center() }
WITH OBJECT MainMenu():New()
WITH OBJECT MenuPopup():New( 'PopupPageTest',, 'Page Tests' )
WITH OBJECT MenuItem():New( 'Item1',, 'SET oPage1 Caption' , { || oPage1:Caption := 'New' } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item2',, 'SET oPage1 Image' , { || oPage1:Image := 'open.png' } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item3',, 'SET oPage1 Disable' , { || oPage1:Enabled := .F. } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item4',, 'SET oPage1 Enable' , { || oPage1:Enabled := .T. } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item5',, 'SET oPage1 ToolTip' , { || oPage1:ToolTip := 'ToolTip' } ) ; END WITH
END WITH
WITH OBJECT MenuPopup():New( 'PopupTabTest',, 'Tab Tests' )
WITH OBJECT MenuItem():New( 'Item6' ,, 'SET Tabs Position (Top)' , { || oTab:Position := TAB_TOP } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item7' ,, 'SET Tabs Position (Bottom)' , { || oTab:Position := TAB_BOTTOM } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item8' ,, 'SET Tabs Position (Left)' , { || oTab:Position := TAB_LEFT } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item9' ,, 'SET Tabs Position (Right)' , { || oTab:Position := TAB_RIGHT } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item10',, 'SET Tabs Shape (Triangular)', { || oTab:Shape := TAB_TRIANGULAR } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item11',, 'SET Tabs Shape (Rounded)' , { || oTab:Shape := TAB_ROUNDED } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item12',, 'SET Active Page TO 1' , { || oTab:Value := 1 } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item13',, 'SET Active Page TO 2' , { || oTab:Value := 2 } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item14',, 'SET OnChange Event' , { || oTab:OnChange := { || MsgInfo( 'Changed' ) } } ) ; END WITH
WITH OBJECT MenuItem():New( 'Item15',, 'Clear OnChange Event' , { || oTab:OnChange := { || NIL } } ) ; END WITH
END WITH
END WITH
oWindow:QTObject:setObjectName( "oWindow" )
WITH OBJECT oTab := Tab():New()
:Row := 30
:Col := 10
:Width := 300
:Height := 300
:Position := 0
WITH OBJECT oPage1 := TabPage():New()
:Caption := 'One'
WITH OBJECT Button():New()
:Row := 20
:Col := 20
:Width := 100
:Caption := 'OOP Button!!!'
:OnClick := { || MsgInfo( 'Test' ) }
END WITH
END WITH
WITH OBJECT oPage2 :=TabPage():New()
:Caption := 'Two'
WITH OBJECT EditBox():New()
:Row := 20
:Col := 20
:Width := 100
:Height := 100
:Value := 'Hey!!!'
:ScrollBars := EDB_NONE
:ToolTip := 'This is a ToolTip'
END WITH
END WITH
END WITH
END WITH
ON KEY F4 OF oWindow ACTION {|| oPage2:Enabled(.f.) , msgstop("test") }
oWindow:Activate()
RETURN NIL
Re: How to hide a tabpage ?
Today there is, in QT, a TabRemoved(int index) and
http://qt.gitorious.org/qt/qt/blobs/4.7 ... .h#line161
http://qt.gitorious.org/qt/qt/blobs/4.7 ... .h#line161