[profitpy commit] r324 - in trunk: . profit/lib profit/lib/widgets profit/models profit/workbench profit/workbench/...

1 view
Skip to first unread message

codesite...@google.com

unread,
Aug 3, 2008, 5:22:23 AM8/3/08
to profitp...@googlegroups.com
Author: troy.melhase
Date: Sun Aug 3 02:21:58 2008
New Revision: 324

Modified:
trunk/README
trunk/profit/lib/__init__.py
trunk/profit/lib/gui.py
trunk/profit/lib/widgets/tickfieldselect.py
trunk/profit/models/tickers.py
trunk/profit/workbench/sessiontree.py
trunk/profit/workbench/tickerdisplay.py
trunk/profit/workbench/widgets/ui_tickerdisplay.ui

Log:
Ticker display based on abstract item model.

Modified: trunk/README
==============================================================================
--- trunk/README (original)
+++ trunk/README Sun Aug 3 02:21:58 2008
@@ -2,19 +2,23 @@

micro:

+1. covert standard item models to profit.models.BasicItemModel where
+ possible; remove all session.maps objects and references.
+
2. clean up signals and slots where possible

-3. fix method request/tickerId/contract handling. allow for display
- of tickerIds with symbol. extend tickers display with contract
- details.
+3. fix method request/tickerId/contract handling.
+
+4. extend tickers display with contract details.
+

macro:

-4. add viewable historical data requests and plots
+1. add viewable historical data requests and plots

-5. finish strategy design tool and its integration with the workbench
+2. finish strategy design tool and its integration with the workbench

-7. write the README (this file) and release the code
+3. write the README (this file) and release the code


== 0.3 and Beyond ==
@@ -27,7 +31,7 @@

4. add peer-to-peer discovery and trade data exchange

-6. finish neural network design tool and its integration
+5. finish neural network design tool and its integration


Model Usage Survey
@@ -56,12 +60,6 @@
> adds message index to local list (called "messageIndexes")
ExecutionsDisplay

-
-orderdisplay.py
- OrderDisplay(QFrame)
- orderView -> session.models.orders
-
-
plotdatadialog.py
CurveDataTableModel(QAbstractTableModel)

@@ -69,7 +67,6 @@
PortfolioDisplay ->
on_session_UpdatePortfolio -> updates self.portfolioTable

-
sessiontree.py
SessionTreeModel(QStandardItemModel)
on_strategy_createdTicker
@@ -88,15 +85,3 @@
self.on_strategyTable_selectionChanged)
connect(self, Signals.strategy.requestActivate,
instance(), Signals.strategy.requestActivate)
-
-tickerdisplay.py
- TickerDisplay(QFrame)
- connect(self, Signals.openUrl, app, Signals.openUrl)
- connect(self, Signals.tickerClicked, app, Signals.tickerClicked)
-
- on_session_UpdatePortfolio
- on_session_TickPrice_TickSize
-
-
-
-

Modified: trunk/profit/lib/__init__.py
==============================================================================
--- trunk/profit/lib/__init__.py (original)
+++ trunk/profit/lib/__init__.py Sun Aug 3 02:21:58 2008
@@ -108,6 +108,7 @@
textChangedEditor = SIGNAL('textChanged()')
tickerClicked = SIGNAL('tickerClicked')
timeout = SIGNAL('timeout()')
+ toggled = SIGNAL('toggled(bool)')
trayIconActivated = SIGNAL('activated(QSystemTrayIcon::ActivationReason)')
triggered = SIGNAL('triggered()')
triggeredBool = SIGNAL('triggered(bool)')

Modified: trunk/profit/lib/gui.py
==============================================================================
--- trunk/profit/lib/gui.py (original)
+++ trunk/profit/lib/gui.py Sun Aug 3 02:21:58 2008
@@ -136,9 +136,10 @@

@classmethod
def setColors(cls, increase, neutral, decrease):
- cls.increase = QBrush(increase)
- cls.neutral = QBrush(neutral)
- cls.decrease = QBrush(decrease)
+ compMap = cls.compMap
+ cls.increase = compMap[1] = QBrush(increase)
+ cls.neutral = compMap[0] = QBrush(neutral)
+ cls.decrease = compMap[-1] = QBrush(decrease)


