Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved How to map a ui->Widget to PaintEvent

    General and Desktop
    2
    2
    56
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      leinad last edited by

      I have a bunch of tabs which I built using QtCreator. In mainwindow you can access the tabs using ui->tabWidget->blahblah

      I'd like to know how I can access paintEvents for ui->tabWidget?

      I had a similar post earlier but that was when I created my own tabs programmatically and subclass QTabBar and QTabWidget. But now I have a new requirement where the tabs have already been created using QTCreator and I'd like to change the color of the tabs.

      Any help would be appreciated!

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        You can't. If you want to do custom painting, you need to subclass. You can then use the promote feature of designer to use your subclass.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 2
        • First post
          Last post