Skip to content
Advertisement

Tag: pyqt

How do I modify spacing in nested PyQt layouts?

Currently, I have a nested QVBoxLayout in the first column of a QHBoxLayout, but no matter my changes to .setContentMargins or .setSpacing nothing changes in that first column. Leaves me with this result: What I want: Answer Use addStretch() method:

Why my PyQt5 Webview Code is not working?

This is my code. Why its not working? Where is my problem? Answer Your code has 2 problems: The QWebEngineView is not a child of the window so it will not be displayed. Change to self.widget = QWebEngineView(Form) QUrl(“google.com”) is not a valid url so you have 2 options, change to: QUrl(“https://google.com”) OR QUrl.fromUserInput(“google.com”)

Multiple context menu in a single qTableView pyqt5

i added two functions in two different pushButtons. for both function i used a common qtableView. i created two contextmenu, whenever user clicked pushButton1 func1 is called and result set will be shown in qtableView and user can select items from contextmenu1 and same like pushButton2 ,where contextMenu2 will appear . but in my code context menu is not showing

pyqtgraph: How to add radiobuttons on a figure legend?

I want to control which curves are displayed at the figure by using the radiobuttons floating on the left-top corner, which will work also as a legend. How can I do that? Answer This could be achieved by inheiring pg.LegendItem and overriding addItem method. In it you need to create widgets and place them into layout. You can use QGraphicsProxyWidget

Combining a file dialog with buttons in PyQt

I’m struggling with making the transition from Tkinter to the more object-oriented approach of PyQt. My particular question focuses on combining file dialogs with buttons. In the example below, having lines of code I admittedly don’t completely understand, I use a file dialog to load a time series, stored as a .csv file, into a dataframe and then plot it:

Advertisement