It's a widget originating on Mac for showing filesystem contents. The final column is meant to show a preview of a node (file) chosen in the previous column.
It's a widget originating on Mac for showing filesystem contents. The final column is meant to show a preview of a node (file) chosen in the previous column.
I attempted to do exactly this....and it dies on me.
Qt Code:
namespace systemoutliner { class MyColumnView : public QColumnView { Q_OBJECT public: ~MyColumnView(); protected: }; } namespace systemoutliner { QColumnView(parent) { } MyColumnView::~MyColumnView() { } { return NULL; } }To copy to clipboard, switch view to plain text mode
And when I try to connect a Model to this view I get this error:
QObject::connect: Cannot connect (null)::clicked(QModelIndex) to systemoutliner::MyColumnView::_q_clicked(QModelInd ex)
QObject::connect: Cannot connect (null)::activated(QModelIndex) to systemoutliner::MyColumnView::activated(QModelInde x)
QObject::connect: Cannot connect (null)::clicked(QModelIndex) to systemoutliner::MyColumnView::clicked(QModelIndex)
QObject::connect: Cannot connect (null)::doubleClicked(QModelIndex) to systemoutliner::MyColumnView::doubleClicked(QModel Index)
QObject::connect: Cannot connect (null)::entered(QModelIndex) to systemoutliner::MyColumnView::entered(QModelIndex)
QObject::connect: Cannot connect (null):ressed(QModelIndex) to systemoutliner::MyColumnView:
ressed(QModelIndex)
Any ideas?
Your code doesn't show where these connections are made.
sorry...
Qt Code:
MyColumnView *columnView = new MyColumnView(); //QColumnView* columnView = new QColumnView(); ColumnModel *columnModel = new ColumnModel(inspectorGadget); columnView->setFocusPolicy(Qt::NoFocus); columnView->setModel(columnModel);To copy to clipboard, switch view to plain text mode
Line 5 explodes.....
ColumnModel is my own QAbstractModel class, but it works just fine with the default QColumnview.
Thanks,
Larry
You still don't show where these connect() calls are being made. The error messages are coming from using a null pointer as the first argument to the connect() calls listed.
well.... I didn't write the connect calls that are failing? I'm inheriting from a QAbsractItemModel and I'm overloading a QColumnView.
None of those pointers are NULL in the debugger when I make that setModel call so I am a bit puzzled. I guess I'll have to compile the Qt libs debug so I can step into them and see where is exploding.
You are returning a null pointer from QColumnView::createColumn() reimplementation so no wonder you get such messages. You have to return a widget there. You can hide it afterwards if you don't want it but it has to be there.
Ahhh.....
That is a bummer since your original suggestion was to return a 0. I have opened the QColumnView.cpp and yeah, its pretty obvious that returning a NULL in that function is going to blow up the world.....
I'm looking right now, but does anyone have a quick suggestion to turn off the preview column in QColumnView?
I have given you a suggestion already. Hide the column.
Bookmarks