在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > Qt on Android:使用JNI與第三方j(luò)ar包

            Qt on Android:使用JNI與第三方j(luò)ar包

            作者: 時(shí)間:2016-09-12 來源:網(wǎng)絡(luò) 收藏

            QHBoxLayout *getLayout = new QHBoxLayout();

            layout->addLayout(getLayout);

            m_urlEdit = new QLineEdit(http://blog.csdn.net/foruok);

            getLayout->addWidget(m_urlEdit, 1);

            QPushButton *getButton = new QPushButton(GET);

            getLayout->addWidget(getButton);

            connect(getButton, SIGNAL(clicked()), this, SLOT(onGet()));

            m_resultView = new QTextEdit();

            m_resultView->setReadOnly(true);

            layout->addWidget(m_resultView, 1);

            m_stateLabel = new QLabel();

            layout->addWidget(m_stateLabel);

            }

            Widget::~Widget()

            {

            }

            bool Widget::event(QEvent *e)

            {

            if(e->type() == SimpleCustomEvent::eventType())

            {

            e->accept();

            SimpleCustomEvent *sce = (SimpleCustomEvent*)e;

            switch(sce->m_arg1)

            {

            case 1:

            m_resultView->setText(sce->m_arg2);

            m_stateLabel->setText(Success!);

            break;

            case 0:

            m_resultView->setText(sce->m_arg2);

            m_stateLabel->setText(Failed!);

            break;

            case -1:

            m_stateLabel->setText(sce->m_arg2);

            break;

            }

            return true;

            }

            return QWidget::event(e);

            }

            void Widget::onGet()

            {

            #ifdef WIN32

            m_resultView->setText(Sorry, Just for Android!);

            #elif defined(ANDROID)

            QString url = m_urlEdit->text();

            QAndroidJniObject javaAction = QAndroidJniObject::fromString(url);

            QAndroidJniObject::callStaticMethod(an/qt/useJar/ExtendsQtWithJava,

            downloadWebPage,

            (Ljava/lang/String;)V,

            javaAction.object());

            m_stateLabel->setText(Downloading...);

            #endif

            }

            調(diào)用Java的代碼在onGet()槽中,很簡單,不解釋了。有疑問看Qt幫助手冊(cè)有關(guān)QAndroidJniObject類的說明。

            OK,到此結(jié)束。


            上一頁 1 2 3 下一頁

            關(guān)鍵詞:

            評(píng)論


            相關(guān)推薦

            技術(shù)專區(qū)

            關(guān)閉