Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. item
    Log in to post

    • SOLVED TableView - Show an optional item covering the whole row of a multi-columns table view
      QML and Qt Quick • item paint event overlay item delegate table view • • jeanmilost  

      10
      0
      Votes
      10
      Posts
      171
      Views

      Thanks to all for the replies. I finally resolved the issue by replacing the TableView by a ListView and rewriting the columns handling manually. As the ListView draws the whole item content once, all the above mentioned issues are resolved at the same time. However very interesting concepts were presented here, and they may help me for other similar situations in the future. Once again, thank you very much to took the time to help me and reply to my questions.
    • UNSOLVED How to recognize padding for a QTableView table item?
      General and Desktop • qtreeview style item padding • • xintrea  

      2
      0
      Votes
      2
      Posts
      222
      Views

      @xintrea said in How to recognize padding for a QTableView table item?: not the default style. Only the stylesheet style provides a padding (see box model), all other styles don't have a 'padding' value at all. So what do you want exactly (and why)?
    • UNSOLVED Dynamically fit QComboBox popup height to the (dynamically changing) count of items
      General and Desktop • qcombobox resize qlistview item view • • AloyseTech  

      9
      0
      Votes
      9
      Posts
      1446
      Views

      @AloyseTech IIRC hidePop() will reset the Popupwidget, so maybe hijack the add/remove process. Call hidePopup before adding are removing item and call showPopup afterwards?
    • SOLVED How to measure time taken for QML item to appear on the screen since it was loaded?
      QML and Qt Quick • qml qtquick2 loader item time • • diredko  

      5
      0
      Votes
      5
      Posts
      627
      Views

      If you need this for just measuring the performance of your application, maybe you should use the QML Profiler instead http://doc.qt.io/qtcreator/creator-qml-performance-monitor.html
    • UNSOLVED Getting changed values of a QTablewidget into a QStringList
      General and Desktop • qtcreator qtablewidget item change • • Kushan  

      8
      0
      Votes
      8
      Posts
      3063
      Views

      This is strange. could you try if this snippet works for you? #include <QApplication> #include <QWidget> #include <QVBoxLayout> #include <QPushButton> #include <QTableWidget> #include <QLabel> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget mainWid; QStringList changedValues; QVBoxLayout* mainLay=new QVBoxLayout(&mainWid); QTableWidget* tableWidget = new QTableWidget(&mainWid); QPushButton* button = new QPushButton(QStringLiteral("Display list"),&mainWid); QLabel* resultLabel = new QLabel(&mainWid); mainLay->addWidget(tableWidget); mainLay->addWidget(button ); mainLay->addWidget(resultLabel ); tableWidget->setColumnCount(1); tableWidget->setRowCount(5); for(int i=0;i<5;i++){ QTableWidgetItem* const newItem= new QTableWidgetItem; newItem->setData(Qt::EditRole,i); tableWidget->setItem(i,0,newItem); } QObject::connect(tableWidget,&QTableWidget::cellChanged,[&changedValues,tableWidget](int row, int column)->void{changedValues<<tableWidget->item(row,column)->text();}); QObject::connect(button ,&QPushButton::clicked,[&changedValues,resultLabel ]()->void{resultLabel->setText(changedValues.join(','));}); mainWid.show(); return a.exec(); }
    • UNSOLVED Searching a QTable widget items using wild cards!
      General and Desktop • qtabwidget item search wildcards • • Lasith  

      3
      0
      Votes
      3
      Posts
      1394
      Views

      separate QTableWidget into a QTableView and a QStandardItemModel add a QSortFilterProxyModel as the model of QTableView and set the QStandardItemModel as the QSortFilterProxyModel's sourceModel call QSortFilterProxyModel::setFilterWildcard or QSortFilterProxyModel::setFilterRegExp to perform the searching See Basic Sort/Filter Model Example
    • SOLVED "The program has unexpectedly finished unexpectedly" in qt c++
      General and Desktop • error qtablewidget item search • • Lasith  

      3
      0
      Votes
      3
      Posts
      1851
      Views

      @Lasith Instead of 100 use ui->tableWidget->rowCount().
    • SOLVED QListView item font StyleSheet not working.
      General and Desktop • qlistview font item styesheet • • IL  

      5
      0
      Votes
      5
      Posts
      5045
      Views

      @raven-worx Thanks bro, very helpfull.
    • UNSOLVED Select Line items easier
      General and Desktop • item scene line • • AlvaroS  

      2
      0
      Votes
      2
      Posts
      488
      Views

      Edit: I have checked that if coordinates are [0.3 0.5 0.3 0.9] and I set pen.widthf bigger, then I can select much better the lines, but if the coordinates are [30 50 30 90] that does not work...
    • SOLVED Displaying an integer in tableView
      General and Desktop • tableview item • • gabor53  

      4
      0
      Votes
      4
      Posts
      1648
      Views

      Thank you. It worked.
    • UNSOLVED Access items in Grid from C++ code
      QML and Qt Quick • c++ item grid repeater access • • diredko  

      3
      0
      Votes
      3
      Posts
      987
      Views

      Thanks for your reply.
    • SOLVED how to remove Item in Qtablewidget?
      General and Desktop • qtablewidget memory item delete free • • ForestPoem  

      6
      0
      Votes
      6
      Posts
      5563
      Views

      Using setText will avoid useless delete/allocation of items.
    • UNSOLVED how to remove Item in Qtablewidget?
      General and Desktop • qtablewidget item delete • • ForestPoem  

      3
      0
      Votes
      3
      Posts
      1469
      Views

      When you set the item, The table takes ownership of the item. So just deleting the tableWidget should satisfy. If you want to selectively delete, what you are doing should be good enough.
    • UNSOLVED Listview delegate: Loader.setSource() not working
      QML and Qt Quick • listview delegate loader item • • kylecorver  

      6
      0
      Votes
      6
      Posts
      2968
      Views

      @kylecorver Can you post the complete program? The original isn't a a valid Qml document, leading to guessing about which errors will or will not occur. The OS and Qt version used might also be relevant.
    • connecting string item of qlistwidget to my class
      General and Desktop • qlistwidget connect item qt5.5.0 • • Lorence  

      2
      0
      Votes
      2
      Posts
      1219
      Views

      @Lorence said: Hi when you add "xxxx" to a qlistwidget you are adding a QListWidgetItem. While you can subclass QListWidgetItem and make your own that has signals, it would not do you so much good as it would never never emit such signal unless you also made it do so when something happen to it. (overriding some of its functions) So It all depends what you are trying to do. If you just want to know its no 1,2,3 etc, even if moved then you can insert that info into the QListWidgetItem using the void QListWidgetItem::setData(int role, const QVariant & value) something like QListWidgetItem * item=new QListWidgetItem("item1") ; item->setData(Qt::UserRole, 1); // or 2 for item 2 etc list->addItem(item) then you can always know which is which even if rearranged. see here for how to take index out also http://stackoverflow.com/questions/7136818/can-i-store-some-user-data-in-every-item-of-a-qlistwidget
    • [Solved]How to focus on the last item of the and then come to the top item one by on using TAB key and UP-ARROW key?
      Mobile and Embedded • linux qlistwidget focus selection item qt5.2.1 • • Ajith_P_V  

      4
      0
      Votes
      4
      Posts
      3580
      Views

      @SGaist Thank you dude, setCurrentRow is what I want!
    • Automatically highlight the first row of Qtreewidget?
      General and Desktop • c++ linux qtreewidget item row highlight • • marlenet15  

      2
      0
      Votes
      2
      Posts
      1341
      Views

      Hi, You are looking for QTreeWidget::setCurrentItem
    • Using QComboBox with QSqlQueryModel
      General and Desktop • c++ qt4 qcombobox model-view item qsqlquerymodel data • • Aleksey_K  

      2
      0
      Votes
      2
      Posts
      1775
      Views

      Yeah, according to QComboBox code should work: QVariant QComboBox::itemData(int index, int role) const { Q_D(const QComboBox); QModelIndex mi = d->model->index(index, d->modelColumn, d->root); return d->model->data(mi, role); } Will implement this.
    • items() and itemsAt() do not return correct item position
      General and Desktop • qgraphicsview qgraphicsscene item position items itemat • • alogim  

      6
      0
      Votes
      6
      Posts
      4175
      Views

      I do not understand last question. I do not see any problem with mapping which rely on the item bounding rectangle. You can have an infinite number of visually the same graphics items if you use different combination of position and bounding box parameters. For example if you create QGraphicsEllipseItem using following rectangle/position pairs you will get the same result on the screen? pair 1: QRectF rect1( 0, 0, 1., 2 ); QPointF pos1(10.,20.); pair 2: QRectF rect1( 10,20, 1., 2 ); QPointF pos1(0.,0.); Which way to define depends on your needs.
    • Forced update the properties of qml item
      QML and Qt Quick • qml qt quick update item property forced update • • Lix_  

      5
      0
      Votes
      5
      Posts
      1684
      Views

      @p3c0 Thanks!
    • [SOLVED ]Cant access alias from Item
      QML and Qt Quick • qt quick item alias • • guidupas  

      14
      0
      Votes
      14
      Posts
      8519
      Views

      @guidupas You're Welcome :) Use ``` (3 backticks) instead of [Code] when posting code here. It follows markdown language syntax. I'll edit it for now.
    • How to check if a item is currently visible on screen?
      QML and Qt Quick • item visibility • • Frime  

      5
      0
      Votes
      5
      Posts
      4121
      Views

      Hi @Jean, yes, you're right. But in my case this is unfortunately not possible. What I am doing is developing a Toolkit with a bunch of Controls for displaying data. These controls are not used by me (even not used by really developers) but used by people who are configuring the UI pages via drag and drop in the Quick Designer. This is why the logic should be encapsulated within the control... Thanks again! Cheers, Frime
    • Skew Item (Image)
      QML and Qt Quick • image item transform skew • • h00bs  

      2
      0
      Votes
      2
      Posts
      914
      Views

      Hi, I think you can do something using SharedEffect::vertexShader. I'm not an expert but you can find some information and examples here