class ValueTableItem(QTableWidgetItem, ValueColorItem):

Modified: trunk/profit/lib/widgets/tickfieldselect.py
==============================================================================
--- trunk/profit/lib/widgets/tickfieldselect.py (original)
+++ trunk/profit/lib/widgets/tickfieldselect.py Sun Aug 3 02:21:58 2008
@@ -5,10 +5,8 @@
# Distributed under the terms of the GNU General Public License v2

from re import split as rxsplit
-
from PyQt4.QtCore import Qt, QVariant, pyqtSignature
from PyQt4.QtGui import QFrame, QStandardItem
-
from ib.ext.TickType import TickType
from profit.lib import DataRoles
from profit.lib.widgets.ui_tickfieldselect import Ui_TickFieldSelect

Modified: trunk/profit/models/tickers.py
==============================================================================
--- trunk/profit/models/tickers.py (original)
+++ trunk/profit/models/tickers.py Sun Aug 3 02:21:58 2008
@@ -4,7 +4,9 @@
# Copyright 2007 Troy Melhase <tr...@gci.net>
# Distributed under the terms of the GNU General Public License v2

+from re import split as rxsplit
from PyQt4.QtCore import Qt, QModelIndex, QObject, QVariant, QString
+from ib.ext.TickType import TickType
from profit.lib import valueAlign
from profit.models import BasicItem, BasicItemModel

@@ -14,56 +16,159 @@

