RE: TGFileContainer MultipleSelections

From: Lee, Kerry T. \(JSC-SF\)[UHCL] <kerry.t.lee_at_nasa.gov>
Date: Wed, 29 Mar 2006 11:31:37 -0600


Hi Valeri,

Thanks for your help. I installed Qt 3.3.4 and I did not encounter any problems. I'll let you know how the database accessing goes.

Thanks
Kerry

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch on behalf of Fine, Valeri Sent: Tue 3/28/2006 8:14 PM
To: Lee, Kerry T. (JSC-SF)[UHCL]; Ilka Antcheva; roottalk_at_pcroot.cern.ch Cc: qt-root-l_at_lists.cern.ch
Subject: RE: [ROOT] TGFileContainer MultipleSelections  

Ummm.
Hello Kerry, I am sorry :((
CERN doesn't work with Qt 4. yet! The example, I gave you and all my tests are for Qt 3.3 API too. See:
http://lists.bnl.gov/pipermail/qt-root-l/2005-December/000012.html

Watch "3.3" within URL I had submitted
http://doc.trolltech.com/3.3/qfiledialog.html#getOpenFileNames

  Qt 3.x and Qt 4.x are two different non-compatible packages.   Did you compile Qt/Root yourself against of Qt 4.1.1?

(Even though the last version of Qt 3.3 is 3.3.6 you are advised to set up the version 3.3.4 see: discussion
http://lists.bnl.gov/pipermail/qt-root-l/2006-March/thread.html#31 on issue.

Look up the Qt 4.1 doc too:
http://doc.trolltech.com/4.1/qfiledialog.html

You see the header file for Qt 4 is

    #include <QFileDialog>
rather

    #include <qfiledialog.h>
for Qt 3.3

See Qt4 for the further documentation:
http://doc.trolltech.com/4.1/qfiledialog.html#getOpenFileNames

You may try to reshape my example for Qt4, but I can not guaranty any support for TWO different Qt packages. As soon as CERN (or BNL) decides to go to Qt4 I am willing to give up the Qt3 and support Qt4 instead. In fact personally I would like to do that as soon possible. Alas the Qt3 to Qt4 CERN transition is out of my control.

Sorry for such inconvenience.

The bottom line: Use Qt 3.3 for the time being. If you really need Qt4 (for the sake of the special SQL driver) let me know :)


Best Regards

                         Valeri Fine


Brookhaven National Laboratory
Upton, NY 11973, USA
Phone: +1 631 344 7806
Fax: +1 631 344 4206
E-mail: fine_at_bnl.gov
-----Original Message-----
From: Lee, Kerry T. (JSC-SF)[UHCL] [mailto:kerry.t.lee_at_nasa.gov] Sent: Tuesday, March 28, 2006 7:24 PM
To: Fine, Valeri; Ilka Antcheva; roottalk_at_pcroot.cern.ch Subject: RE: [ROOT] TGFileContainer MultipleSelections

Hi Valeri,

Thank you for your detailed outline and example macro. I installed the newest version of Qt (4.1.1) and successfully compiled the HelloWorld example from the manual. I then followed your procedure. I had a warning when starting root which was

I created a file ~/.fonts.conf and added a single line of $ROOOTSYS/fonts, but this did not solve the problem. If this is only related to fonts it is unimportant to me at the moment.

I was not able to run your example macro in cint, but when I invoked aclic everything worked as expected.

root [0] gSystem->AddIncludePath("-I$QTDIR/include") root [1] .x FileDialog.C
Error: Function getOpenFileNames() is not defined in current scope FileDialog.C:10: Possible candidates are...
filename line:size busy function type and name Warning: Automatic variable QStringList files is allocated FileDialog.C:10:Error: Undeclared variable QStringList files FileDialog.C:10: *** Interpreter error recovered ***
root [2] .x FileDialog.C++
Info in <TUnixSystem::ACLiC>: creating shared library /media/usbdisk/kerrylee/marie/code/GUI/./FileDialog_C.so

For now I am only working with compiled code, therefore, this will work for me now. Maybe because I did not use Qt version 3.3 is why the interpreted code is not functioning. At any rate the current solution will work for me.

Thanks again,

Kerry

-----Original Message-----
From: Fine, Valeri [mailto:fine_at_bnl.gov] Sent: Sun 3/26/2006 12:27 PM
To: Fine, Valeri; Ilka Antcheva; Lee, Kerry T. (JSC-SF)[UHCL]; roottalk_at_pcroot.cern.ch Subject: RE: [ROOT] TGFileContainer MultipleSelections

 Hello
 I am sorry, I missed to add the relevant ROOT macro.

 Assuming you have the standard ROOT installation with Qt  (for example at CERN)

  1. setup ROOT and QT environment. For example, at CERN "lxplus" you can execute the script

http://root.bnl.gov/QtRoot/expert/26.03.2006/setup_root_cern_5.10.b.csh <http://root.bnl.gov/QtRoot/expert/26.03.2006/setup_root_cern_5.10.b.csh >

2. Make a local copy ."rootrc" file to turn on the Qt-layer

    http://root.bnl.gov/QtRoot/expert/26.03.2006/.rootrc <http://root.bnl.gov/QtRoot/expert/26.03.2006/.rootrc>

3. Copy the C++ ROOT macro

    http://root.bnl.gov/QtRoot/expert/26.03.2006/FileDialog.C <http://root.bnl.gov/QtRoot/expert/26.03.2006/FileDialog.C>

ifndef __CINT__

#  include <qfiledialog.h>
#  include <qstringlist.h>
#  include <qstring.h>
#endif

void FileDialog() {

// gSystem->AddIncludePath("-I$QTDIR/include"); // See: http://doc.trolltech.com/3.3/qfiledialog.html#getOpenFileNames <http://doc.trolltech.com/3.3/qfiledialog.html#getOpenFileNames>   QStringList files = QFileDialog::getOpenFileNames ();  

  QStringList::Iterator it = files.begin();   while ( it != files.end() ) {

      printf ("Next file selected: %s\n", (const char *)(*it));
      ++it;

  }
}

4. Start ROOT session and execute 2 ROOT command    

root [0] gSystem->AddIncludePath("-I$QTDIR/include"); root [1] .x FileDialog.C++

5. You should get the Qt widget

   http://root.bnl.gov/QtRoot/expert/26.03.2006/FileDialog.png <http://root.bnl.gov/QtRoot/expert/26.03.2006/FileDialog.png>

6. You should see the the of the selected file names

http://root.bnl.gov/QtRoot/expert/26.03.2006/FileDialogLxplus.log.png <http://root.bnl.gov/QtRoot/expert/26.03.2006/FileDialogLxplus.log.png>

If you don't this maynave ment there is some bug to be fixed. Please file the ROOT bug report.

Either way your kind feedback would be appreciated a lot.

 Thank you, Hope this helps

I


From: Fine, Valeri
Sent: Sat 3/25/2006 12:21 PM
To: Ilka Antcheva; Lee, Kerry T. (JSC-SF)[UHCL]; roottalk_at_pcroot.cern.ch Subject: RE: [ROOT] TGFileContainer MultipleSelections

My I remind people that there is the back door called Qt-layer

If you need "multiple selections" now you can use Qt class http://doc.trolltech.com/3.3/qfiledialog.html <x-excid://3E8A0000/uri:http://doc.trolltech.com/3.3/qfiledialog.html>
(you should turn on the Qt layer using ".rootrc". resource file see
ftp://root.cern.ch/root/doc/chapter26.pdf <x-excid://3E8A0000/uri:ftp://root.cern.ch/root/doc/chapter26.pdf> page 393)
As soon as ROOT TG provides the function you are seeking you may have replaced it back with the "TG" counterpart.

Hope this helps Valeri


From: Ilka Antcheva
Sent: Sat 3/25/2006 4:17 AM
To: Lee, Kerry T. (JSC-SF)[UHCL]; roottalk_at_pcroot.cern.ch Subject: RE: [ROOT] TGFileContainer MultipleSelections

Hi Kerry,

This feature is not available yet in TGFileConaines but will come soon because of internal needs to have it. We will keep you informed.

Cheers, Ilka


From: owner-roottalk_at_pcroot.cern.ch on behalf of Lee, Kerry T.
(JSC-SF)[UHCL]
Sent: Sat 3/25/2006 12:36 AM

To: roottalk_at_pcroot.cern.ch

Subject: [ROOT] TGFileContainer MultipleSelections

Dear Rooters,

How do I allow for multiple selections via a mouse click within a TGFileContainer?

Thanks

Kerry Received on Wed Mar 29 2006 - 19:33:38 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:58 MET