PDA

View Full Version : a problem in GUI



joseph ajay
3rd March 2010, 09:24
i need to create a GUI that acts as a middle ware for secure data storage.in it there are three tabs1
1.A general tab for the mount point of the drive to be specified.

2.second and third tabs for ftp and gmail adapters where the encrypted storage of data is done.

the problem is that since there may be other adapters too in the mounted drive,the GUI must search for the adapters in the drive and tabs have to be created dynamically while the program is run.
eg.if there is an adapter 1bcg.so,then a tab with the adapter name 1bcg...

so my question is regarding how to create tabs dynamically by searching for adapters

aamer4yu
3rd March 2010, 09:32
If you are using QTabWidget, then simply QTabWidget::addTab :)

Lykurg
3rd March 2010, 09:32
Search for plugins
Create a new widget with the corresponding configuration options
add that widget to your tab widget using QTabWidget::addTab()

prof.ebral
3rd March 2010, 19:25
Here is how I am doing that in my program:

## Creates New Chat Tab
def newChatTab(self, tabLabel):
self.chatTabs[tabLabel] = ViewDock()
QtCore.QObject.connect(self.chatTabs[tabLabel].viewPage,
QtCore.SIGNAL('linkClicked(const QUrl&)'), self.linkClicked)
QtCore.QObject.connect(self.chatTabs[tabLabel].viewPage,
QtCore.SIGNAL('linkHovered(const QString&, const QString&, const QString&)'),
self.parent.StatusBar)
self.chatView.addTab(self.chatTabs[tabLabel], tabLabel)

The ViewDock() calls a widget that I dock into the tab that has been created, and the connections are for URL links. One connection is linked to a function that creates a new tab for an in house browser, and the other connection sends the URL of the link hovered over to the status bar.

Anytime i need a new tab I can just call self.newChatTab("Tab Name") and I will make a new tab with the string being passed.