Results 1 to 7 of 7

Thread: problem of how to get drive

  1. #1
    Join Date
    Nov 2006
    Location
    gurgaon
    Posts
    49
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X

    Question problem of how to get drive

    hi all
    i had made a function having name ReadDisk(/some arguments/)(already having code)
    which read the sectors of hard disk
    now i wanna use this function in another fuction rdrive() in qt4.2
    and as i press the read drive button from form then rdrive()
    function read whole drive in hard disk

    so plz do tell me as soon as posible that how in qt one function can use the another function


    i mean like
    int ReadDrive(/some args/)
    {
    //some statements
    }

    void MainWindow :: rdrive()
    {
    //wht should be coded that i can use ReadDrive??
    }
    thanks & regards
    --------------------
    jyoti

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: problem of how to get drive

    Do you notice something in common in the following posts?
    Quote Originally Posted by jpn View Post
    Btw, how is this related to Qt Designer?
    Quote Originally Posted by jacek View Post
    PS. This has nothing to do with Qt Designer. Thread moved.
    Quote Originally Posted by jpn View Post
    PS. once again this has nothing to do with Qt Designer which is a tool for designing and building graphical user interfaces.
    Quote Originally Posted by wysota View Post
    And what does it have to do with Qt Designer?
    Quote Originally Posted by jacek View Post
    Please, don't ask questions that have nothing to do with Qt Designer in Qt Designer section and search the docs before you ask a question.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem of how to get drive

    With all due respect

    It has got nothing to do with Qt ? The question is how to call function within another ?
    Please go through this link http://newdata.box.sk/bx/c/htm/ch05.htm

    Incase the function is in a .c file; then you have to declare it as extern " C " somewhat like this
    OriginalHeader.h
    Qt Code:
    1. void readDrive( /*blah blah*/ );
    To copy to clipboard, switch view to plain text mode 
    then change it to
    ChangedHeader.h ( note: need not chage the header name )
    Qt Code:
    1. #ifdef __cplusplus
    2. extern "C" {
    3. #endif
    4.  
    5. void readDrive( /*blah blah*/ );
    6.  
    7. #ifdef __cplusplus
    8. };
    9. #endif
    To copy to clipboard, switch view to plain text mode 
    Rest of the code will remain the same
    We can't solve problems by using the same kind of thinking we used when we created them

  4. #4
    Join Date
    Nov 2006
    Location
    gurgaon
    Posts
    49
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: problem of how to get drive

    to mr. jpn Expert
    i simply askd the question related with designer
    tell me one thing pushbutton (created in designer) is not used or property of designer...so what i put wrong on wrong place...y didnot its related to QT designer ...n i had read the docs bt it is not the complete solution so asking by forum...
    thanks & regards
    --------------------
    jyoti

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem of how to get drive

    Just invoke that function from rdrive():
    Qt Code:
    1. void MainWindow::rdrive()
    2. {
    3. // ...
    4. int something = readDrive( ... );
    5. // use something
    6. }
    To copy to clipboard, switch view to plain text mode 
    If it isn't what you were asking for, please, clarify your question.

  6. #6
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem of how to get drive

    Quote Originally Posted by jyoti View Post
    tell me one thing pushbutton (created in designer) is not used or property of designer...so what i put wrong on wrong place...y didnot its related to QT designer
    In that case every thread in this forum should appear in Designer section, after all does it make any difference if you use designer or hand code it. Designer section is for those questions related to designer ( pretty clear huh ). Suppose you are facing difficulty using designer. or may be setting layout in designer or Being not able to find something in designer.
    You can go through those valid posts in the designer section and see how it relates

    Quote Originally Posted by jyoti View Post
    ...n i had read the docs
    Great !!

    Quote Originally Posted by jyoti View Post
    bt it is not the complete solution so asking by forum...
    what is not complete ? The doc is not intended to teach you C++
    We can't solve problems by using the same kind of thinking we used when we created them

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

    Default Re: problem of how to get drive

    Peace guys! Peace among Christians (and all others as well)!

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 13:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 13:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 15:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 22:36
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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.