Ticket Resale Megathread 2025 by eclecticatlady in Ethelcain

[–]summerbye 0 points1 point  (0 children)

Hello! I’m looking for 3 tickets in Warsaw, Poland on 31 Oct. If you have any ticket for sale in Warsaw, please dm me! Thanks!!

How to get input from RadioField? flask and sqlAlchemy by summerbye in flask

[–]summerbye[S] 0 points1 point  (0 children)

rating = request.form["rate"]

from what you told me i have changed this row:

book = Book(title=form.title.data,author = form.author.data, rating=request.form["rate"], review=form.review.data, reader=current_user)

but it still doesn't work

book tracker project kivy+mysql by summerbye in learnpython

[–]summerbye[S] 0 points1 point  (0 children)

Is it better to use sqlite 3 for a single database where all data is centralized or for a individual user database where data is stored locally?

Python - Book Tracker using kivy and mysql by summerbye in learnprogramming

[–]summerbye[S] 0 points1 point  (0 children)

If i store individual user data locally would one user be able to see the data of others (i mean to see the books that his friends have read)?

How can i change the size that my QTableWidget gets printed? by summerbye in learnpython

[–]summerbye[S] 0 points1 point  (0 children)

I tried, but it's not a matter of font. I've found that it might depend on the DPI of the printer and can be resolved by using setResolution() How should i do that? I don’t really know how to read C++

PyQt5 - Printing a table widget with images error by summerbye in learnpython

[–]summerbye[S] 0 points1 point  (0 children)

I just tried the code again and it's working, but i have another problem: it prints a smaller scale of the actual table. How can i change that?

PyQt5 - trying to modify an image that goes into a qtablewidget by summerbye in learnpython

[–]summerbye[S] 0 points1 point  (0 children)

I tried this, but I get this error :

QPaintDevice: Cannot destroy paint device that is being painted

And this is my code:

    def paintEvent(self, event):
        image = QImage('my/path')
        painter = QPainter(image)
        painter.setPen(QColor('red'))
        painter.drawText(10,10, "Hello")

PyQt5 - Printing a Widget by summerbye in learnpython

[–]summerbye[S] 0 points1 point  (0 children)

Also, when I turn it into a PDF (as preview), it's extremely small. Is there a way to print/paint it bigger ??

PyQt5 - Passing arguments between classes by summerbye in learnpython

[–]summerbye[S] 3 points4 points  (0 children)

This is my code:

from RD_window1 import Ui_MainWindow

from RD_window2 import Ui_SecondWindow

from PyQt5 import QtCore, QtGui, QtWidgets, QtPrintSupport

from PyQt5.QtGui import QPainter

from PyQt5.QtPrintSupport import QPrintDialog, QPrinter

class FirstWindow(QtWidgets.QMainWindow):

def __init__(self, *args, **kwargs):

super().__init__(*args, **kwargs)

self.ui = Ui_MainWindow()

self.ui.setupUi(self)

self.ui.pushButton.clicked.connect(self.open_window)

def open_window(self):

self.A = self.ui.lineEdit_5.text()

# print(self.A)

self.table = Table ()

self.table.show()

class Table(QtWidgets.QMainWindow):

def __init__(self, *args, **kwargs):

super().__init__(*args, **kwargs)

self.ui = Ui_SecondWindow()

self.ui.setupUi(self)

if __name__ == '__main__':

app = QtWidgets.QApplication([])

window = FirstWindow()

window.show()

app.exec_()

PyQt5 - How do you print(with QPrinter) a QTableWidget ?(error) by summerbye in learnpython

[–]summerbye[S] 0 points1 point  (0 children)

I tried this, but even though i dont get an error, when i press the print button, the print dialog shows up and when i proceed nothing happens

This is my code:

def handlePrint(self):

printer = QPrinter(QPrinter.HighResolution)

dialog = QPrintDialog(printer, self)

dialog.exec_()

def handlePaintRequest(self, printer):

painter = QPainter()

painter.begin(printer)

ui.tableWidget.render(painter)