跳到內容
  • 143k 主題
    719k 貼文
    jeremy_kJ
    @mjiggidyj said in QStyledItemDelegate doesn't move with its QTreeView column: In my QAbstractItemModel, I insert headers to the front of a list (basically self._headers.insert(0,headerdata) each time). In my QTreeView, I connect self.model().columnsInserted.connect(self._assignDelegates). In _assignDelegates(), I loop over the range of logical columns provided by the signal, and based on whatever the particular column is, I call self.setItemDelegateForColumn(col, delegate). (In my troubleshooting I've also tried converting the column index to visual via self.header().visualIndex(col), but this doesn't fix it.) This would be a lot easier to follow with a minimal working example, with emphasis on both minimal, and working to demonstrate the issue. So at this point, the first column of my QTreeView has the delegate assigned. But as soon as the next column is inserted, I would expect the existing delegate to shift down with its existing column. But instead, it seems that it "sticks" with visual column 0. So I'm essentially just always swapping out the delegate on visual column 0 over and over. But then also, if I drag around a column header to visually rearrange the column order in the QTreeView, the delegate follows correctly. So, geez, pick a behavior. I don't see an inconsistency. When a delegate for a column is assigned, the column number refers to the column returned by QModelIndex::column() at the time the delegate is drawn. Inserting a column before a particular item means that the index for that item will have a new column number. The model has been altered, and delegates are used by the view to render the model as it is, not as it was in the past. Dragging the columns in a view around will not result in a new column, because the underlying model hasn't changed. What's the best way of solving this? Best I can think of is re-applying all delegates to every column every time any columns are inserted or moved in the model. But that's ridiculously inefficient IMO. I don't understand what this is. My first thought is to suggest one or more of: a proxy model to maintain the logical column concept restructuring the model population waiting for model population to complete before assignment of delegates, or even the view Perhaps code, images, or a reference to software implementing the desired interface will help.
  • Jobs, project showcases, announcements - anything that isn't directly development
    4k 23k
    4k 主題
    23k 貼文
    FeRDNYCF
    @Pedro said in Forum Updated NodeBB v4.3 + New features: Profile View Now you get a profilecard snippet by hovering over a user's name/picture. * Only if logged in. (Which probably makes sense, but I just thought I'd point it out. ....After logging in to get the feature working.)
  • Everything related to designing and design tools

    129 391
    129 主題
    391 貼文
    J
    In QT Design Studio, Tab Buttons are mostly for navigation within the UI, but each tab doesn’t automatically hide other content. Usually, a StackView or Loader is needed to switch visible content depending on the active tab.
  • Everything related to the QA Tools

    81 219
    81 主題
    219 貼文
    H
    @IamSumit can you reproduce the issue and share the Support Information logs. Please refer to the following Knowledge Base Article regarding how to obtain the Support Information is https://qatools.knowledgebase.qt.io/misc/collecting-support-info/collecting-support-information-linux-mac-windows/
  • Everything related to learning Qt.

    389 2k
    389 主題
    2k 貼文
    L
    [image: 81cdd613-e1dc-4336-8d29-6b627547d990.png] Shouldn't the padding area be between the red Background and the blue Content item? Why does it here refer to the distance directly from the outside to the content area? Is this correct? Or is my understanding correct? Inset is the distance between a component and the outside, while padding is the distance between the Background and the Content item. I really don't understand this picture; it confuses me.
  • 2k 主題
    13k 貼文
    T
    In qnamespace.h, I add some key_code mappings : For example : enum Key { [...] KEY_CLEYVER_F1 = 0x01002122, // unused Qt keycode map for Cleyver XTremTab8 F1 Key KEY_CLEYVER_F2 = 0x01002121, // unused Qt keycode map for Cleyver XTremTab8 F2 Key [...] } And in androidjniinput, I add switches in static QKeyCombination mapAndroidKey(int key) { [...] switch (key) { case 0x00000122: // XTREMTAB f1 return Qt::KEY_CLEYVER_F1 ; [...] } I have four android keycodes : 0x121, 0x122 (for Cleyver) , 0x1a0 and 0x1a1 (for Crosscall).
  • 4k 主題
    18k 貼文
    GrecKoG
    Le [=] n'étant pas nécessaire ici vu qu'il n'y a rien à capturer dans la lambda. connect(obj1, &MyObject::mySignal , this, [](int arg1){ qDebug() << arg1; });
  • This is where all the posts related to the Qt web services go. Including severe sillyness.
    1k 10k
    1k 主題
    10k 貼文
    SGaistS
    Hi, I think you can use https://forum.qt.io/category/5/qt-io-webservices category for this type of question (moved there by the way). Are these in your "unread" section ? Are they marked as you following them ?