Results 1 to 10 of 10

Thread: designing in qt3

  1. #1
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default designing in qt3

    1. i am using qt version 3 for making gui
    everything works fine till the time i donot use kde supported widgets like
    kcomborequester or kimageveiwer
    if i include anything of the k widgets the code doesnot make
    though it qmakes
    there are very good functionalities of kde supported widgets which i want to include
    how to do it
    even after including the header files it doesnot work

    2. secondly how to incoporate the source codes of other aplications.
    i mean when u make a main dialog form , u get automatic form class and
    and object assoictaed with it
    if i want to use other classes how to do it
    multi inheritance is perhaps not supported
    please guide me .

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: designing in qt3

    Quote Originally Posted by deekayt
    1. i am using qt version 3 for making gui
    everything works fine till the time i donot use kde supported widgets like
    kcomborequester or kimageveiwer
    if i include anything of the k widgets the code doesnot make
    though it qmakes
    there are very good functionalities of kde supported widgets which i want to include
    how to do it
    even after including the header files it doesnot work
    Some KDE widgets require KApplication instance instead of QApplication and you need to link with "kdeui" library to be able to use those kde-provided widgets.


    2. secondly how to incoporate the source codes of other aplications.
    i mean when u make a main dialog form , u get automatic form class and
    and object assoictaed with it
    if i want to use other classes how to do it
    multi inheritance is perhaps not supported
    please guide me .
    you can use multiple inheritance as long as you don't inherit from two QObject descendants. Besides that, any C++ technique is allowed and works exactly like in plain old C++. After all, Qt is only a library which provides new functionality -- it doesn't introduce any limitations on C++ functionality.

  3. #3
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: designing in qt3

    dear freind

    i have tried your suggestion.
    I will give some more details of the program which I have.
    I have made a GUI in QT 3.3.4 ( on Suse10) . I have utilized the Main Dialog.
    All the objects are created from FORM class (which iself is derived from QMainWindow as class Form : public QMainWindow)
    Now my requirement is to be able to show an image / any ( not only text) file when i click on a button in this form or when a image /text file is selected from a file menu and copied to a textedit widget.
    I have tried using system commands like system ( " gedit filename " or " "image veiwer filename")
    but this blocks the application and one has to close the gedit window to do anything on the form.
    Moreover the filename is static in this scenario. So i tried script file by inputing the name of the file and running the script( which also had the system command giving the same problem)
    hence i have to use some class to show these files.
    how to go about it.
    i have tried one similar FAQ as
    -------------------------------------------------------------------------
    Assuming you have two form classes: Form1 and Form2 and that Form1 has a pushbutton "button" child and Form2 is derived from QDialog.
    Add a custom slot to Form1 and fill it with:
    Qt Code:
    1. void Form1::openForm2(){
    2. static Form2 *form2 = new Form2(this);
    3. form2->show();
    4. form2->activateWindow(); // or form2->setActiveWindow() in Qt3
    5. form2->raise();
    6. }
    To copy to clipboard, switch view to plain text mode 
    If you want Form2 to be modal change it to:
    Qt Code:
    1. void Form1::openForm2(){
    2. Form2 form(this);
    3. form2.exec();
    4. }
    To copy to clipboard, switch view to plain text mode 
    Then you have to connect a proper signal to this slot. In the constructor of Form1 add:
    connect(button, SIGNAL(clicked()), this, SLOT(openForm2()));
    ---------------------------------------------------------------------------------

    but it didnot work out.
    i looked for the "kdeui" lib and found
    kdeui.so size : 63864 bytes
    kdeui.tag size : 1,086,440 bytes
    kdeuimod.sip size : 3912 bytes

    which one do i include and how
    please guide me.
    Last edited by wysota; 1st June 2006 at 17:56. Reason: Inserted [code] tags in this and following posts.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: designing in qt3

    I don't see how is your issue related to kde custom widgets... All you need to run an external application is QProcess, you don't need any kde related stuff.

    But anyway, if you want to use kdeui, you just have to link with it, for example by adding LIBS+=-lkdeui to your .pro file (remember to run qmake afterwards).

  5. #5
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: designing in qt3

    you are correct
    in veiw of the Qprocess my problem has got very less to do with Kwidgets.

    In order to call Qprocess. fn() i will have to do something like this in .ui.h
    Qt Code:
    1. void FORM2::openfile()
    2. {
    3. pushbutton->----- / here will the function of Qprocess work
    4. }
    To copy to clipboard, switch view to plain text mode 

    and i shall be connecting the pushbutton to the slot openfile()

    how do i ensure that form2 class takes functions from Qprocess also.
    Last edited by wysota; 1st June 2006 at 17:55.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: designing in qt3

    Just create a QProcess object either as a member of the class or in the slot which makes use of it (be sure it is allocated on heap in the latter case, so that it doesn't go out of scope).

  7. #7
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: designing in qt3

    i have now done the following

    Qt Code:
    1. #include <qprocess.h>
    2. void Form2 :: showimage()
    3. {
    4. QProcess* proc = new QProcess( this );
    5. proc->addArgument( "eog " );
    6. proc->addArgument("/root/images/dk.jpg");
    7. proc->start();
    8. }
    To copy to clipboard, switch view to plain text mode 

    // where showimage is a slot connected by pushbutton
    i am able to qmake and make also
    but when i run
    i get the following message
    ---------------------------------------------------------------------------
    linux:~/prac # ./prac
    name = latin
    name = ipa-x-sampa
    name = viqr
    name = hangul2
    name = hangul3
    name = romaja
    name = tutcode
    name = tcode
    name = skk
    name = canna
    name = anthy
    name = py
    name = pyunihan
    name = pinyin-big5
    name = direct
    WARNING: please edit ~/.scim/global and change /DefaultConfigModule to kconfig
    ---------------------------------------------------------------------------
    i am not able to find ~/.scim/global in the directories even after an extensive search .
    please guide me .
    Last edited by wysota; 1st June 2006 at 17:55.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: designing in qt3

    But what does it have to do with Qt? The error comes from the external app you start with QProcess...

  9. #9
    Join Date
    May 2006
    Posts
    68
    Thanks
    10
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: designing in qt3

    but sir
    my problem is not still sorted out
    infact on he command line "eog filename" works fine
    even system ("eog filename" ) works
    then why not qprocess
    please guide me
    thanks in advance
    Last edited by deekayt; 1st June 2006 at 17:51.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: designing in qt3

    I'm sorry, I don't know this "eog" app, so I won't be able to help you. In general it looks like there is something wrong with your kde installation (or scim). Do you get the same message while running "eog" from the command line?

    Anyway you might try what the message suggests -- create ~/.scim/global and set /DefaultConfigModule to kconfig. If you have any doubts here, google is your friend.

    BTW. Next time please use the "[code]" tags to format the source code you enter here. The tag is available under the "#" button in the editor toolbar.

Similar Threads

  1. Designing a new core application
    By bothapn in forum Qt Programming
    Replies: 7
    Last Post: 19th March 2006, 12:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.