I tried to play with Icons, I couldn't get any visual problem. How is your TabButton implemented?
I tried to play with Icons, I couldn't get any visual problem. How is your TabButton implemented?
Hi. In the attached zip, you will find 4 files.
Please note that this tab layout, in case I have not already explained, is used in a web browser application.
tabs.cpp and tabs.h
This includes the following classes:
TabPreviewer - A QLabel designed to display a QPixmap(The website rendered and resized), as well as the website title.
TabButton - The QPushButton that is the base tab
TabMenu - This can be ignored. It is a QListWidget that is designed to essentially show a list of all the tabs upon a button being clicked.
TabBar - This is where most of the guts occurs. It is the QWidget containing all the visual stuff.
Tabs - This is the QStackedWidget. Each widget in here is a "Tab" object, and inside that "Tab" object is a QWebView(well, a derived version of QWebView [BrowserView]). The only reason you should need to look through this is if you want to see how variables in TabBar/TabButton interact with it.
And then there is tab.cpp and tab.h:
This is just the Tab class. A Tab is a QWidget containing a BrowserView[derived from QWebView].
At some point soon, I will more than likely seperate each class in to it's own file.
I apologize for the messiness of my code. If there is something you can not understand or have questions about, feel free to ask me.
I thought it would be best to send you this instead of going back and forth between everything, as the problem may or may not be in something I have not talked about much yet.
Thanks a lot for your help, it is really appreciated.
UPDATE: Issue is fixed. Someone on IRC told me that removeAt/removeWidget just removes the item from the list/layout - it doesn't delete the item. In the TabBar::removeAt method, I remove the TabButton, and then (I didn't do this before) I delete the actual TabButton object. This seems to solve all my problems.
Thanks a lot to everyone who helped.
Last edited by TimeBomb; 18th June 2011 at 10:23.
I was just going to write that...
Bookmarks