"""
def __init__(self, session=None, parent=None):
+ """ Initializer.
+
+ @param session=None session instance
+ @param parent ancestor of this widget
+ """
BasicItemModel.__init__(self, TickersRootItem(), parent)
- self.symbolIcon = lambda x:None
+ self.symbolIcon = lambda x:''
+ self.valueBrushMap = {}
+ self.tickerIdItemMap = {}
self.session = session
if session is not None:
session.registerMeta(self)

- def data(self, index, role):
+ def columnLabels(self):
+ """ Convienence function for clients. Unused internally.
+
+ """
+ return [s['title']for s in self.invisibleRootItem.columnLookups]
+
+ def data(self, index, role=Qt.DecorationRole):
+ """ Framework hook to retrieve information from this model.
+
+ @param index QModelIndex instance
+ @param role=Qt.DecorationRole
+ @return QVariant of some kind
+ """
if not index.isValid():
return QVariant()
item = index.internalPointer()
column = index.column()
data = QVariant()
- if role in (Qt.DecorationRole, Qt.ToolTipRole):
- data = QVariant(item[column])
+ tickerId = item[0]
+ if role == Qt.DisplayRole:
+ if column == 1:
+ data = QVariant(self.symbolName(tickerId))
+ else:
+ data = QVariant(item.data[column])
+ elif role == Qt.DecorationRole and column == 1:
+ data = QVariant(self.symbolIcon(self.symbolName(tickerId)))
+ elif role == Qt.ForegroundRole:
+ if column not in (0, 1):
+ brush = self.valueBrushMap.get(item.lastCmp(column), None)
+ data = QVariant(brush)
+ elif role == Qt.TextAlignmentRole:
+ try:
+ float(item[column])
+ data = QVariant(valueAlign)
+ except (ValueError, TypeError, ):
+ pass
return data

- def findContract(self, contract):
- pass
-
def findTicker(self, tickerId):
- tickerItems = self.invisibleRootItem.children
- try:
- return [item for item in tickerItems if item[0]==tickerId][0]
- except (IndexError, ):
- pass
+ """ Locates the TickerItem for the given id or None.
+
+ """
+ return self.tickerIdItemMap.get(tickerId, None)

def on_session_TickPrice_TickSize(self, message):
+ """ Called with new ticker size or price.
+
+ @param message ib package message instance
+ """
tickerId = message.tickerId
item = self.findTicker(tickerId)
if item:
item.update(message)
else:
root = self.invisibleRootItem
- root.append(TickersItem.fromMessage(message, root))
- print '####', len(root.data), [i.toString() for i in root.data]
+ item = TickersItem.fromMessage(message, root)
+ self.tickerIdItemMap[tickerId] = item
+ root.append(item)
+ ## yuk; should emit a signal
self.reset()

+ def symbolName(self, tickerId):
+ """ Returns the symbol name given a ticker id.
+
+ This should reference self.session.models.contracts instead.
+ """
+ symbols = self.session.strategy.symbols()
+ try:
+ return dict([(b, a) for a, b in
symbols.items()])[tickerId] or ''
+ except (KeyError, ):
+ return ''
+
+
+class ExtraFields(object):
+ """ Namespace for our 'extra' fields, i.e., fields not in TickType.
+
+ The extra fields are all negative so as to not conflict with those
+ in TickType.
+ """
+ tid, sym, pos, val = enum = range(-4, 0)
+ labels = ['id', 'symbol', 'position', 'value']
+ all = zip(enum, labels)
+
+
+def extraFieldSpecs():
+ """ Generates sequence of dictionaries that describe our extra fields.
+
+ """
+ for field, label in ExtraFields.all:
+ yield dict(value=field, title=label.title())
+
+
+def fieldSpecs(maxValue=10):
+ """ Yields one description dictionary for every TickType field.
+
+ """
+ values = [getattr(TickType, k) for k in dir(TickType)]
+ for value in [v for v in values if isinstance(v, int) and v < maxValue]:
+ title = tickFieldTitle(TickType.getField(value))
+ yield dict(value=value, title=title)
+
+
+def tickFieldTitle(name):
+ """ Make title from name, aka UnCapCase.
+
+ """
+ words = rxsplit('([A-Z0-9][a-z]+)', name)
+ ## my rx fu isn't great enough. special case for when the split
+ ## does not work, e.g., bidEFP.
+ if len(words) == 1:
+ words = rxsplit('([a-z]+)', name)
+ ## title case each word in the word list if the word isn't already
+ ## all upper case.
+ words = [(w if w.upper()==w else w.title()) for w in words if w]
+ return str.join(' ', words)
+

class TickersItem(BasicItem):
- columnLookups = [
- ('Ticker Id', lambda msg:msg.tickerId),
- ('Field', lambda msg:msg.field),
- ('Price', lambda msg:msg.price),
- ('Size', lambda msg:msg.size),
- ('Can Auto Execute', lambda msg: msg.canAutoExecute),
- ]
+ """ Items for the tickers model.
+
+ """
+ columnLookups = list(extraFieldSpecs()) + list(fieldSpecs())
+ valueLookups = {
+ ExtraFields.tid : lambda m:m.tickerId,
+ ## tie value lookups to the portfolio model ????
+ ExtraFields.sym : lambda m:None,
+ ExtraFields.pos : lambda m:None,
+ ExtraFields.val : lambda m:None,
+ }

def __init__(self, data, parent=None, message=None):
+ """ Initializer.
+
+ @param data mutable sequence with some values
+ @param parent=None parent item
+ @param message=None ib package message instance
+ """
BasicItem.__init__(self, data, parent)
self.message = message
+ self.previousValues = {}

@classmethod
def fromMessage(cls, message, parent):
@@ -75,25 +180,36 @@
@return new instance of cls
"""
values = []
- for label, lookup in cls.columnLookups:
- try:
- value = lookup(message)
- except (AttributeError, ):
- value = 0
- values.append(value)
+ valueLookups = cls.valueLookups
+ field = message.field
+ def default(m):
+ if m.field==field:
+ return (m.price if hasattr(m, 'price') else m.size)
+ for spec in cls.columnLookups:
+ lookup = valueLookups.get(spec['value'], default)
+ values.append(lookup(message))
return cls(values, parent, message)

+ def lastCmp(self, col):
+ """ Compare current value at column with its previous.
+
+ """
+ return cmp(self[col], self.previousValues.get(col, self[col]))
+
def update(self, message):
""" Update the item with values from a message.

@param message ib.opt.message object
@return None
"""
- for column, (label, lookup) in enumerate(self.columnLookups):
- try:
- self[column] = lookup(message)
- except (AttributeError, ):
- pass
+ field = message.field
+ value = message.price if hasattr(message, 'price') else message.size
+ for column, spec in enumerate(self.columnLookups):
+ if spec['value'] == field:
+ self.previousValues[column] = self[column]
+ self[column] = value
+ break
+

