Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
853 Topics 3.3k Posts
  • [SOLVED] Qt functions from a DLL

    3
    0 Votes
    3 Posts
    1k Views
    S

    Thanks! that worked!

  • 0 Votes
    1 Posts
    853 Views
    No one has replied
  • 0 Votes
    6 Posts
    2k Views
    D

    [quote author="SGaist" date="1406317872"]That might be something to talk about with the pyside devs[/quote]

    I'll share my findings with the list. Cheers!

  • 0 Votes
    2 Posts
    941 Views
    Y

    missing update of lib still pointing on pyside (RESOLVED)

  • 0 Votes
    2 Posts
    968 Views
    S

    Hi,

    Just an update, I wrote a quick bash script that created symbolic links for each:

    @/Library/Frameworks/Qt<module>.framework/Headers@

    folder in a custom location:

    @/myApps/Qt-4.8.6/include@

    And PySide compiled fine with CMake. Well, I have provided that path using the

    @-DALTERNATIVE_QT_INCLUDE_DIR@

    flag.

    However still curios to hear about this? How is that the CMake for PySide is not able to work with the framework based Qt?

    Thanks.

  • 0 Votes
    10 Posts
    3k Views
    SGaistS

    The link has been update

    You should contact the original author of this wiki entry to see if he can help you directly

  • 0 Votes
    1 Posts
    802 Views
    No one has replied
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • [Solved] Qt + Java (from Android)

    4
    0 Votes
    4 Posts
    4k Views
    X

    This is the source code of the project I was working on:

    https://github.com/xtingray/tupi.mobile

    Last year, I compiled it using MInistro/Qt4 and it worked. I ported the small code to Qt5 but I haven't tried again, so I have no idea if it works now.

    I hope this can gives you a hint. Good luck!

  • New Developer with QT how to start

    8
    0 Votes
    8 Posts
    3k Views
    R

    thanks for your info. But i see that in my system QT is installed as below path: C:\Qt\Qt5.3.1\Examples\Qt-5.3\activeqt\dotnet\walkthrough - here i could see one csharp project is there. I am trying to open that project in vs.net 2013. and i am getting the below error like

    "Error 10 The type or namespace name 'AxwrapperaxLib' could not be found (are you missing a using directive or an assembly reference?) C:\Qt\Qt5.3.1\Examples\Qt-5.3\activeqt\dotnet\walkthrough\Form1.cs 15 11 csharp

    Any comments on the above, i understood some libraries need to add my project, but i could not able to find which library and where should i get them please help out the answer..

  • Install QT Jambi on Mac OS X Mavericks

    2
    0 Votes
    2 Posts
    2k Views
    SGaistS

    Hi and welcome to devnet,

    I would say that

    @libQtCore.4.dylib: mach-o, but wrong architecture@

    is the hint you are looking for.

  • PySide: QWebPage.isModified() is out of sync

    2
    0 Votes
    2 Posts
    1k Views
    B

    You may notice from the example that the forms I care to detect are not mine.

    Here's another couple of ways I tried to do the same thing (catching forms):
    1- Attach onsubmit javascript handler on the form (this doesn't respond at all):
    @def _integrateForms(self, ok):

    this is the page's loadFinished handler if ok: page = self.browser.page() frame = page.mainFrame() frame.addToJavaScriptWindowObject("reporter", self) form = frame.findFirstElement("form") form_onsubmit = form.attribute("onsubmit") new_onsubmit = "reporter.submitPerformed(this.elements);" + form_onsubmit form.setAttribute("onsubmit", new_onsubmit)

    def submitPerformed(self, values):
    print values@

    2- Evaluate javascript on the form on the page's loadStarted event:
    @def loadStartedHandler(self):
    page = self.browser.page()
    frame = page.mainFrame()
    form = frame.findFirstElement("form")
    values = form.evaluateJavaScript("""
    var ret = {};
    var unwanted_inputs = ["submit"];
    for (var i = 0; i < this.length; ++i) {
    elem = this.elements[i];
    // do not include hidden elements neither submit buttons
    if ( elem.offsetParent !== null && unwanted_inputs.indexOf(elem.type) === -1 )
    ret[elem.name] = elem.value;
    }
    ret;
    """)
    print "Values: {}".format(values)@
    This last one seems to work, with some extra outputs.

  • Pyside and QWS on embedded arm platform

    14
    0 Votes
    14 Posts
    6k Views
    SGaistS

    For that one I can't, AFAIK, it's auto generated code

  • PySide Installer on Windows

    2
    0 Votes
    2 Posts
    1k Views
    C

    Doesn't actually work with pip and easy_install as suggested "here":http://qt-project.org/wiki/PySide_Binaries_Windows

    And I am still using the old installer for windows. Hope this will be fixed.

  • 0 Votes
    2 Posts
    3k Views
    B

    I think I solved this. I was calling loadUi in the function call. That was not needed because the call to loadUi was already defined in the runoptions class.

    Silly me.

    I am still getting this error;

    bq. Object::connect: No such slot runoptions::accept()
    Object::connect: (sender name: ‘buttonBox’)
    Object::connect: (receiver name: ‘Dialog’)
    Object::connect: No such slot runoptions::reject()
    Object::connect: (sender name: ‘buttonBox’)
    Object::connect: (receiver name: ‘Dialog’)

    The 'runoptions' form contains an OK and Cancel button which do not work. Not sure how to fix that but at least I am making some progress.

    I am not getting the "Designer" error anymore.
    Cheers,

  • PySide, pySerial and threading causes segfault

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • Accessing objects into another class

    6
    0 Votes
    6 Posts
    2k Views
    SGaistS

    Just setup your database and open it once e.g. in your main function. There's no need to close/open it every time you want to access it unless you have a very good reason

  • Integrating Qt as debug tool for server app

    4
    0 Votes
    4 Posts
    1k Views
    A

    moderator hat on: Using foul language is not acceptable here. Please practice patience for getting replies on your queries. If you need immediate answers, get paid support from one of the many vendors offering that.

    On your actual query: I think you're having a problem integrating event loops. I would not recommend trying to integrate a Qt UI into a service. Instead, I'd set up the design in a way that your service can communicate with an application via a simple protocol, and you keep the GUI as a separate process from the actual service. A local socket will do, but a network port just as well. DBUS may be good option for you as well.

  • [PySide] List model from PySide to QML

    2
    0 Votes
    2 Posts
    2k Views
    K

    Still seeking a reply to this.

  • Exit QThread Cleanly

    2
    0 Votes
    2 Posts
    2k Views
    jazzycamelJ

    Before I answer your question I will first say that, despite examples given in the docs, it is generally considered a bad idea to subclass QThread and instead create a worker object that is moved into a thread. To stop a QThread you need to call quit() and, if that fails, terminate(). The issue here is that you're running a blocking method and no event loop so these methods will not work on there own. What you therefore need is a flag that is checked on every iteration of the forever loop and set by a signal/slot call from your main thread when the GUI exits. The following files form a minimal working example:

    widget.h
    @
    #ifndef WIDGET_H
    #define WIDGET_H

    #include <QWidget>

    class QThread;

    class Widget : public QWidget
    {
    Q_OBJECT

    public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

    private:
    QThread *thread;

    signals:
    void stopThread();

    public slots:
    void start();
    void tick();
    };

    #endif // WIDGET_H
    @

    widget.cpp
    @
    #include "widget.h"
    #include "threaded.h"

    #include <QVBoxLayout>
    #include <QPushButton>
    #include <QThread>
    #include <QDebug>

    Widget::Widget(QWidget *parent) :
    QWidget(parent)
    {
    QVBoxLayout *l=new QVBoxLayout(this);

    QPushButton *startButton=new QPushButton("Start", this); connect(startButton, SIGNAL(clicked()), this, SLOT(start())); l->addWidget(startButton);

    }

    Widget::~Widget()
    {
    if(thread->isRunning()){
    emit stopThread();
    thread->quit();
    if(!thread->wait(5000)){
    thread->terminate();
    if(!thread->wait(5000)) qDebug() << "Failed to terminate!";
    }
    }
    }

    void Widget::start(){
    thread=new QThread();
    Threaded *threaded=new Threaded();
    connect(this, SIGNAL(stopThread()), threaded, SLOT(stop()));
    connect(threaded, SIGNAL(tick()), this, SLOT(tick()));
    connect(thread, SIGNAL(started()), threaded, SLOT(work()));
    threaded->moveToThread(thread);
    thread->start();
    }

    void Widget::tick(){
    qDebug() << "tick";
    }
    @

    threaded.h
    @
    #ifndef THREADED_H
    #define THREADED_H

    #include <QObject>

    class Threaded : public QObject
    {
    Q_OBJECT
    public:
    explicit Threaded(QObject *parent = 0);

    private:
    bool mStop;

    signals:
    void tick();

    public slots:
    void work();
    void stop();
    };

    #endif // THREADED_H
    @

    threaded.cpp
    @
    #include "threaded.h"

    #include <QMutex>
    #include <QWaitCondition>
    #include <QCoreApplication>

    Threaded::Threaded(QObject *parent) :
    QObject(parent), mStop(false)
    {}

    void Threaded::work(){
    QMutex dummy;
    QWaitCondition waitCondition;

    forever{ dummy.lock(); waitCondition.wait(&dummy, 1000); emit tick(); dummy.unlock(); QCoreApplication::processEvents(); if(mStop) break; }

    }

    void Threaded::stop(){
    mStop=true;
    }
    @

    main.cpp
    @
    #include <QtGui/QApplication>
    #include "widget.h"

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    Widget w;
    w.show();

    return a.exec&#40;&#41;;

    }
    @

    Hope this helps ;o)