Showing posts with label qt. Show all posts
Showing posts with label qt. Show all posts

Thursday, April 4, 2013

Installing pyside-tools on Fedora 14

I was trying to do some tinkering with pyside in Fedora 14 today, but I came across a frustrating error when trying to launch designer-qt4:


undefined symbol: gst_x_overlay_set_window_handle

I needed to downgrade to phonon 4.4.2 from 4.5
Here are the steps I used to get around it:

  1. sudo yum remove phonon
  2. Disable the yum update repo in /etc/yum.repos.d/fedora-updates.repo
  3. sudo yum install phonon
  4. Reenable the yum update repo
  5. sudo yum install pyside-tools
  6. relaunched designer-qt4 and it works as expected


Now I can continue developing in pyside...

Tuesday, January 25, 2011

Disabling QCombobox items

So I ran into the problem in Qt a while back of not being able to disable certain items in a QComboBox widget. Since when I was looking for it I couldn't find a solution, I figured I'd post the solution here even though nobody will probably ever read it.

You have to use the QAbstractItemModel's setFlags() method. Wait, what do you mean there's no setFlags() method? Oh, well just use the setData() method and have the role as 'Qt::UserRole - 1'. Because that makes so much sense. bleh. I hope qt fixes that.

Unfortunately I can't take a screenshot of it right now. But here's my solution anyways. Hope this helps somebody.


----------------------------------------------------------------------------------------------------------------
// Get the index of the value to disable
QModelIndex index = ui.comboBox->model()->index(1,0);

// This is the effective 'disable' flag
QVariant v(0);
//the magic

ui.comboBox->model()->setData( index, v, Qt::UserRole -1);
----------------------------------------------------------------------------------------------------------------