Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4083950
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:22:41+00:00 2026-05-20T18:22:41+00:00

For days I’ve been battling with QT, Models, Views, Delegates. I wish to know

  • 0

For days I’ve been battling with QT, Models, Views, Delegates. I wish to know that architecturally, I am on the right Track. If you can comment on that, you’re more than welcome.

GOAL:

A Scrollable Buddy List, similar to what Skype has. The following requirements must be supported:

  1. complete control over the drawing
    of a row. Typically, Icons of
    variable width based on status of
    the object represented by the row.

  2. Variable height for rows,
    typically, more detailed row display
    for the selected row.

  3. Added controls for selected rows (action
    buttons).
  4. Full control over the
    sorting of the list
  5. different
    types of rows typically, a buddy or
    a textual placeholder with a label
    indicating the type of buddies
    directly under it (e.g. “offline
    contacts”, “online contacts”).

My thoughts were as follows:

  1. Use a QListView for the listview control
    Use a derived QAbstractList model to hold the buddy data. It will have an std::vector array with a collection of “MyContactClass”. Each “MyContactClass” instance will represent a buddy, with its related data fields
  2. Use a QAbstractItemDelegate derived class to handle the painting and sizeHinting of the rows
  3. Hook up the model and delegate to the QListView
  4. populate the model…
  5. Have the QListView populated

I understand there are many details to this and it’s not trivial at all. What I wanted to ask you is: Are items #1 to #6 correct architecturally given what I’m trying to do.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:22:42+00:00Added an answer on May 20, 2026 at 6:22 pm

    I have done a lot of model/view programming in Qt. Your method seems correct to me.

    You might have a tricky time adding these action buttons to the delegate. QAbstractItemDelegate doesn’t play very nice with custom widgets but does well with style option controls.

    And of course you will need to register your MyContactsClass with the MOC so that it can be used in QVariant.

    Other than that, looks good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some days ago I realized that PrintWriter (as well as PrintStream ) never throw
Since the early days, Palm OS has had a special easter egg mode that's
These days I have learned some basic usage of C#. I think that because
these days I read a lot with regards to RSLs. One disadvantage is that
These days with Visual C# (Visual C# 2008 specifically) it seems that the default
These days, more languages are using unicode, which is a good thing. But it
Back in the old days, Help was not trivial but possible: generate some funky
Every few days VS2008 decides to get mad at me and fails to generate
I recently (a few days ago) installed .NET 3.5 SP1 and subsequently an aspnet_client
In the early days of SharePoint 2007 beta, I've come across the ability to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.