Search Results

Search found 32 results on 2 pages for 'qtablewidget'.

Page 2/2 | < Previous Page | 1 2 

  • SetBackground and setForeGround not working in QTableWidgetItem

    - by liaK
    Hi I am using QTableWidget and QTableWidgetItem to populate QTableWidget. When i try to set the background and foreground for QTableWidgetItem, it's not displaying the set background and foreground colors. I am using Qt4.4 . My code looks like this lcurrentTableWidgetItem-setForeground(Qt::blue); lcurrentTableWidgetItem-setBackground(Qt::gray); Someone can help me with this.

    Read the article

  • Adding an inheritance to an Qt designed object

    - by Jaguar
    Hello, I have a problem and I want to implement the MVC pattern to my QT application, that's why I need for example to inherite in my QTableWidget about another class like myClass { myMethod(); } but our QTableWidget is contained by our Mainwidows that is designed by the QT designer and generate an ui_MainWindow class ! Do you know how to do that ? Is that a method inside the Qt Designer to do that ? or another method ? Thank you for your answer !

    Read the article

  • how to implement OOP using QT

    - by kaycee
    hi, this is a simple OOP QT question. my app consists of main window (QMainWindow) and a table (QTableWidget). in the main window i have arguments and variables which i would like to pass to the table class, and to access methods in main widnow class from the table class, how should i do it ? mainwindow.h class MainWindow : public QMainWindow { Q_OBJECT private: int a; int b; Spreadsheet *spreadsheet; public: void set_a(int); void set_b(int); spreadsheet.h class Spreadsheet : public QTableWidget { Q_OBJECT public: Spreadsheet(QWidget *parent = 0); atm i define Spreadsheet like this: spreadsheet = new Spreadsheet(this); and i'd like to access set_a() from spreadsheet.cpp...

    Read the article

  • adding a header to pyqt list

    - by Moayyad Yaghi
    hello i want to add a headers and index to a list in pyqt , it's really not important what list of QT (qlistwidget , qlistview , qtablewidget, qtreeview) in short .. i want something like the spin box delegate example in the pyqt demo ... but instead of the index in the column headers i want a strings ... hope the idea is clear enough thanx in advance

    Read the article

  • Custom editor in QAbstractTableModel

    - by Martin Beckett
    Does anyone have an example of using a QWidget as an editor in a QAbstractTableModel? I have a column which when edited should create a QCombobox with the list of choices. The docs seem to suggest I need to write a QAbstractItemDelegate and a custom paint function but that seems overkill to simply pop-up a standard QCombobox in Qt::EditRole. Note - the combo box contents are the same for every row and it only needs to be shown when somebody clicks in the cell. I know this should be simple but I can't get it to work. It's easy for a QTableWidget based table - but I need it for a very large data table.

    Read the article

  • Multiple Context menus in PyQt based on mouse location

    - by Nader
    I have a window with multiple tables using QTableWidget (PyQt). I created a popup menu using the right click mouse and it works fine. However, I need to create different popup menu based on which table the mouse is hovering over at the time the right mouse is clicked. How can I get the mouse to tell me which table it is hovering over? or, put in another way, how to implement a method so as to have a specific context menu based on mouse location? I am using Python and PyQt. My popup menu is developed similar to this code (PedroMorgan answer from Qt and context menu): class Foo( QtGui.QWidget ): def __init__(self): QtGui.QWidget.__init__(self, None) # Toolbar toolbar = QtGui.QToolBar() # Actions self.actionAdd = toolbar.addAction("New", self.on_action_add) self.actionEdit = toolbar.addAction("Edit", self.on_action_edit) self.actionDelete = toolbar.addAction("Delete", self.on_action_delete) # Tree self.tree = QtGui.QTreeView() self.tree.setContextMenuPolicy( Qt.CustomContextMenu ) self.connect(self.tree, QtCore.SIGNAL('customContextMenuRequested(const QPoint&)'), self.on_context_menu) # Popup Menu self.popMenu = QtGui.QMenu( self ) self.popMenu.addAction( self.actionEdit ) self.popMenu.addAction( self.actionDelete ) self.popMenu.addSeparator() self.popMenu.addAction( self.actionAdd ) def on_context_menu(self, point): self.popMenu.exec_( self.tree.mapToGlobal(point) )

    Read the article

  • Qt: Dragging a widget to scroll the widget's parent QScrollArea?

    - by samsonite
    I've got a long horizontal QLabel displaying a png (the image shows a signal/time graph). Under that, I've got a QTableWidget. Both of these are in a QScrollArea because I want them to stay vertically aligned (the cells in the table correspond with the signal seen directly above them). I'm trying to add a handler to the QLabel such that the user can use the picture itself to scroll the scrollarea, rather than having to use the scrollbar. Is there a tried-and-tested way to do this? Directly setting the scrollarea's sliderPosition inside the QLabel's dragMoveEvent doesn't seem smart, because when the scrollarea scrolls it also leads to another dragMoveEvent on the (moving) QLabel.

    Read the article

< Previous Page | 1 2