LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-30-2004, 02:35 AM   #1
Jorine
LQ Newbie
 
Registered: Nov 2004
Posts: 5

Rep: Reputation: 0
How to create new directory??


I am currently creating new folder using the QFileDialog without the use of the create new folder button. By typing in a string into the 'File Name:' input box.
then using system("mkdir " + result); to have a new directory created


if ( fd.exec() == QDialog::Accepted ) {
QString result = fd.getText(); ----------------------->> 'File Name:' input box
system("mkdir "+result);

(fd.getText() is wrong btw :\)
a new folder was suppose to appear but keep getting errors.
 
Old 11-30-2004, 02:50 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you're not going to actually tell us what the errors are? you didn't ewven tell us what language you're using, obvious as it may be. if you print the string your passing to system, it will probably be obvious.
 
Old 11-30-2004, 03:06 AM   #3
Jorine
LQ Newbie
 
Registered: Nov 2004
Posts: 5

Original Poster
Rep: Reputation: 0
need help..

I using Qt designer to create the QDialogbox and i using c++ for the coding.. Hmm, i not passing a string, I trying to create a new folder by entering a string which is the folder name..

The error i got was:
qdir.cpp: In function `int main(int, char**)':
qdir.cpp:349: no matching function for call to `QFileDialog::getText()'
 
Old 11-30-2004, 07:49 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
right, ok. so... fix that error. find what the real function name is. error messages are there for a reason you know....
 
Old 12-01-2004, 12:38 AM   #5
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Blog Entries: 4

Rep: Reputation: 138Reputation: 138
Compiler errors should be easy to fix. Just do a look-up on the function getText() function. QFileDialog class does *not* have a member function called getText().

From the QT Manual for QFileDialog:
Code:
    QString s = QFileDialog::getSaveFileName(
                    "/home",
                    "Images (*.png *.xpm *.jpg)",
                    this,
                    "save file dialog"
                    "Choose a filename to save under" );

Last edited by vharishankar; 12-01-2004 at 12:41 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
create a directory in C++ poeta_boy Programming 15 11-02-2011 01:53 PM
can't create new directory dummoi Linux - Newbie 4 06-24-2004 02:50 PM
Re-create /proc directory? calabash Red Hat 3 02-18-2004 12:35 AM
Can't create new directory!!?? catty Linux - Newbie 7 10-06-2003 05:33 PM
Create a directory SnowSurfAir Linux - Software 15 07-21-2003 06:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration