Results 1 to 1 of 1

Thread: QTabWidget clicking problems after addTab()

  1. #1
    Join Date
    Oct 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTabWidget clicking problems after addTab()

    Hi!
    I'm experiencing a strange problem: i have a QTabWidget, with one fixed tab, with the tab text "First tab page". The QTabWidget and the first tab are created via the Qt Designer.

    Now I'm adding some tabs in the C++ code, by calling .addTab().

    When the program starts, and I want to navigate between the tabs, the following problem occurs: I can only activate the first tab, when I click on the rightmost part of the tabname. So only if the mouse curser is over the last characters of the tab title "First tab page" ("age") the click is recognized.

    I think this may be kind of a redraw problem.

    Can anyone give me a hint, where to start getting this fixed?

    Note: I'm using Qt 4.2.1 (and have to stick with that version)

    Edit: I tried to locate the problem, by inserting some dummy tabs. I now know, that the problem isn't related to the first tab, but to a region where no clicks are recognized. I.e. if i add some dummy tabs before the first, which didn't work, I cant activate them at all. So there seems to be a region of pixels in the GUI, where the mouse clicks aren't captured

    Edit2: I found the problem myself: I implemented a class for updating the QTabView: "class MyTabDelegate : public QWidget {...}"

    When instanciating the class, I set it's parent to my QTabWidget. Obviously this messed things up. I changed the parent to "centralwidget" (the main widget of my menu based application). After that, the problem disappeared.
    Last edited by DonSam; 14th October 2008 at 10:13.

Similar Threads

  1. Problems with CSS for QTabBar and QTabWidget
    By visor_ua in forum Qt Programming
    Replies: 1
    Last Post: 25th July 2008, 09:38

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.