| View previous topic :: View next topic |
| Author |
Message |
matthieuguillo
Joined: 21 Jul 2005 Posts: 95
|
Posted: Mon Sep 26, 2005 15:09 Post subject: Qt Extensions custom widgets |
|
|
Hi Rooters
I am trying to use the BNL contribution to qt-root, the Qt Extension not in the offcial ROOT distribution.
There is a TQtWidget (also in the official ROOT package) and the ".cw" assiociated file that allows me to use "designer". This is explained well in the ROOT manual and it works fine.
But in the "Qt extension" made by BNL, there are other objects I am very interested too, for instance "TQtColorSelectButton". But there is no ".cw" associated file to allow to have an easy manipulation in "designer". How can I create such files?
Of course I could use the libraries directly but positionning widgets is much easier with designer.
Thahks for your help
_________________ Matthieu Guillo
EDF Clamart |
|
| Back to top |
|
 |
fine

Joined: 03 Sep 2003 Posts: 771 Location: BNL, Upton, USA
|
Posted: Thu Sep 29, 2005 8:55 Post subject: Re: Qt Extensions custom widgets |
|
|
| matthieuguillo wrote: | Hi Rooters
I am trying to use the BNL contribution to qt-root, the Qt Extension not in the offcial ROOT distribution.
There is a TQtWidget (also in the official ROOT package) and the ".cw" assiociated file that allows me to use "designer". This is explained well in the ROOT manual and it works fine.
But in the "Qt extension" made by BNL, there are other objects I am very interested too, for instance "TQtColorSelectButton". But there is no ".cw" associated file to allow to have an easy manipulation in "designer". How can I create such files?
Of course I could use the libraries directly but positionning widgets is much easier with designer.
Thahks for your help |
Qt documentation does define the way to create the "Custom widget defintion" from that C++ class header file.
http://doc.trolltech.com/3.3/designer-manual-7.html
| Quote: | | "Adding the Custom Widget to Qt Designer" |
In brief, they say you should load the C++ class header file into Qt designer and then save it with "cw" format.
One needs no re-compilation or any change of that class code.
What about omission. I did not create yet the "cw" for many Qt/Root classes because I am not sure yet theier interfaces are stable enough to advice it to the end-user. This means you can add any class you want to the Qt desinger yourself, it is simple . . . but you should be carefull.
On the other hands I appreciate any early user feed-back to make these class interfaces up and stable.
_________________ ---
Hope this helps
Valeri Fine |
|
| Back to top |
|
 |
fine

Joined: 03 Sep 2003 Posts: 771 Location: BNL, Upton, USA
|
Posted: Fri Sep 30, 2005 11:49 Post subject: Re: Qt Extensions custom widgets |
|
|
quote="matthieuguillo"]
But in the "Qt extension" made by BNL, there are other objects I am very interested too, for instance "TQtColorSelectButton". But there is no ".cw" associated file to allow to have an easy manipulation in "designer". How can I create such files?
Of course I could use the libraries directly but positionning widgets is much easier with designer.
[/quote]
I can promise in a week (i.e. as soon as ROOT 2005 Workshop and my trip are over) to revise and provide "cw" files for
| Code: |
TQtFloatSpinBox.h
TQtColorSelecButton.h
TQtPatternSelectButton.h
|
Hope this is what you implied.
_________________ ---
Hope this helps
Valeri Fine |
|
| Back to top |
|
 |
matthieuguillo
Joined: 21 Jul 2005 Posts: 95
|
Posted: Fri Sep 30, 2005 12:16 Post subject: Re: Qt Extensions custom widgets |
|
|
| fine wrote: | quote="matthieuguillo"]
But in the "Qt extension" made by BNL, there are other objects I am very interested too, for instance "TQtColorSelectButton". But there is no ".cw" associated file to allow to have an easy manipulation in "designer". How can I create such files?
Of course I could use the libraries directly but positionning widgets is much easier with designer.
|
I can promise in a week (i.e. as soon as ROOT 2005 Workshop and my trip are over) to revise and provide "cw" files for
| Code: |
TQtFloatSpinBox.h
TQtColorSelecButton.h
TQtPatternSelectButton.h
|
Hope this is what you implied.[/quote]
HI Valeri
Yes, that is exactly what I implied. Tha will be great. Actually I tried what you told me, and loaded the header files in designer but somehow it didn't work, I think it is because in the header files there is more than one declaration object?
Thanks
_________________ Matthieu Guillo
EDF Clamart |
|
| Back to top |
|
 |
fine

