Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: How to always select the item in the first column when a row is selected
Post: RE: How to always select the item in the first col...

I found it qstandardItem = model.item(row, 0) I am sure I tried that earlier and it did not work, but maybe I did not have self.proxyView.setSelectionBehavior(QTreeView.SelectRows) set earlier? (...
DrakeSoft GUI 1 1,637 Feb-17-2023, 07:43 PM
    Thread: How to always select the item in the first column when a row is selected
Post: How to always select the item in the first column ...

I am using the code below to try and understand how to be able to select the data in the first column of a treeview irrespective of where in the row I click. If you look at the function selectItem, yo...
DrakeSoft GUI 1 1,637 Feb-17-2023, 07:32 PM
    Thread: PyQT Problems with multiple fonts
Post: RE: PyQT Problems with multiple fonts

I have worked around the issue for now with an ugly hack def removeMultipleFonts(self): html = self.editor.document().toHtml() htmlTransformed = re.sub(r"(font-family:)('.+'),('.+...
DrakeSoft GUI 2 1,521 Feb-12-2023, 06:39 PM
    Thread: PyQT Problems with multiple fonts
Post: PyQT Problems with multiple fonts

I have a PyQT program that saves a file in HTML format. It uses the QFontComboBox and on a change in selection I set the editor (QTextEdit) to match the selection self.fonts = QFontComboBox() self...
DrakeSoft GUI 2 1,521 Feb-10-2023, 02:21 PM
    Thread: Adding a new file/node to QFileSystemModel
Post: Adding a new file/node to QFileSystemModel

The QFileSystemModel has methods to remove a file, remove a directory and create a directory. remove() rmdir() mkdir() I expected it would have an equivalent convenience function to create a file (I ...
DrakeSoft GUI 1 1,051 Feb-06-2023, 11:15 AM
    Thread: self.pos().x() and self.pos().x() always return -3,-30 on PyQT5
Post: RE: self.pos().x() and self.pos().x() always retur...

Thank you for your replies. The problem only occurs when running on wayland, so I think the issue is at that level rather than the window manager level. if I switch to X11 then self.pos().x(), self.po...
DrakeSoft GUI 3 1,528 Jan-15-2023, 09:28 AM
    Thread: self.pos().x() and self.pos().x() always return -3,-30 on PyQT5
Post: self.pos().x() and self.pos().x() always return -3...

Hi, I am using the code below to experiment with window size and psoition. I notice that irrespective of where I move the window self.pos().x() and self.pos().x() always return -3,-30 Is this a bug?...
DrakeSoft GUI 3 1,528 Jan-13-2023, 02:31 PM
    Thread: Hover over highlighted text and open popup window
Post: RE: Hover over highlighted text and open popup win...

Thank you for your reply
DrakeSoft GUI 2 1,512 Oct-29-2022, 04:30 PM
    Thread: Hover over highlighted text and open popup window
Post: Hover over highlighted text and open popup window

Hi, I am looking for an approach that might allow me to hover over a highlighted work in a QTextEdit widget and on hovering open a pop-up window to perform some action on that section of text. One a...
DrakeSoft GUI 2 1,512 Oct-28-2022, 11:19 AM
    Thread: Using QSyntaxHighlighter to query a documents format
Post: RE: Using QSyntaxHighlighter to query a documents ...

(Sep-30-2022, 03:48 AM)deanhystad Wrote: This example uses state to help highlight multi-line strings. https://wiki.python.org/moin/PyQt/Python...ghlighting Here's some rather useless examples of ...
DrakeSoft GUI 7 1,730 Sep-30-2022, 10:14 AM
    Thread: Using QSyntaxHighlighter to query a documents format
Post: RE: Using QSyntaxHighlighter to query a documents ...

(Sep-30-2022, 02:37 AM)Larz60+ Wrote: have you seen: https://doc.qt.io/qtforpython-5/PySide2/...ghter.html which has ample examples. Thank you for replying; yes, I saw those examples, but all of tho...
DrakeSoft GUI 7 1,730 Sep-30-2022, 06:57 AM
    Thread: Using QSyntaxHighlighter to query a documents format
Post: Using QSyntaxHighlighter to query a documents form...

The documentation for QSyntaxHighlighter Class indicates that the QSyntaxHighlighter class allows you to define syntax highlighting rules, and in addition you can use the class to query a document's c...
DrakeSoft GUI 7 1,730 Sep-29-2022, 08:13 PM
    Thread: Creating hot spots in PyGTK
Post: Creating hot spots in PyGTK

Hi, I am trying to create an application in PyGTK that will feature 4 video screens in a single GTK window. I am using GTKs UI sockets to embed the video and this works fine. I can embed a number of ...
DrakeSoft GUI 1 1,606 Aug-01-2022, 02:20 PM
    Thread: Changing a column header in QTreeView
Post: [Solved] RE: Changing a column header in QTreeView

This addresses the issue for me # import necessary modules import sys from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtPrintSupport import * class Cus...
DrakeSoft GUI 4 3,593 Jun-25-2022, 09:11 AM
    Thread: Changing a column header in QTreeView
Post: RE: Changing a column header in QTreeView

(Jun-24-2022, 05:11 PM)Axel_Erfurt Wrote: I think you can't change the header of QFileSystemModel. It doesn't make any sense either. Thanks Alex. In this case I am using a folder as a means of stori...
DrakeSoft GUI 4 3,593 Jun-24-2022, 05:58 PM
    Thread: Changing a column header in QTreeView
Post: Changing a column header in QTreeView

Hi, I have a QTreeView which uses QFileSystemModel. # import necessary modules import sys from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtPrintSuppor...
DrakeSoft GUI 4 3,593 Jun-24-2022, 11:21 AM
    Thread: How to filter a table view using SortFilterProxyModel
Post: RE: How to filter a table view using SortFilterPro...

Thank Alex, That was it! I had initially tried to do the filtering in filterAcceptsRow, and put in the return True as a way of disabling it. I think I should have been using this as follows then: cl...
DrakeSoft GUI 8 8,862 May-28-2022, 06:23 PM
    Thread: How to filter a table view using SortFilterProxyModel
Post: RE: How to filter a table view using SortFilterPro...

Thank you Alex and Deanhystad, I appreciate your help I can understand how the findInTable method will allow me to hide the data I do not want to see, but I am still curious as to why my implementati...
DrakeSoft GUI 8 8,862 May-28-2022, 10:08 AM
    Thread: How to filter a table view using SortFilterProxyModel
Post: How to filter a table view using SortFilterProxyMo...

Hi, I have tried to create a sample program to help me figure out how the SortFilterProxyModel works in PyQT. from PyQt5.QtWidgets import (QApplication, QMainWindow, QTa...
DrakeSoft GUI 8 8,862 May-27-2022, 10:46 AM
    Thread: Determining the format attributes on text in a QTextEdit object
Post: RE: Determining the format attributes on text in a...

Thanks @deanhystad I have reflected on the approach I am taking and the problem I am trying to solve and believe there is probably a more elegant way of doing what I am trying to do. My original idea ...
DrakeSoft GUI 7 3,550 Apr-18-2022, 06:40 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020