PDA

View Full Version : Designer Plugin - multiple labels button



tihoulas
6th October 2010, 13:39
Hi,

I am trying to develop a ne type of button, whitch can display up to four labels or symbols.

This is quite easy, until I try to get it working in QtDesigner. I already have my new button, an heavily customized QPushButton, showing as a custom plugin, and its properties available through the property editor.

What I would like, though, is to be able, when double clicking one of the four regions of my button, to display an on-place editor to customize the corresponding label, instead of editing the QPushButton text.

I can't find how to do that in Qt documentation.

Does anybody know whether this is even possible ?

tbscope
6th October 2010, 16:24
Create a task menu extension:
http://doc.qt.nokia.com/4.7/designer-creating-custom-widgets-extensions.html

Then when your custom action is triggered, create a dialog with the settings.

tihoulas
7th October 2010, 20:32
Yes, that would work, but that is not exactly what I had in mind.
My class extends the QPushButton class. Thus, when I double click it on the form editor in QtDesigner, it shows a line edit to modify the QPushButton text. What I wanted to do was to override this behaviour in a way that when I double click, it shows a line edit on one quarter of my button to edit one of its four labels.

However, after searching into QtDesigner source code where this behaviour (for QPushButtons) was coded, I think what I intended might not be possible without modifying the Designer source code :( .