Results 1 to 2 of 2

Thread: how to use SearchScanDiskDlgObj

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

    Question how to use SearchScanDiskDlgObj

    hi all
    i had create mainwindow ..in tht i ve tree widget...withselection of any item one another form opened ...how it should come??
    next is:when another form opened on tht particular form i ve lineedit n ok button..wid click of ok button again mainwindow form should be opened....n form's line edit text should be shown in mainwindow's second tree widget's item...how these two problems can be solved...????

    plz do help me as soon as possible...
    thanks & regards
    --------------------
    jyoti

  2. #2
    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: how to use SearchScanDiskDlgObj

    Read this: http://www.qtcentre.org/forum/f-newb...form-4471.html

    If you use a modal dialog, you can retrieve the data using normal methods that just return contents of some widget from that dialog:
    Qt Code:
    1. void SomeWindow::showDialog()
    2. {
    3. SomeDialog dlg( this );
    4. if( dlg.exec() == QDialog::Accepted ) {
    5. something = dlg.something();
    6. someOtherThing = dlg.someOtherThing();
    7. }
    8. else {
    9. // user has rejected the dialog
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

    But if you want modeless dialogs, you have to use signals and slots mechanism (at least to notify the other window that it can read the data). Something like this connected with:
    Qt Code:
    1. void EditorWindow::findNext()
    2. {
    3. QString keyword = findDialog->keyword();
    4. // do something with keyword
    5. }
    To copy to clipboard, switch view to plain text mode 
    Of course you can also use signals to pass the data. This way you could have something like this:
    Qt Code:
    1. void EditorWindow::findNext( const QString& keyword )
    2. {
    3. // do something with keyword
    4. }
    To copy to clipboard, switch view to plain text mode 

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
  •  
Qt is a trademark of The Qt Company.