How do I compile a PyQt script (.py) to a single standalone executable file for windows (.exe) and/or linux?

if you want completelly create one stand alone executable, you can try PyInstaller . i feel it’s better to create one stand alone executable than cx_freeze or py2exe (in my experience). and easy to use (full documentation available in the site). It supports Python 3.6 or newer. Pass the –onefile argument if you want to … Read more

Qt – remove all widgets from layout?

I had the same problem: I have a game app whose main window class inherits QMainWindow. Its constructor looks partly like this: m_scene = new QGraphicsScene; m_scene->setBackgroundBrush( Qt::black ); … m_view = new QGraphicsView( m_scene ); … setCentralWidget( m_view ); When I want to display a level of the game, I instantiate a QGridLayout, into … Read more

How to get sender widget with a signal/slot mechanism?

Use QObject::sender() in the slot, like in the following Example: void MainWindow::someSetupFunction( void ) { … connect( _foobarButton, SIGNAL(clicked()), this, SLOT(buttonPressedSlot()) ); } void MainWindow::buttonPressedSlot() { // e.g. check with member variable _foobarButton QObject* obj = sender(); if( obj == _foobarButton ) { … } // e.g. casting to the class you know its connected … Read more

How to make a column in QTableWidget read only?

Insert into the QTableWidget following kind of items: QTableWidgetItem *item = new QTableWidgetItem(); item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); Works fine! EDIT: QTableWidgetItem *item = new QTableWidgetItem(); item->setFlags(item->flags() ^ Qt::ItemIsEditable); This is a better solution. Thanks to @priomsrb.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)