×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Exclamation Problem While Running This code

    hi
    I have problem while running this problem.....
    #include<QApplication>
    #include<QHBoxLayout>
    #include<QSlider>
    #include<QSpinBox>
    int main(int argc,char *argv[])
    {
    QApplication app(argc,argv);
    QWidget *window=new QWidget;
    window->setWindowTitle("Enter Your Age");
    QSpinBox *spinBox=new QSpinBox;
    QSlider *slider=new QSlider(QT::Horizantal);
    spinBox->setRange(0,135);
    slider->setRange(0,130);
    QObject::connect(spinBox,SIGNAL(valueChanged(int),slider,SLOT(setvalue(int)));
    QObject::connect(slider,SIGNAL(valueChanged(int),spinBox,SLOT(setvalue(int)));
    spinBox->setValue(35);
    QHBoxLayout *layout=new QHBoxLayout;
    layout->addWidget(spinBox);
    layout->addWidget(slider);
    window->setLayout(layout);
    window->show();
    return app.exec();
    }
    layout.exe is unable to build an i am unable to run this problem in emulator....
    plz let me know if their is any kind of error in this programe
    Last edited by mind_freak; 2009-02-21 at 04:06.

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Problem While Running This Problem

    Hi,

    It would probably help us to help you if tell us what error you get in the build?

    Mark

  3. #3
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Re: Problem While Running This Problem

    Quote Originally Posted by Sorcery-ltd View Post
    Hi,

    It would probably help us to help you if tell us what error you get in the build?

    Mark
    No error is Their but The emulator is unable to run this program....
    When i click the ".exe" for this program no action is being taken place in the emulator

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Problem While Running This Problem

    Hi,

    Can you explain what you meant by:
    layout.exe is unable to build
    Have you tried using the debugger to see if the application starts and reaches a breakpoint at the first line?

    Mark

  5. #5
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: Problem While Running This Problem

    Hi mind_Freak,
    I think there is nothing wrong with your Qt installation but only a few syntax error is there. I had corrected that,just replace the few lines given below.

    Code:
    QSpinBox *spinBox=new QSpinBox;
    QSlider *slider=new QSlider(Qt::Horizontal);
    spinBox->setRange(0,135);
    slider->setRange(0,130);
    QObject::connect(spinBox,SIGNAL(valueChanged(int)),slider,SLOT(setvalue(int)));
    QObject::connect(slider,SIGNAL(valueChanged(int)),spinBox,SLOT(setvalue(int)));
    spinBox->setValue(35);
    Please let us know that this works for you or some errors are there...?

    Hope this helps you.
    Jajal Mehul

  6. #6
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Re: Problem While Running This Problem

    Hi sir,
    Thanks the code is now executing properly.....

    Regards
    Viral Parmar

  7. #7
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Problem While Running This Problem

    Hi,

    Indeed, there were syntax errors in your code with incorrect bracketing - this WILL have caused the build to fail. The icon in the emulator would have been from a previous version that did build and it didn't launch because it hadn't been successfully rebuilt. You need to read the console output from the builds to be sure the build is successful and find errors, otherwise this will happen again.

    Hope that explains it.

    Mark

  8. #8
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Unhappy Re: Event Handling Problem

    After pressing the "Press Me" button the "hello" button should get disable,but its not working...
    Plz get me to a proper way and let me know the errors...
    #include <QtGui>
    #include <QApplication>
    #include<QPushButton>
    #include<QHBoxLayout>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    QWidget *window = new QWidget();
    QPushButton* but1=new QPushButton("Press Me");
    QPushButton* but2=new QPushButton("Hello");
    QHBoxLayout* layout=new QHBoxLayout;

    layout->addWidget(but1);
    layout->addWidget(but2);

    window->setLayout(layout);
    window->show();
    QObject::connect(but1,SIGNAL(clicked()),but2,SLOT(setEnable(false)));
    return a.exec();
    }
    Regards
    Viral
    Last edited by mind_freak; 2009-02-22 at 06:33.

  9. #9
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: Problem While Running This Problem

    Hi Mind_Freak,
    please replace the following line in your code
    Code:
    QOBJECT::connect(but1,signal(clicked()),but2,slot(setDisabled(1)));
    Hope it helps you.
    Jajal Mehul

  10. #10
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: Problem While Running This Problem

    Hi mind freak

    It would be better to start the new question with new thread.

    Regards
    Jajal Mehul

Similar Threads

  1. Urgent :problem while running HTTPS in J2me for Nokia 3250
    By ratan_java_me in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2007-05-02, 17:45
  2. Replies: 0
    Last Post: 2007-02-26, 01:05
  3. Replies: 2
    Last Post: 2006-02-24, 14:23
  4. Problem running sip RegisterTest example, HELP!
    By wbb826 in forum Mobile Java General
    Replies: 1
    Last Post: 2005-10-19, 07:25
  5. Problem running the TextMTM sample
    By dingdongvan in forum General Messaging
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×