Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. python3
    Log in to post

    • SOLVED Download full web page
      QtWebEngine • qtwebengine python3 • • Black Cat  

      7
      0
      Votes
      7
      Posts
      251
      Views

      @mpergand Thank you man =)
    • UNSOLVED Display Animated SVG
      General and Desktop • pyqt5 python3 svg animations exe • • Pythonic person  

      2
      0
      Votes
      2
      Posts
      126
      Views

      use splash widget? https://doc.qt.io/qt-6/qsplashscreen.html
    • UNSOLVED Help Wanted: PyQt: How can I handle the html and JavaScript content that open in new tab?
      QtWebEngine • python3 pyqt6 • • AzlanCoding  

      1
      0
      Votes
      1
      Posts
      278
      Views

      No one has replied

    • UNSOLVED why predefined function do not work in pycharm
      General and Desktop • pyqt5 desktop python3 function pycharm • • lanas  

      2
      0
      Votes
      2
      Posts
      90
      Views

      Hi, That's because these classes are no widgets, there are used to build the UI. In you code snippet, you would use self.nextui.hide() to hide the widget that was created with the help of Registration.Ui_Registration. That is the same for all the widgets you created that way.
    • SOLVED what is the correct way to build the application
      General and Desktop • pyqt5 desktop qtdesigner python3 • • lanas  

      3
      0
      Votes
      3
      Posts
      98
      Views

      thank you sir for your help
    • UNSOLVED how to insert and dipslay data from dateTimeEdit
      General and Desktop • mysql pyqt5 python3 • • lanas  

      4
      0
      Votes
      4
      Posts
      88
      Views

      Yes, Qt.EditRole and Qt.DisplayRole are the same thing in non-customised Qt classes
    • UNSOLVED mysql query does not take the dataset user inserted
      General and Desktop • python mysql python3 cursor • • lanas  

      4
      0
      Votes
      4
      Posts
      146
      Views

      @lanas Yes to all of that, by all means read that overview link. I didn't say that "will be hard to retrive data from data base if i did not work with qtsql classes". Using the Python SQL classes instead would be fine for retrieving data from the database. But when you want to display that data in your Qt UI, rows & columns from your SQL queries, that will require some coding to get the Python-SQL-fetched-data to the Qt UI widgets and back. Whereas if you use the Qt classes they fill Qt models directly, and those are what Qt QTableViews use to display (and even edit) data. In the simplest case, see if you can't use Qt's QSqlTableModel for attaching your data retrieval to the database. That will have the necessary SELECT/INSERT/UPDATE/DELETE automatically generated/issued for you for working on a SQL table in the database, without you having to write the SQL statements like you tried to in your question. And attaching a QTableView to the QSqlTableModel will display what you fetched without any code. And it can even allow you/the user to edit the data in the table and write ot back to the database for you.
    • UNSOLVED Zoom in on the current mouse position of a QGraphicsView without losing quality
      General and Desktop • qgraphicsview pyqt5 qpixmap python3 • • emiliathewhite  

      6
      0
      Votes
      6
      Posts
      477
      Views

      Depending on your end goal, you might want to consider using a library like OpenCV to do the zooming part and Qt to display the result.
    • UNSOLVED How to display QTableWidget selected row in a qLineEdit of the same class?
      General and Desktop • qtablewidget pyqt5 python3 setfoc • • CEO.  

      12
      0
      Votes
      12
      Posts
      616
      Views

      @CEO said in How to display QTableWidget selected row in a qLineEdit of the same class?: @JonB now I discovered you are either hoarding knowledge or might not have done any work on the question. Yes, you're right. I have nothing better to do than lie to questioners about what I know and they should do, and I don't spend enough of my time writing the code demanded to save them time. Here is an extract from my usage of the QDataWidgetMapper which I know nothing about from a sample project of mine. I'm sorry if my variables/widgets/model are not the same as yours. Also here I happen to be binding to QSpinBoxes, let me know if I need to change it to QLineEdits for you. void SectorRegisters::initDataWidgetMapper() { // set up the `QDataWidgetMapper` this->dwm = new QDataWidgetMapper(this); // set model (this->sectorsModel is the model being used, in my case it's a `QStandardItemModel`) SectorsModel *sectorsModel = this->sectorsModel; dwm->setModel(sectorsModel); // Vertical => widget mapped to row dwm->setOrientation(Qt::Vertical); // current index is always column #0 dwm->setCurrentIndex(0); // Region mappings dwm->addMapping(ui->spinRegionSocialState, SectorsModel::RegionSocialState); dwm->addMapping(ui->spinRegionGoodAreas, SectorsModel::RegionGoodAreas); dwm->addMapping(ui->spinRegionPoorAreas, SectorsModel::RegionPoorAreas); dwm->addMapping(ui->spinRegionCash, SectorsModel::RegionCash); // Here there are many further widget<->model-column mappings // ... } You're welcome.
    • UNSOLVED How to avoid Null or empty value in QLineedit of Pyqt5
      General and Desktop • pyqt5 python3 sqlite3 pycharm • • Lalremruata  

      3
      0
      Votes
      3
      Posts
      640
      Views

      @Lalremruata said in How to avoid Null or empty value in QLineedit of Pyqt5: even the self.lineEdit_2 is empty. Are you really 100% sure? I used PyQt5 and I'm pretty sure self.lineEdit_2.text() == "" would work as expected. Get rid of all your other code and behaviour and check just this in a tiny program? @jsulm You should rather use https://doc.qt.io/qt-5/qstring.html#isEmpty My understanding is PyQt5's QLineEdit.text() returns a Python str rather than a C++ QString anyway. I never found using QString methods of any use in PyQt5.
    • UNSOLVED how to import cpp dll in python?
      General and Desktop • qt5 python3 • • Selvajothi  

      4
      0
      Votes
      4
      Posts
      342
      Views

      @Selvajothi There could be many causes. I suggest you Google for _dlopen specified procedure. Note that the error you show is on procedure, not on module.
    • UNSOLVED What is the exact code to change PushButton background-color onclick in the button's stylesheet in Qt Designer?
      General and Desktop • stylesheet pyqt5 python3 qt designer pushbutton • • I-TECH  

      3
      0
      Votes
      3
      Posts
      260
      Views

      @JonB Thank you for interactions. Would you please show me an exact code of for example a PushButton and where to implement it. I am advanced python coder, I just need to see exact steps. Thank you very much.
    • UNSOLVED ValueError: could not convert string to float
      General and Desktop • pyqt5 python3 • • YassineKira  

      4
      0
      Votes
      4
      Posts
      1155
      Views

      @KroMignon Well, i try to learn from anothers in every forum, sorry :), @jsulm Thank you Sir, you are a Life saver :)
    • UNSOLVED How to launch a second GUI application via a button click in another GUI application - python
      General and Desktop • pyqt5 python3 • • Stainopel  

      2
      0
      Votes
      2
      Posts
      385
      Views

      @Stainopel None of this seems relevant. Either you don't really want separate applications but just one and you just want to show the other widget. Or, to run another application as you ask, use Qt's QProcess, or the Python ones for running sub-processes if you prefer, called from your button clicked slot.
    • SOLVED Open and display a file through a function click and using the opened file as input for another function with PYQT5
      General and Desktop • pyqt5 python3 • • Stainopel  

      10
      0
      Votes
      10
      Posts
      557
      Views

      @JonB Very Good Suggestion, I used a second variable in the other function to read the opened file(s) from the first function and it did work like a charm. Thanks. Here is an update to the code def encryption_hash(self,comboBox_2): index = self.comboBox_2.currentIndex() path = self.fname_E with open(path, 'rb') as f: if index == 2: hasher1 = hashlib.md5() afile1 = f buf1 = afile1.read() a = hasher1.update(buf1) md5 =(str(hasher1.hexdigest())) self.lineEdit_E.setText("File Hash Using MD5: " + md5)
    • SOLVED Comparing two strings in different widgets
      General and Desktop • pyqt5 python3 • • Stainopel  

      9
      0
      Votes
      9
      Posts
      572
      Views

      @Pl45m4 yes I initially used a line edit but ended up changing it to a qtextedit instead. Then using the documentation I was able to get the expected results
    • UNSOLVED QT Designer can't detect python
      Language Bindings • python3 designer error • • Running_Child  

      1
      0
      Votes
      1
      Posts
      369
      Views

      No one has replied

    • UNSOLVED How to generate python bindings using shiboken from an existing C++/Qt shared library?
      Language Bindings • python python3 python support shiboken • • Alex94102  

      6
      0
      Votes
      6
      Posts
      605
      Views

      Thanks for the links !
    • SOLVED How to workaround change in Qt 5 handling of QListView.mousePressEvent and QStyledItemDelegate.editorEvent?
      General and Desktop • qlistview python3 qstyleditemdele • • DamonLynch  

      4
      0
      Votes
      4
      Posts
      765
      Views

      In case anyone comes across this in a search, I was able to solve the problem by manipulating the selection in the class member function selectionChanged(): https://bazaar.launchpad.net/~dlynch3/rapid/zeromq_pyqt/revision/1178#raphodo/thumbnaildisplay.py Perhaps that was always the best way to do it.
    • UNSOLVED Open Source viewer for genetics variation
      Qt Medical • pyside2 python3 bioinformatics genomics • • dridk2  

      4
      4
      Votes
      4
      Posts
      565
      Views

      Hi @dridk2 , I wish to help you with this project.
    • UNSOLVED How to implement virtual keyboard with PySide2 and QML
      Mobile and Embedded • qml pyside2 python3 virtualkeyboard qml binding • • RG97  

      7
      0
      Votes
      7
      Posts
      1718
      Views

      try to add this to main.py import os os.environ["QT_IM_MODULE"] = "qtvirtualkeyboard"
    • SOLVED Common buttons and positioning in Python PyQt5 QStackedLayout
      General and Desktop • pyqt5 python3 • • benjibenjibenji  

      2
      0
      Votes
      2
      Posts
      2137
      Views

      Hi, You can put your QStackedLayout and buttons in a QVBoxLayout so you can re-use the buttons. Put that layout in a QWidget and set that widget as the central widget of your QMainWindow.
    • SOLVED How to forward Qt Mouse event to QQuickView?
      QML and Qt Quick • qml qt5 pyqt5 python3 • • eugeneoei  

      3
      0
      Votes
      3
      Posts
      1134
      Views

      @raven-worx you sir saved my life! I cant believe i was stuck at this for 2 days, when it was simply just about using the right object in qml. thanks!
    • UNSOLVED The QMediaPlayer object does not have a valid service on Ubuntu 16.04
      General and Desktop • pyside2 python3 qt5.11 ubuntu 16.04 qmultimedia • • nekitamtip  

      1
      0
      Votes
      1
      Posts
      1055
      Views

      No one has replied

    • UNSOLVED PySide2 with Python3 Built-In Multiprocessing
      Language Bindings • qthread pyside2 python3 multiprocessing • • GLaDOS1105  

      3
      0
      Votes
      3
      Posts
      1589
      Views

      I confirm the same observation, that the script runs with PyQt5 (pyqt5 5.15.4) installed via pip and fails when run with PySide2 (PySide2-5.15.2) installed via pip: QObject::moveToThread: Current thread (0x22b951c64b0) is not the object's thread (0x22b951c6c50). Cannot move to target thread (0x22b951c64b0) qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: direct2d, minimal, offscreen, webgl, windows. Following the advice of this thread (https://forum.qt.io/topic/93085/qt-python-development-pyside2/6), I removed the PySide2 installed via pip and installed the version via conda-forge (v 5.13.2) and was able to run the script. So, it appears a matter of packaging/dependencies rather than a strict inability for PySide2 to handle it or something related to the version.
    • UNSOLVED How I can create the table view having two columns in QML?
      QML and Qt Quick • qml pyqt5 python3 tableviewcolumn • • Rohn  

      2
      0
      Votes
      2
      Posts
      944
      Views

      Hi there. I think you can use TableViewColumn element to create a new column inside a TableView component. If necessary, you can define your own delegate to set how the data is showed to user. Read more: http://doc.qt.io/qt-5/qml-qtquick-controls-tableview.html#details <- TableView Documentation http://doc.qt.io/qt-5/qtquickcontrols-tableview-main-qml.html <- TableView Example
    • UNSOLVED How to read file (or multiple line string ) from python function to QML text Area?
      QML and Qt Quick • qml pyqt5 python3 signals&slots • • Rohn  

      1
      0
      Votes
      1
      Posts
      452
      Views

      No one has replied

    • UNSOLVED How do I animate the position change of a Widget while using a layout manager?
      General and Desktop • python pyqt5 pyqt python3 qpropertyanimat • • subnub99  

      1
      0
      Votes
      1
      Posts
      945
      Views

      No one has replied

    • SOLVED QByteArray to string?
      Language Bindings • pyqt5 python3 • • JonB  

      29
      -1
      Votes
      29
      Posts
      24349
      Views

      @germyrinn Hi, this was an old post of mine. As I wrote, the problem is that for the £ sign e.g. read from a file created in the way I describe, decode("utf-8") gives me a UnicodeDecodeError. I found the only conversion which works is decode("cp850").
    • UNSOLVED Resizing QMainWindow and QDialog
      General and Desktop • qmainwindow resize python3 windows10 qt 5 • • Ocram10  

      7
      0
      Votes
      7
      Posts
      2861
      Views

      @Fuel the exemples in pyqt-master do it automatically but i don't understsnd what event or property they use
    • SOLVED Render image from hsv color
      General and Desktop • qwidget qpainter python3 rendering drawpixmap • • Adam V  

      8
      0
      Votes
      8
      Posts
      3352
      Views

      I have found a solution that kind of does the job, although takes three times as much memory. Every update I calculate the difference between the new and the old saturation matrix, this eliminates 60% of the nonzero values, which means it gets drawn that much faster. As a second layer of optimization I call repaint with a rectangle describing the most important zone, and call update every 60ms.
    • UNSOLVED Python custom widget for Qt Designer
      3rd Party Software • widget pyqt5 python3 designer • • Pierone  

      2
      0
      Votes
      2
      Posts
      1547
      Views

      @Pierone Can you put you code in GitHub instead of a rar file? Its pretty awkward to unpack your code.
    • UNSOLVED Python custom widget per Qt Designer
      Italian • pyqt5 python3 designer • • Pierone  

      1
      0
      Votes
      1
      Posts
      826
      Views

      No one has replied

    • UNSOLVED Starting a python project in qt creator, how?
      General and Desktop • python3 qt designer material design qt creator 4.2 • • Pataruutu  

      3
      0
      Votes
      3
      Posts
      5179
      Views

      @Pataruutu Hi the video you link is QML :) So its its the reason it looks differently. The one you call ugly is QWidgets and it uses the default look of the platform. It seems you can use QML with pyt http://pyqt.sourceforge.net/Docs/PyQt5/qml.html
    • SOLVED Passing list to class init, pyQt
      General and Desktop • pyqt5 python3 • • robbiecooper  

      4
      0
      Votes
      4
      Posts
      1358
      Views

      Thanks @jsulm!! That sorted it!
    • UNSOLVED PyQt5 virtual keyboard (TypeError: missing 1 required positional argument)
      Language Bindings • python qt5.5 pyqt5 python3 virtualkeyboard • • alekssandrap  

      5
      0
      Votes
      5
      Posts
      4465
      Views

      Hay i saw your keyboard its really good, i also want to design this kind of keyboard, can you please tell me when i move the cursor on the keys it automatically enlarge. how is it possible ? and another one is, when i am typing it does not show anything but my only cursor move forward.
    • UNSOLVED PyQt5 blurpicker example
      Language Bindings • qtcreator python pyqt5 pyqt python3 • • alekssandrap  

      5
      0
      Votes
      5
      Posts
      1988
      Views

      Thank you! I didnt noticed that. I did correct this mistakes, but still getting the same error:( and empty window :/
    • UNSOLVED PyQt5 Events
      Language Bindings • python pyqt5 pyqt python3 pyqt4 • • alekssandrap  

      1
      0
      Votes
      1
      Posts
      2109
      Views

      No one has replied