Results 1 to 20 of 47

Thread: kdialog and klocate problems

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #21
    Join Date
    Apr 2007
    Location
    Valencia, Spain
    Posts
    30
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: kdialog and klocate problems

    Ok, I know that what i put here yesterday doesn't have any sense. After reading the QProcess, I can see that I did wrong from the beginning, isn't It?
    I created the .ui file using QTDesigner and then, using uic command I created the header and the .cpp files from that .ui file.
    After that I created the main.cpp and It worked perfectly but I started to have problems when I tried that the buttons of the GUI do something.
    So I don't have to do my project like I did? I dont have to create the .cpp and .h files?
    I'm completely lost I really need your help.....

    I'm doing other things. Now I'm creating the new QPocess object into the BTScanning function like this:

    BTScanning::BTScanning( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
    {
    QProcess *process = new QProcess(this);

    then I creat the textEdit:
    te_results = new QTextEdit( this, "te_results" );
    te_results->setGeometry( QRect( 250, 180, 341, 281 ) );

    the button:
    pb_save = new QPushButton( Menu, "pb_save" );
    pb_save->setGeometry( QRect( 40, 100, 112, 24 ) );

    and I connect the button with the slot:
    connect( pb_scan, SIGNAL( clicked() ), this, SLOT( scan() ) );

    and scan() function is like this:
    void BTScanning::scan()
    {
    QByteArray exit;
    process->addArgument("hcitool scan");
    exit = process->readStdout();
    te_results->insertParagraph(QString(exit),-1);
    }

    and it appears the error:
    btscanning.cpp: In constructor ‘BTScanning::BTScanning(QWidget*, const char*, uint)’:
    btscanning.cpp:35: warning: unused variable ‘process’
    btscanning.cpp: In member function ‘virtual void BTScanning::scan()’:
    btscanning.cpp:97: error: ‘process’ was not declared in this scope

    the problem is that if I solve It, If I put the lines:
    QByteArray exit;
    process->addArgument("hcitool scan");
    exit = process->readStdout();
    out of the scan() function, into the BTScanning function, and let the scan() function like this:
    void BTScanning::scan()
    {
    te_results->insertParagraph(QString(exit),-1);
    }
    it appears this error:
    btscanning.cpp:100: error: no matching function for call to ‘QString::QString(<unresolved overloaded function type>)’
    /usr/include/qt3/qstring.h:746: note: candidates are: QString::QString(QStringData*, bool)
    /usr/include/qt3/qstring.h:720: note: QString::QString(int, bool)
    /usr/include/qt3/qstring.h:409: note: QString::QString(const std::string&)
    /usr/include/qt3/qstring.h:406: note: QString::QString(const char*)
    /usr/include/qt3/qstring.h:404: note: QString::QString(const QChar*, uint)
    /usr/include/qt3/qstring.h:403: note: QString::QString(const QByteArray&)
    /usr/include/qt3/qstring.h:402: note: QString::QString(const QString&)
    /usr/include/qt3/qstring.h:401: note: QString::QString(QChar)
    /usr/include/qt3/qstring.h:838: note: QString::QString()

    but if I do this:
    te_results->insertParagraph(QString("exit"),-1);
    every time I press the button it appears in the textEdit area the word "exit".

    I think that I'm not making any difference between all buttons of the menu.
    How I have to do this difference? Each button has to do a different action, but If I create the object process into the BTScanning function I'm not doing this difference....
    Last edited by parsito; 9th May 2007 at 15:52. Reason: updated contents

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.