Skip to content

Language Bindings

You're using Qt with other languages than C++, eh? Post here!
850 Topics 3.3k Posts
  • [pyqt] how QSqlQueryModel insert a record and update view?

    Unsolved
    1
    0 Votes
    1 Posts
    330 Views
    No one has replied
  • Auto connection not being assigned/called in 2 of 4 cases

    Unsolved
    4
    0 Votes
    4 Posts
    413 Views
    P

    @All Compared to an auto- connection writing a manual connection requires much more time and is more difficult to debug (exp. finding a particular connection in the source – The Goto slot… helps finding the location in the source). In this relatively large project it would take more than a month to repair all connections. I personally like these kinds of automatisms.

    Therefore I did some further analysis. First of all the auto-connections are only non reliable in terms of understanding what is going on. But the reported issue here is 100% reproducible.
    In fact the moc is not guilty at all and compiles correctly as the dispatcher code being produced by the moc has all the required calls:

    void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { MainWindow *_t = static_cast<MainWindow *>(_o); switch (_id) { ... case 35: _t->on_firstToolButton_clicked(); break; case 36: _t->on_prevToolButton_clicked(); break; case 37: _t->on_nextToolButton_clicked(); break; case 38: _t->on_lastToolButton_clicked(); break; case 39: _t→on_navigationLabel_linkH …

    This dispatcher method is called from another method

    int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { … }

    and that one is called from a code section only displayed in assembly code.
    Assuming, that the _id for the dispatcher might be wrong I added a breakpoint to check, but while for all other buttons this call is executed, pressing the prev and next button this metacall method not even reached.

    As it tends to be reproducible I analysed the source files and with the help of GIT I figured out, that the only difference is in the MainWindow.ui:

    ... 1968 1968 <property name="locale"> 1969 1969 <locale language="English" country="UnitedStates"/> 1970 1970 </property> 1971 <zorder>toolWidget</zorder> 1972 1971 </widget> 1973 1972 <widget class="GraphicsWidget" name="recentPage"> 1974 1973 <property name="locale"> ... )* The first two columns are showing the line numbers as shown with GIT before/after

    Somehow the designer added the <zorder> key somewhen before yesterday, and re-assigning the slots was removing this line again.

    I have to add that the toolWidget is a container with a QGridLayout for all my buttons (about a dozen more) used to fade in and out the buttons simultaneously.

    For me it looks like that auto-connections can safely be used, unless a <zorder> key is present in the .ui file.
    So the remaining questions are:

    What did the designer cause to add the <zorder> key? Why only 2 QToolbutton were affected, but all others are working Ok?
  • How to pass string value from dialog to mainwindow

    Unsolved
    5
    0 Votes
    5 Posts
    5k Views
    JonBJ

    @dobiz22
    Just that it is better "style" to access via getters & setters. Hides some of the internals, allows a bit of extra code to be put into the getter/setter if required (e.g. validation), you can place a debugger breakpoint on them, that sort of thing.

  • source and include file errors.

    Unsolved
    4
    0 Votes
    4 Posts
    406 Views
    jsulmJ

    @busrazone Again: what build system do you use? QMake? CMake? Plain Makefile?

  • 0 Votes
    3 Posts
    7k Views
    E

    This worked, thank you!

  • 0 Votes
    1 Posts
    531 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • closeEvent not working

    Unsolved
    32
    0 Votes
    32 Posts
    17k Views
    H

    @JonB Yeah I used to do that, and it worked fine on PyQt5, but unfortunately it doesn't work at all on pyside6 (ditto pyside2 based on past discussion).

  • How to set text color of QTextEdit in PyQt5

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    SGaistS

    Hi,

    What color do you want to change ?
    The text color ?
    The background ?
    Both ?

  • 0 Votes
    3 Posts
    520 Views
    Q

    @JonB
    That sounds cool. Will follow your suggestion.

  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • qmake is not recognized as an internal or external command

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    Z

    @SGaist Ok
    I will try and return the result.
    Thanks for your support

  • I'm on the w10

    Unsolved
    1
    0 Votes
    1 Posts
    289 Views
    No one has replied
  • Integrate Python Qt-based GUI tools into console app

    Unsolved
    3
    0 Votes
    3 Posts
    605 Views
    B

    @SGaist thank you. What we have at the moment is a pretty vanilla console and I had been thinking about how to extend that with some limited GUI facilities. But the ipython route isn't something I had considered and I wasn't aware of the Qt console. It would be a change of direction but certainly something to consider and investigate. Thanks again.

  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    4 Views
  • 0 Votes
    3 Posts
    950 Views
    V

    The problem was solved.
    Replace QVariant -> "QVariant"
    The correct definition of the signal in python code is:

    toUI = Signal(str, "QVariant")

    Refer: https://github.com/mottosso/Qt5.py/issues/5

  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    41 Views
    No one has replied
  • Custom scrollbar doesn't translate to pyqt from designer

    Unsolved
    6
    0 Votes
    6 Posts
    676 Views
    SGaistS

    Tested on a Mac with PyQt installed through conda. Package is pyqt-5.12.3.

    The scrollbar is changed.

    Note that your code cannot be run directly, it's missing a QMainWindow instance as well as the QApplication part.

  • 0 Votes
    3 Posts
    634 Views
    2

    Thanks for the reply @SGaist. What I wanted was to update some data (in form of text) from python backend, most of the tutorials I saw were based on using signals and slots. were as I only needed a slot to read without any triggering signal. Though I've been able to finally figure it out and spending this much time actually made me understood it more. I used QTimer to refresh the backend function every half a second.

  • Rust bindings

    Unsolved
    4
    0 Votes
    4 Posts
    798 Views
    artwawA

    @Olivier92m Then just include that library in your code, assuming it has the right bindings for c++? if it ain't then I don't know, as far as I can't tell you can't make it work.
    If you're about to compile something c++ linking to the said library it has to have c++ header files, you know.