A while ago I did some work in Qt for C++; now I'm working with PyQt.
I have a subclass of QStackedWidget, and inside that a subclass of QWidget. In the QWidget I want to click a button that goes to the next page of the QStackedWidget. My (simplified) approach is as follows:
class Stacked(QtGui.QStackedWidget):
def __init__(self, p...
Frustrated by lack of a simple ACDSee equivalent for OS X, I'm looking to hack one up for myself. I'm looking for a gui library that accommodates:
Full screen image display
High quality image fit-to-screen (for display)
Low memory usage
Fast display
Reasonable learning curve (the simpler the better)
Looks like there are several choic...
Hi everyone,
How to make expandable sign in QTreeWidget always visible even when item doest have any subitems? And how to draw something else instead of default sign?
Thanks in advance,
Serge
...
Hi everyone,
I need to do some actions when item in QTreeWidget activates, but following code doestn't gives me expected result:
class MyWidget(QTreeWidget):
def __init__(self, parent=None):
super(MyWidget, self).__init__(parent)
self.connect(self, SIGNAL("activated(QModelIndex)"), self.editCell)
def editCell...
I'm writing a simple test program using QTreeModel and QTreeView for a more complex project later on. In this simple program, I have data in groups which may be contracted or expanded, as one would expect in a QTreeView. The data may also be sorted by the various data columns (QTreeView.setSortingEnabled is True). Each tree item is a lis...
Hi everyone,
I want to make editable cells with multi-lines content in QTreeWidget and I use for this purpose QPlainTextEdit as a delegate. I need to set proper size to all rows that switching between editing and displaying went smooth, without any visible changes.
rect = textEdit.blockBoundingRect(textEdit.firstVisibleBlock())
wit...
What is the cause of following error:
QSqlDatabasePrivate::database: unable to open database: unable to open database
file Error opening database?
Code is 100% correct, this message appeared when I have reinstalled Windows, Python and PyQt.
EDIT: I have "read-only" flag in folder with .db file properties. It stays gray (half-checked) w...
Hi everyone,
I have some problems with sizing row's height in QTreeWidget. I use QStyledItemDelegate with QPlainTextEdit. During editing text in QPlainTextEdit i check for changes with a help of:
rect = self.blockBoundingRect(self.firstVisibleBlock())
and if text's height changes i resize editor size and need row in QTreeWidget also ...
Hi,
I'm new in using Python. I would like to develop Windows GUI Application using Python. After some research, I found that I have 2 options:-
IronPython + .NET Framework
Python + PyQt
May I know which one is better for Windows Application development? Which option has more features (e.g. database support, etc)?
Other than the .NE...
I'm making an app wherein the user can add new data to a QTreeModel at any time. The parent under which it gets placed is automatically expanded to show the new item:
self.tree = DiceModel(headers)
self.treeView.setModel(self.tree)
expand_node = self.tree.addRoll()
#addRoll makes a node, adds it, and returns the (parent) note to be expa...
EDIT2: model.hasChildren(parentIndex) returns True, but model.rowCount(parentIndex) returns 0. Is QFileSystemModel just fubar in PyQt?
EDIT: With a bit of adaptation this all works exactly as it should if I use QDirModel. This is deprecated, but maybe QFileSystemModel hasn't been fully implemented in PyQt?
I'm learning the Qt Model/V...
Hi everyone,
I tried to write an editable table based on QTreeView with wordwraped content in cells which in turn should expand in height (that whole text was visible) like usual cells in tables like in MSWord, but have met insuperable obstacles:
first - i can't set fixed cell size.
second - i can't make text display in cells wordwra...
Is there a GPL or less restrictive (preferred LGPL) library to view & print PDFs?
I'm using PyQt, maybe there's a possibility to render PDFs using it?
...
I've written a descendant of QTreeView with multiple columns. I want to create a popup menu that appears whe nthe user right-clicks over the column headers. I have tried catching signals from QTreeView for this, but QTreeView doesn't seem to emit signals on the headers. QTreeView.header() does. I therefore believe I must either:
1: conne...
Hi everyone,
can you advice what to use for making tree structured text editor?
I used QTreeView for this (asked few questions to solve my problems), but it seams it's not suitable for this purpose.
Thanks in advance,
Serge
...
I want to use a QComboBox with the "keys" and "values" from a tuple similar to the ones used in a django models. For example I have the following structure for a person's sex.
SEX_CHOICES = (('M', 'Male'), ('F', 'Female'))
The first item of the tuple contains the code of the sex that is stored in the database, and the second one the t...
I'm having an annoyingly stubborn problem here, and I would appreciate it if anyone could give me some insight into what I'm doing wrong.
I have a PyQt app that is supposed to display a table of numbers. So, naturally, I am using QTableWidget. Right now, it's extremely simple: all I do is create a window with a Table Widget and a button...
I create this object when I want to create a QAction. I then add this QAction to a menu:
class ActionObject(object):
def __init__(self, owner, command):
action = QtGui.QAction(command.name, owner)
self.action = action
self.command = command
action.setShortcut(command.shortcut)
action.setStatusTip(command.name)
...
Hi everybody,
how can i set different margins for each QTextBlock in QTextEdit/QPlainTextEdit?
i tried to set it with following code:
class MyWidget(QPlainTextEdit):
def func(self):
block = self.firstVisibleBlock()
while block.isValid():
block = block.next()
block.blockFormat().setLeftMarg...
Hi!
I have a C++ application that loads externals plugins thanks to QPluginloader.
QPluginLoader provides access to a Qt plugin. A Qt plugin is stored in a shared library (a DLL).
The plugins have to inherit from a pure virtual class ( and Q_DECLARE_INTERFACE ) and QObject.
I would like to create plugins by using python and PyQt.
Is t...