Forum
Sign Up
× DataGrid for Qt.C++

Problem when using grid in a stacked widget

10 years 3 days ago #1 by
Hi,
i want to used a grid into a stacked widget for a setting dialog. Two of the four columns are StringEditorType, the other ComboBoxEditorType. All cells with has StringEditorType will displayed with solid back color except the actual cell, with is highlighted (see screenshot). Why are these cells displayed wrong? I need a solultion asap.
Attachments:

Please Log in or Create an account to join the conversation.

  • 's Avatar Topic Author
10 years 1 day ago #2 by Developer Machines
Could you send us a demo expample on how to reproduce it? Did you use CSS to render your form?

Please Log in or Create an account to join the conversation.

More
10 years 19 hours ago #3 by
In this moment i have no demo example. I don't use CSS to render the dialog.

Please Log in or Create an account to join the conversation.

  • 's Avatar Topic Author
9 years 11 months ago #4 by
Enclosed you will find an example. Select 'File->Settings' to open the dialog. You will find the grid on page 'Vorlagen'. Look at the last column, the background color ist solid black.

File Attachment:

File Name: TestDialogs.zip
File Size:33 KB
Attachments:

Please Log in or Create an account to join the conversation.

  • 's Avatar Topic Author
9 years 10 months ago #5 by Developer Machines
It is not a problem in the grid. You need to set setModelDecoration to false or return the right value of the Qt::BackgroundRole from your model.

I checked it with this:
QVariant OutputTemplateModel::data(const QModelIndex& index, int role) const
{
    if (role != Qt::DisplayRole && role != Qt::EditRole)
        return QVariant();
..........

Please Log in or Create an account to join the conversation.

More
  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Moderators: Developer Machines
Time to create page: 0.272 seconds

Developer Newsletter

Join our Developer Machines newsletter to get informed on all the latest releases of the commercial components for Qt.C++, Delphi FireMonkey, updates and general knowledges.

Quick Support

Should you need any additional information about our products or licensing, please contact us at the following email addresses:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

  • This email address is being protected from spambots. You need JavaScript enabled to view it.

Get in Touch

If you would like to purchase our products or services, but don’t know how to do it the right way, please feel free to contact us:

  • This email address is being protected from spambots. You need JavaScript enabled to view it.( any questions related to our products or services )
  • This email address is being protected from spambots. You need JavaScript enabled to view it.( questions related to licensing )