class TickersRootItem(TickersItem):
""" Tickers model item with automatic values (for horizontal headers).
@@ -106,4 +222,4 @@
""" Generates list of horizontal header values.

"""
- return map(QVariant, [label for label, lookup in self.columnLookups])
+ return map(QVariant, [spec['title'] for spec in self.columnLookups])

Modified: trunk/profit/workbench/sessiontree.py
==============================================================================
--- trunk/profit/workbench/sessiontree.py (original)
+++ trunk/profit/workbench/sessiontree.py Sun Aug 3 02:21:58 2008
@@ -185,7 +185,7 @@
tickers.appendRow(item)

def on_session_createdTicker(self, tickerId, tickerData):
- print '## new session tree ticker', tickerId, tickerData
+ ##print '## new session tree ticker', tickerId, tickerData
if 0:
call = self.itemMakers.get(key, mkItem)
for subkey, subval in sorted(values.items()):

Modified: trunk/profit/workbench/tickerdisplay.py
==============================================================================
--- trunk/profit/workbench/tickerdisplay.py (original)
+++ trunk/profit/workbench/tickerdisplay.py Sun Aug 3 02:21:58 2008
@@ -4,6 +4,8 @@
# Copyright 2007 Troy Melhase <tr...@gci.net>
# Distributed under the terms of the GNU General Public License v2

+## TODO: more clean up, filter model, save/restore selected cols
+
from functools import partial
from itertools import ifilter
from string import Template
@@ -13,49 +15,12 @@

from ib.opt.message import TickPrice

-from profit.lib import (
- BasicHandler, DataRoles, Signals, defaults, instance,
makeCheckNames, )
+from profit.lib import BasicHandler, Signals, defaults, instance
from profit.lib.gui import (
- UrlRequestor, ValueTableItem, separator, makeUrlAction,
symbolIcon, )
-from profit.lib.widgets.tickfieldselect import (
- ExField, fieldIds, itemTickField, setItemTickField, )
-
-#from profit.workbench.portfoliodisplay import replayPortfolio
+ UrlRequestor, ValueColorItem, separator, makeUrlAction,
symbolIcon, )
from profit.workbench.widgets.ui_tickerdisplay import Ui_TickerDisplay


-def replayTickerMessages(messages, symbols, callback):
- """ Invokes callback with the last message for every symbol and field
-
- @param messages session message sequence
- @param symbols mapping of symbol:tickerIds
- @param callback function to call with replayed messages
- @return None
- """
- isMsg = makeCheckNames('TickSize', 'TickPrice')
- for symbol, tickerId in symbols.items():
- for field in fieldIds():
- def pred((t, m)):
- return isMsg(m) and m.field==field and m.tickerId==tickerId
- for time, message in ifilter(pred, reversed(messages)):
- callback(message, replay=True)
- break
-
-
-def fakeTickerMessages(tickerId):
- """ Generates fake TickPrice messages for every ticker field
-
- @param tickerId ticker id
- @return None
- """
- tick = partial(TickPrice, tickerId=tickerId, price=0, canAutoExecute=False)
- for field in fieldIds():
- yield tick(field=field)
-
-
-valueCache = {}
-
-
class TickerDisplay(QFrame, Ui_TickerDisplay, BasicHandler, UrlRequestor):
""" TickerDisplay -> shows ticker data in a nice table.

@@ -68,13 +33,6 @@
"""
QFrame.__init__(self, parent)
self.setupUi(self)
- self.tickerIds = {}
- self.extraFieldItemSetups = {
- ExField.tid : self.setIdItem,
- ExField.sym : self.setSymbolItem,
- ExField.pos : self.setPositionItem,
- ExField.val : self.setPositionValueItem,
- }
self.setupWidgets()
self.requestSession()

@@ -86,16 +44,12 @@
settings.beginGroup(self.__class__.__name__)
defaultFields = defaults.tickerDisplayFields()
userFields = settings.valueLoad('selectedFields', defaultFields)
- self.tickFieldSelect.setCheckedFields(userFields)
- defaultState = defaults.rightSplitterState()
- splitState = settings.value(settings.keys.splitstate, defaultState)
- self.splitter.restoreState(splitState.toByteArray())
+ #self.tickFieldSelect.setCheckedFields(userFields)
settings.endGroup()
app = instance()
connect = self.connect
connect(self, Signals.openUrl, app, Signals.openUrl)
connect(self, Signals.tickerClicked, app, Signals.tickerClicked)
- self.tickerTable.verticalHeader().hide()

def setSession(self, session):
""" Configures this instance for a session.
@@ -104,20 +58,33 @@
@return None
"""
self.session = session
+ connect = self.connect
model = session.models.tickers
model.symbolIcon = symbolIcon
- #self.connect(model, Signals.modelReset, self.resizeTree)
- self.tickersView.setModel(model)
-
- symbols = session.strategy.symbols()
- #replayTickerMessages(session.messages, symbols,
- # self.on_session_TickPrice_TickSize)
- #replayPortfolio(session.messages, self.on_session_UpdatePortfolio)
+ model.valueBrushMap = ValueColorItem.compMap
+ view = self.tickersView
+ view.setModel(model)
+ header = view.header()
+ header.setContextMenuPolicy(Qt.ActionsContextMenu)
+ def makeActions():
+ for col, title in enumerate(model.columnLabels()):
+ action = QAction(title, header)
+ action.setCheckable(True)
+ action.setChecked(Qt.Checked)
+ handler = partial(self.setTickersColumnEnabled, column=col)
+ connect(action, Signals.toggled, handler)
+ header.setResizeMode(col, header.Stretch)
+ yield action
+ header.addActions(list(makeActions()))
session.registerMeta(self)
-# if not session.messages:
-# for tickerId in symbols.values():
-# for msg in fakeTickerMessages(tickerId):
-# self.on_session_TickPrice_TickSize(msg)
+
+ def setTickersColumnEnabled(self, enable, column):
+ """
+
+ """
+ view = self.tickersView
+ call = (view.showColumn if enable else view.hideColumn)
+ call(column)

def basicActions(self, index):
""" Creates action and separator list suitable for a context menu.
@@ -152,6 +119,7 @@
@param row ticker table row number
@return close action connected to close method, or None
"""
+ return
act = None
index = self.tickerTable.model().index(row, 1)
if index and index.isValid():
@@ -164,90 +132,6 @@
self.connect(act, Signals.triggered, self.closePosition)
return act

- def fieldColumn(self, field, default=None):
- """ Returns the ticker table column number for the given field.
-
- This method could move to a TickerTable(QTableWidget) class.
-
- @param field TickType field
- @param default=None value returned if column not found
- """
- table = self.tickerTable
- for col in range(table.columnCount()):
- if field == itemTickField(table.horizontalHeaderItem(col)):
- return col
- return default
-
- def makeTickerColumn(self, field, label):
- """ Constructs a new column and a header for the ticker table.
-
- @param field TickType field
- @param label header label
- @return new column number
- """
- table = self.tickerTable
- column = table.columnCount()
- table.insertColumn(column)
- header = ValueTableItem()
- header.setText(label)
- setItemTickField(header, field)
- table.setHorizontalHeaderItem(column, header)
- return column
-
- def makeTickerColumnItems(self, column):
- """ Creates ticker table items for (new) column.
-
- @param column table column
- @return None
- """
- table = self.tickerTable
- for row in range(table.rowCount()):
- item = ValueTableItem()
- item.setValueAlign()
- table.setItem(row, column, item)
-
- def setupFieldColumn(self, field, column):
- """ Configures column items as much as possible.
-
- This method maps existing ticker fields to items at the given
- column. We don't mix this behavior with the column
- construction (makeTickerColumnItems) because that would muddle the
- behavior.
-
- @param field TickType field
- @param column table column
- @return None
- """
- extraFieldItemSetups = self.extraFieldItemSetups
- tickerTable = self.tickerTable
- for tickerId, row in self.tickerIds.items():
- item = tickerTable.item(row, column)
- if item:
- if field in extraFieldItemSetups:
- extraFieldItemSetups[field](item, tickerId)
- else:
- value = valueCache.get(tickerId, {}).get(field, '')
- item.setValue(value)
-
- def makeTickerRow(self, tickerId):
- """ Creates a ticker table row for the given tickerId.
-
- @param tickerId yes, that
- @return id of new row
-
- """
- table = self.tickerTable
- items = table.newItemsRow()
- extraFieldItemSetups = self.extraFieldItemSetups
- for col, item in enumerate(items):
- item.setValueAlign()
- field = itemTickField(table.horizontalHeaderItem(col))
- if field in extraFieldItemSetups:
- extraFieldItemSetups[field](item, tickerId)
- table.resizeColumnsToContents()
- table.resizeRowsToContents()
- return table.rowCount()
-
@pyqtSignature('')
def on_actionChart_triggered(self):
""" Emits a signal for a ticker chart.
@@ -270,82 +154,7 @@
"""
print '## order for ', self.actionOrder.data().toString()

- def on_fieldsList_itemChanged(self, item):
- """ Add/drop a column when a field is checked/unchecked.
-
- """
- table = self.tickerTable
- field = itemTickField(item)
- if item.checkState():
- col = self.makeTickerColumn(field, item.text())
- self.makeTickerColumnItems(col)
- self.setupFieldColumn(field, col)
- table.resizeColumnToContents(col)
- else:
- table.removeColumn(self.fieldColumn(field))
- self.saveFieldSelections()
-
- def on_session_UpdatePortfolio(self, message):
- """ Updates the position and market value columns in the
ticker table.
-
- """
-
- ## TODO: fix references, i.e., make contract lookup precise,
- ## and also locate column by contract (or
- ## by message.contract symbol+secType+expiry+etc)
-
- sym = message.contract.m_symbol
- symbols = self.session.strategy.symbols()
- try:
- tid = symbols[sym]
- row = self.tickerIds[tid]
- except (KeyError, ):
- return
- items = ((ExField.val, message.marketValue),
- (ExField.pos, message.position),
- )
- table = self.tickerTable
- for field, value in items:
- col = self.fieldColumn(field)
- if col is not None:
- item = table.item(row, col)
- if item:
- item.setValue(value)
-
- def on_session_TickPrice_TickSize(self, message):
- """ Updates size and price columns in the ticker table.
- Creates rows as needed.
-
- """
- field = message.field
- value = (message.price if hasattr(message, 'price') else message.size)
- tickerTable = self.tickerTable
- tickerId = message.tickerId
- valueCache.setdefault(tickerId, {})[field] = value
- col = self.fieldColumn(field)
- if col is None:
- return
- try:
- row = self.tickerIds[tickerId]
- except (KeyError, ):
- row = self.tickerIds[tickerId] = self.makeTickerRow(tickerId)
- item = tickerTable.item(row, col)
- if item:
- item.setValue(value)
-
- def on_splitter_splitterMoved(self, pos, index):
- """ Signal handler for splitter move; saves state to user settings.
-
- @param pos ignored
- @param index ignored
- @return None
- """
- settings = self.settings
- settings.beginGroup(self.__class__.__name__)
- settings.setValue(settings.keys.splitstate, self.splitter.saveState())
- settings.endGroup()
-
- def on_tickerTable_customContextMenuRequested(self, pos):
+ def fixme__on_tickerTable_customContextMenuRequested(self, pos):
""" Display a context menu over the ticker table.

"""
@@ -362,7 +171,7 @@
actions.extend(self.urlActions(index.data().toString()))
QMenu.exec_(actions, table.viewport().mapToGlobal(pos))

- def on_tickerTable_doubleClicked(self, index):
+ def fixme__on_tickerTable_doubleClicked(self, index):
""" Emits an item from the ticker table as a signal argument.

"""
@@ -391,7 +200,8 @@
settings = self.settings
settings.beginGroup(self.__class__.__name__)
userItems = self.tickFieldSelect.checkedItems()
- saveFields = [itemTickField(i) for i in userItems]
+ #saveFields = [itemTickField(i) for i in userItems]
+ saveFields = []
settings.setValueDump('selectedFields', saveFields)
settings.endGroup()

@@ -416,35 +226,3 @@
self.connect(act, Signals.triggered, request)
actions.append(act)
return actions
-
- ## table item setter-uppers
-
- def setIdItem(self, item, tickerId):
- """ Configures an item for the 'Id' column.
-
- """
- item.setText(tickerId)
- item.setValueAlign(Qt.AlignLeft|Qt.AlignVCenter)
-
- def setSymbolItem(self, item, tickerId):
- """ Configures an item for the 'Symbol' column.
-
- """
- symbols = self.session.strategy.symbols()
- try:
- sym = dict([(b, a) for a, b in symbols.items()])[tickerId]
- except (KeyError, ):
- pass
- else:
- item.setSymbol(sym)
- item.setValueAlign(Qt.AlignLeft|Qt.AlignVCenter)
-
- def setPositionItem(self, item, tickerId):
- """ Configures an item for the 'Position' column.
-
- """
-
- def setPositionValueItem(self, item, tickerId):
- """ Configures an item for the 'Value' column.
-
- """

Modified: trunk/profit/workbench/widgets/ui_tickerdisplay.ui
==============================================================================
--- trunk/profit/workbench/widgets/ui_tickerdisplay.ui (original)
+++ trunk/profit/workbench/widgets/ui_tickerdisplay.ui Sun Aug 3
02:21:58 2008
@@ -5,61 +5,65 @@
<rect>
<x>0</x>
<y>0</y>
- <width>578</width>
- <height>404</height>
+ <width>645</width>
+ <height>558</height>
</rect>
</property>
<property name="windowTitle" >
<string>Ticker Display</string>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout" >
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
<item>
- <widget class="QSplitter" name="splitter" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
+ <widget class="QFrame" name="frame" >
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
</property>
- <widget class="TickFieldSelect" native="1" name="tickFieldSelect" />
- <widget class="QFrame" name="frame" >
- <property name="frameShape" >
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout" >
- <item>
- <widget class="FilterBar" native="1" name="filterBar" />
- </item>
- <item>
- <widget class="LocalTable" name="tickerTable" >
- <property name="contextMenuPolicy" >
- <enum>Qt::CustomContextMenu</enum>
- </property>
- <property name="frameShape" >
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Plain</enum>
- </property>
- <property name="alternatingRowColors" >
- <bool>true</bool>
- </property>
- <property name="selectionMode" >
- <enum>QAbstractItemView::SingleSelection</enum>
- </property>
- <property name="showGrid" >
- <bool>true</bool>
- </property>
- <property name="gridStyle" >
- <enum>Qt::DotLine</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTreeView" name="tickersView" />
- </item>
- </layout>
- </widget>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="FilterBar" native="1" name="filterBar" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTreeView" name="tickersView" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>3</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="editTriggers" >
+ <set>QAbstractItemView::NoEditTriggers</set>
+ </property>
+ <property name="showDropIndicator" stdset="0" >
+ <bool>false</bool>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectItems</enum>
+ </property>
+ <property name="rootIsDecorated" >
+ <bool>false</bool>
+ </property>
+ <property name="itemsExpandable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
</layout>
@@ -87,17 +91,6 @@
<class>FilterBar</class>
<extends>QWidget</extends>
<header location="global" >profit.lib.widgets.filterbar.h</header>
- </customwidget>
- <customwidget>
- <class>LocalTable</class>
- <extends>QTableWidget</extends>
- <header location="global" >profit.lib.widgets.localtable.h</header>
- </customwidget>
- <customwidget>
- <class>TickFieldSelect</class>
- <extends>QWidget</extends>
- <header location="global" >profit.lib.widgets.tickfieldselect</header>
- <container>1</container>
</customwidget>
</customwidgets>
<resources/>

Reply all
Reply to author
Forward
0 new messages