Joined: 03 Sep 2003 Posts: 771 Location: BNL, Upton, USA
|
Posted: Tue Oct 25, 2005 19:39 Post subject: Re: Qt Extensions custom widgets |
|
|
| matthieuguillo wrote: |
| Code: |
TQtFloatSpinBox.h
TQtColorSelecButton.h
TQtPatternSelectButton.h
|
HI Valeri
Yes, that is exactly what I implied. Tha will be great. Actually I tried what you told me, and loaded the header files in designer but somehow it didn't work, I think it is because in the header files there is more than one declaration object?
|
Hello
I have updated the QT extension library and included the 3 new "Custom widgets"
http://root.bnl.gov/QtRoot/pictures/QtROOTCustomWidgets.png
I added the "CustomWidgest" project under qtRoot/qtExamples/CustomWidgets"
http://root.bnl.gov/QtRoot/root/qtExamples/CustomWidgets/README
The examlpe was done with the Qt designer without any hard-written code
Please update your local version
_________________ ---
Hope this helps
Valeri Fine |
|
| Back to top |
|
 |
matthieuguillo
Joined: 21 Jul 2005 Posts: 95
|
Posted: Sat Nov 05, 2005 0:24 Post subject: Re: Qt Extensions custom widgets |
|
|
Hi Valeri
I will use them in my application. Thanks a lot.
| fine wrote: | | matthieuguillo wrote: |
| Code: |
TQtFloatSpinBox.h
TQtColorSelecButton.h
TQtPatternSelectButton.h
|
HI Valeri
Yes, that is exactly what I implied. Tha will be great. Actually I tried what you told me, and loaded the header files in designer but somehow it didn't work, I think it is because in the header files there is more than one declaration object?
|
Hello
I have updated the QT extension library and included the 3 new "Custom widgets"
http://root.bnl.gov/QtRoot/pictures/QtROOTCustomWidgets.png
I added the "CustomWidgest" project under qtRoot/qtExamples/CustomWidgets"
http://root.bnl.gov/QtRoot/root/qtExamples/CustomWidgets/README
The examlpe was done with the Qt designer without any hard-written code
Please update your local version |
_________________ Matthieu Guillo
EDF Clamart |
|
| Back to top |
|
 |
fine

Joined: 03 Sep 2003 Posts: 771 Location: BNL, Upton, USA
|
Posted: Tue Dec 13, 2005 2:07 Post subject: Re: Qt Extensions custom widgets |
|
|
I have added one extra class TQtCustomizeCanvasMenu and one extra example CustomCanvasMenu to show how to use it
To customize the standard ROOT ContextMenu with some Qt menu one has to add 2 lines of the code.
| Code: |
Usage:
1. Instantiate and attach the event filter to the TCanvas or TQtWidget object:
TQtCustomizeCanvasMenu *eventFilter =
TQtCustomizeCanvas::installCustomMenu(tQtWidget1);
where tQtWidget1 is a TQtWidget pointer
2. Connect the AboutToShow signal of the
TQtCustomizeCanvasMenu object with your
Qt Slot
connect( eventFilter,SIGNAL(AboutToShow(QPopupMenu *,TContextMenu *))
, myMainSteeringObject,SLOT(CustomizeIt(QPopupMenu *,TContextMenu *)));
3. Provide the method to change the "standard" ROOT Context menu:
void CustomizeIt(QPopupMenu *contextMenu,TContextMenu *rootContyextMenu)
{
// Second parameter is optional and may be disregarded.
// One can use it to garther an extra information about the context
contextMenu->insertSeparator();
QPopupMenu *customMenu = new QPopupMenu();
contextMenu->insertItem("&AtlasDAQ",propertiesMenu);
propertiesMenu->insertItem("Menu Custom item");
}
|
_________________ ---
Hope this helps
Valeri Fine |
|
| Back to top |
|
 |
fine

Joined: 03 Sep 2003 Posts: 771 Location: BNL, Upton, USA
|
Posted: Mon Jul 10, 2006 20:43 Post subject: Re: Qt Extensions custom widgets |
|
|
| matthieuguillo wrote: | But in the "Qt extension" made by BNL, there are other objects I am very interested too, for instance "TQtColorSelectButton". But there is no ".cw" associated file to allow to have an easy manipulation in "designer". How can I create such files?
Of course I could use the libraries directly but positionning widgets is much easier with designer.
| I have updated the Qt extension library and included the 3 new "Custom widgets":
| Code: | // "new" classes:
TQtFontComboBox.cw
TQtLineStyleComboBox.cw
TQtLineWidthComboBox.cw
// "old" classes:
TQtColorSelectButton.cw
TQtFloatSpinBox.cw
TQtPatternSelectButton.cw
TQtWidget.cw |
See the collage: http://root.bnl.gov/QtRoot/pictures/QtROOTCustomWidgets.png
The "CustomWidgets" project (see: qtRoot/qtExamples/CustomWidgets"
http://root.bnl.gov/QtRoot/root/qtExamples/CustomWidgets/README )
includes the simple example using 6 custom widgets. The example code is 100% automatically generated by Qt designer
without any hard-written code.
No C++ programming is involved. It should work with any not too old ROOT version on Unix , Windows, Mac (with and with no X11)
It shows how one can use the "embedded" offscreen TPad to decorate any Qt GUI component with the "real" ROOT graphics.
Please update your local version
_________________ ---
Hope this helps
Valeri Fine |
|
| Back to top |
|
 |
|