The RadTabWidget class class provides a stack of tabbed widgets in a window pane. Each tab may contain other controls.
Overview
The new function creates a new RadTabWidget object and returns a pointer to the newly created object. The RadTabWidget object allows specification of position of the tabs with tabPosition argument, their shape by tabShape. The RadTabWidget: symbol is one of the class key words accepted by the qt new: function. There can be many RadTabWidgets.
Syntax
(setq radTabWidgetPtr (qt new: RadTabWidget: tabPosition tabShape)) ;; Create a new RadTabWidget
Arguments
radTabPosition | radTabPosition must be between 0 and 3.The value 0 specifies that the tab be drawn above the pages, 1 specifies tab position below the pages, 2 specifies tab on the left position, 3 specifies right position |
radTabShape | radTabShape must be between 0 and 1.A radTabShape value 0 means square tabs (default shape), a value 1 means triagular shaped tabs |
Example1
(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radLabelPtr (qt new: RadLabel: "Hello World")) ;; Create a new RadLabel object
(setq radTabWidgetPtr (qt new: RadTabWidget: 2 1)) ;; create a new RadTabWidgetObject left of pane with square shaped tabs
(setq tabIndex (qt radTabWidgetPtr addTab: radLabelPtr "SubTab" editMgr )) ;; Add a new tab to the main window left tab bar
(setq tabIndex (qt mainWindow: addTab: radTabWidgetPtr "MyTab" editMgr )) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
Overview
The delete function destroys a RadTabWidget object and returns a null pointer.
Syntax
(qt delete: radTabWidgetPtr)
Arguments
radTabWidgetPtr | The pointer to the radTabWidgetPtr object to be destroyed. |
nullPtr | Always returns a null pointer. |
Example1
(setq radTabWidgetPtr (qt new: RadTabWidget: 0 1)) ;; Create a RadTabWidget object.
(setq radWidgetPtr (qt delete: radTabWidgetPtr)) ;; Destroy the RadTabWidget object.
Overview
The RadTabWidget addTab function Add a new tab to the RadTabWidget which is appended to the right .
Syntax
(qt radTabWidgetPtr addTab: title tabMgr)
Arguments
title | A string describing the Tab |
tabMgr | The name of the Tab manager function |
true | Always returns true |
Example1
(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radLabelPtr1 (qt new: RadLabel: "Hello World")) ;; Create a new RadLabel object
(setq radLabelPtr2 (qt new: RadLabel: "Goodbye World")) ;; Create a new RadLabel object
(setq radTabWidgetPtr (qt new: RadTabWidget: 2 1)) ;; create a new RadTabWidgetObject left of pane with square shaped tabs
(setq tabIndex (qt radTabWidgetPtr addTab: radLabelPtr1 "SubTab0" editMgr )) ;; Add a new tab to the main window left tab bar
(setq tabIndex (qt radTabWidgetPtr addTab: radLabelPtr2 "SubTab1" editMgr )) ;; Add a new tab to the main window left tab bar
(setq tabIndex (qt mainWindow: addTab: radTabWidgetPtr "MyTab" editMgr )) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
Overview
The RadTabWidget insertTab function Insert a new tab to the RadTabWidget. The new tab is appended to the right.
Syntax
(qt radTabWidgetPtr insertTab:tabIndex radWidgetPtr title tabMgr)
Arguments
tabIndex | The position to insert the new tab |
radWidgetPtr | The parent widget object (of the tabWidget) |
title | A string describing the Tab |
tabMgr | The name of the Tab manager function |
true | Always returns true |
Example1
(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radLabelPtr (qt new: RadLabel: "Hello World")) ;; Create a new RadLabel object
(setq radTabWidgetPtr (qt new: RadTabWidget: 2 1)) ;; create a new RadTabWidgetObject left of pane with square shaped tabs
(setq tabIndex (qt radTabWidgetPtr addTab: radLabelPtr "Sub1Tab" editMgr )) ;; Add a new tab to the main window left tab bar
(setq tabIndex (qt mainWindow: addTab: radTabWidgetPtr "MyTab" editMgr )) ;; Add a new tab to the main window horizontal tab bar
(setq tabIndex (qt radTabWidgetPtr insertTab: 0 radLabelPtr "Sub0Tab" editMgr)) ;; Insert a new tab in the 0th position in the horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
Overview
The RadTabWidget removeTab function removes a tab from the RadTabWidget.
Syntax
(qt radTabWidgetPtr removeTab: tabIndex)
Arguments
tabIndex | The position of the tab to remove |
true | Always returns true |
Example1
(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radLabelPtr1 (qt new: RadLabel: "Hello World")) ;; Create a new RadLabel object
(setq radLabelPtr2 (qt new: RadLabel: "Goodbye World")) ;; Create a new RadLabel object
(setq radTabWidgetPtr (qt new: RadTabWidget: 2 1)) ;; create a new RadTabWidgetObject left of pane with square shaped tabs
(setq tabIndex (qt radTabWidgetPtr addTab: radLabelPtr1 "SubTab0" editMgr )) ;; Add a new tab to the main window left tab bar
(setq tabIndex (qt radTabWidgetPtr addTab: radLabelPtr2 "SubTab1" editMgr )) ;; Add a new tab to the main window left tab bar
(setq tabIndex (qt mainWindow: addTab: radTabWidgetPtr "MyTabDemo" editMgr )) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(sleep 5000) ;; wait
(qt radTabWidgetPtr removeTab: 1)