简体   繁体   中英

Custom Tab Widget Plugin Creation for Qt designer

We're building a custom tab widget for our project and I'm creating a Designer plugin for it. I'm having trouble getting the same functionality as the standard tab widget.

I'd like to have our widget mimic the same behavior to: 1) allow changing tab inside of designer by clicking the tabs 2) show "browned out" properties (eg, if no tabs are on the widget)

I've created a collection and property extension for the widget, and I've got it to add/insert/delete tabs, but I haven't been able to find out how to do these two things.

Is the source code for the tab widget plugin available somewhere? Or does anyone know how which methods to attach to the widget from designer to do this?

I found the Designer source under the QtSDK folder and located the piece that appears to deal with clicks. it looks like what they do is when the plugin creates the widget they attach an event handler to the widget using installEventFilter().

The handler then checks for left mouse clicks and sends a command to designer to set the currentIndex property to the correct value.

The source to check it out is in qdesigner_tabwidget.cpp.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM