Results 1 to 4 of 4

Thread: a problem in GUI

  1. #1
    Join Date
    Mar 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question a problem in GUI

    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

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: a problem in GUI

    If you are using QTabWidget, then simply QTabWidget::addTab

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: a problem in GUI

    1. Search for plugins
    2. Create a new widget with the corresponding configuration options
    3. add that widget to your tab widget using QTabWidget::addTab()

  4. #4
    Join Date
    Feb 2010
    Posts
    96
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: a problem in GUI

    Here is how I am doing that in my program:
    Qt Code:
    1. ## Creates New Chat Tab
    2. def newChatTab(self, tabLabel):
    3. self.chatTabs[tabLabel] = ViewDock()
    4. QtCore.QObject.connect(self.chatTabs[tabLabel].viewPage,
    5. QtCore.SIGNAL('linkClicked(const QUrl&)'), self.linkClicked)
    6. QtCore.QObject.connect(self.chatTabs[tabLabel].viewPage,
    7. QtCore.SIGNAL('linkHovered(const QString&, const QString&, const QString&)'),
    8. self.parent.StatusBar)
    9. self.chatView.addTab(self.chatTabs[tabLabel], tabLabel)
    To copy to clipboard, switch view to plain text mode 

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.