Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Need assistance from QT programmer

    Reply
    Page 3 of 18 | Prev |   1     2   3   4     5   13 | Next | Last
    Venemo | # 21 | 2010-07-16, 10:31 | Report

    Originally Posted by D-Iivil View Post
    For me it does not seem to create the connect() when right-clicking the button in UI and choosing -> Go to slot...
    Yes.
    It is auto-generated by the ui file and initalized with that.
    (Eg. it doesn't pollute your own code, but it will be taken care of in the background.)

    You can open the .ui file with an XML editor and see how it deals with the stuff.
    Note that Qt will generate real C++ code from the .ui, and compile it along with the rest of the app.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Venemo | # 22 | 2010-07-16, 10:35 | Report

    Originally Posted by Diph View Post
    If you just want to get text from drop down menu when button is clicked (put this in hello() slot):
    Code:
    ui->myComboBox->currentText(); //This property holds the text of the current item.
    Indeed, this is the best way to read the current text from a combo box!

    http://doc.qt.nokia.com/4.6/qcombobo...rrentText-prop

    Edit | Forward | Quote | Quick Reply | Thanks

     
    d-iivil | # 23 | 2010-07-16, 10:36 | Report

    Originally Posted by Venemo View Post
    Yes.
    It is auto-generated by the ui file and initalized with that.
    (Eg. it doesn't pollute your own code, but it will be taken care of in the background.)

    You can open the .ui file with an XML editor and see how it deals with the stuff.
    Note that Qt will generate real C++ code from the .ui, and compile it along with the rest of the app.
    Well, the apply-button stopped working after trying to let the designer take care of it all.
    Edit: re-did it and it's working again (I mean the let the designer take care of connecting)

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by d-iivil; 2010-07-16 at 10:39.
    The Following User Says Thank You to d-iivil For This Useful Post:
    Venemo

     
    d-iivil | # 24 | 2010-07-16, 10:45 | Report

    Originally Posted by Diph View Post
    If you just want to get text from drop down menu when button is clicked (put this in hello() slot):
    Code:
    ui->myComboBox->currentText(); //This property holds the text of the current item.
    Or if you want to do something when user changes selection in drop down menu (put this in constructor and create new slot):
    Code:
    connect(ui->myComboBox, SIGNAL(currentIndexChanged(QString),
    this,
    SLOT(comboBoxCurrentIndexChanged(QString));
    Code:
    void MainWindow::comboBoxCurrentIndexChanged(const QString &text) {
       //Do something
    }
    E: Bit late.
    Hmm... m'kay... still cannot figure out how to use this.

    I mean with php I would do it like this:
    $variable1 = $_GET[drop_down_transitions]
    $variable2 = $_GET[drop_down_font]
    $variable3 = $_GET[drop_down_color]

    And then just include it like this:
    Code:
        QStringList arguments;
        arguments << "$variable1" << "$variable2" << "$variable3";
        QProcess::execute("/sbin/myscript", arguments);
    Thanks for you guys for the help. I know it's frustrading to teach someone who has no_idea_at_all what's happening

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Diph | # 25 | 2010-07-16, 10:49 | Report

    Something like this:
    Code:
    QStringList arguments;
    arguments << ui->dropDownTransition->currentText() << ui->dropDownFont->currentText() << ui->dropDownColor->currentText();
    QProcess::execute("/sbin/myscript", arguments);
    E: It's a good practise to check if variables are empty:
    Code:
    QString transition = ui->dropDownTransition->currentText();
    //Not empty
    if (!transition.isEmpty()) {
       //Do something
    }

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by Diph; 2010-07-16 at 10:56.
    The Following User Says Thank You to Diph For This Useful Post:
    d-iivil

     
    d-iivil | # 26 | 2010-07-16, 11:05 | Report

    Originally Posted by Diph View Post
    Something like this:
    Code:
    QStringList arguments;
    arguments << ui->dropDownTransition->currentText() << ui->dropDownFont->currentText() << ui->dropDownColor->currentText();
    QProcess::execute("/sbin/myscript", arguments);
    E: It's a good practise to check if variables are empty:
    Code:
    QString transition = ui->dropDownTransition->currentText();
    //Not empty
    if (!transition.isEmpty()) {
       //Do something
    }
    Just a minute before you replied I figured it out by reading your previous post few times over and over

    So it's working now!

    Next step: how to build / compile a binary out of this or how to include the source with my excisting package and make autobuilder to build / compile it?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Diph | # 27 | 2010-07-16, 11:09 | Report

    You can try the binary in the phone by following instructions from NokiaQtSDK_PATH/readme/index.html.

    To create source package for autobuilder you need scratchbox.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    d-iivil | # 28 | 2010-07-16, 11:25 | Report

    Originally Posted by Diph View Post
    You can try the binary in the phone by following instructions from NokiaQtSDK_PATH/readme/index.html.

    To create source package for autobuilder you need scratchbox.
    Okay, will read it. I have scratchbox already for making sources of my themes.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Diph | # 29 | 2010-07-16, 11:32 | Report

    Originally Posted by D-Iivil View Post
    Okay, will read it. I have scratchbox already for making sources of my themes.
    http://wiki.maemo.org/Packaging_a_Qt_application

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Venemo | # 30 | 2010-07-16, 11:40 | Report

    Originally Posted by D-Iivil View Post
    Hmm... m'kay... still cannot figure out how to use this.

    I mean with php I would do it like this:
    $variable1 = $_GET[drop_down_transitions]
    $variable2 = $_GET[drop_down_font]
    $variable3 = $_GET[drop_down_color]

    And then just include it like this:
    Code:
        QStringList arguments;
        arguments << "$variable1" << "$variable2" << "$variable3";
        QProcess::execute("/sbin/myscript", arguments);
    Code:
    QString variable1("string1");
    QString variable2("string2");
    QString variable3("string3");
    
    QStringList myStringList;
    myStringList.append(variable1);
    myStringList.append(variable2);
    myStringList.append(variable3);
    Originally Posted by D-Iivil View Post
    Next step: how to build / compile a binary out of this or how to include the source with my excisting package and make autobuilder to build / compile it?
    If you already tested it using Qt Creator, here is how to make an installable package:

    Originally Posted by Venemo View Post
    If you want to make a .deb package, you can use Qt Creator's option to do so (but it is quite limited at the moment), or use MADDE and type "mad dpkg-buildpackage" into the command line (in your app's root folder)
    If you would like to upload it to Extras-devel, here is a good description:
    http://wiki.maemo.org/Uploading_to_Extras

    I prefer to use the Assistant, it works like a charm.
    https://garage.maemo.org/extras-assistant/index.php

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 3 of 18 | Prev |   1     2   3   4     5   13 | Next | Last
vBulletin® Version 3.8.8
Normal Logout