It's not a menu, just a list of options tht is collapsible.
I came across this (some time ago for Qt3) http://www.vcreatelogic.com/oss/qpulistview/index.html
Seems to be just what you are looking for. Maybe you can rewrite it for Qt4?
It's not a menu, just a list of options tht is collapsible.
I came across this (some time ago for Qt3) http://www.vcreatelogic.com/oss/qpulistview/index.html
Seems to be just what you are looking for. Maybe you can rewrite it for Qt4?
Save yourself some pain. Learn C++ before learning Qt.
gfunk (14th August 2006)
Thanks for the reply Chicken Blood Machine. I've downloaded the source code for this widget and am attempting to port it from QT3 to QT4. I've run into several errors with that process, so I'm trying to resolve them.
Thanks again.
Cool. Be sure to post if you need any help.
Save yourself some pain. Learn C++ before learning Qt.
Well, I decided to try it out in QT3 to make sure it does what I need it to do. But, I cannot seem to be able to get it to compile. I've attached a simple program that I'm triess to use the widget. I don't suppose you've used this widget before?
Thanks,
Glenn
I'm not in a position to compile your code right now, but it looks like you're passing a char to the QpuListView constructor when you should be passing a char*. What is the compile error that you are getting?
Save yourself some pain. Learn C++ before learning Qt.
Sorry I did not include the error messages. There were many errors last night. Using g++, it keeps referring to an undefined reference to that constructor.
I noticed when I looked at it again later this morning, that I was passing a Character and not a pointer. Guess I was up too late fighting with this thing. It's been awhile since I've used my limited C++ skills.I made some changes and will try compiling the revised code tonight.
Thanks.
Well, the problem appears to be with the linker. The file itself will compile. If I switch out QpuListView for the regular QListView, it works fine. I compiled the widget as a shared library without errror. I placed the libraries in $QTDIR/lib and the header in $QTDIR/include.
Below is the compiler messages:
cd '/home/glenns/projects/tst' && QTDIR="/usr/lib/qt3" gmake -k clean && QTDIR="/usr/lib/qt3" gmake -k
rm -f tst.o
rm -f *~ core *.core
g++ -c -pipe -Wall -W -g -DQT_SHARED -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I/usr/lib/qt3/include -o tst.o tst.cpp
tst.cpp: In function 'int main(int, char**)':
tst.cpp:17: warning: unused variable 'quit'
tst.cpp:27: warning: unused variable 'items'
g++ -o tst tst.o -L/usr/lib/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
tst.o: In function `main':
/home/glenns/projects/tst/tst.cpp:25: undefined reference to `QpuListView::QpuListView(QWidget*, char const*)'
/home/glenns/projects/tst/tst.cpp:27: undefined reference to `QpuListViewItem::QpuListViewItem(QpuListView*, QString const&)'
collect2: ld returned 1 exit status
gmake: *** [tst] Error 1
gmake: Target `first' not remade because of errors.
*** Exited with status: 2 ***
Here is the file I'm trying to compile:
#include <qapplication.h>
#include <qfont.h>
#include <qpushbutton.h>
#include <QpuListView.h>
#include <qgrid.h>
int main(int argc, char *argv[])
{
char *Q = new char(0) ;
QApplication app(argc, argv);
// QPushButton *quit = new QPushButton("Quit", 0);
// quit -> resize(75, 30);
// quit -> setFont(QFont("Times", 18, QFont::Bold));
// QObject::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit()));
QGrid *container = new QGrid( 1 );
QpuListView *listview = new QpuListView( container, Q ) ;
QpuListViewItem *items = new QpuListViewItem( listview, "Test" );
// QpuWidgetItem widgets = new QpuWidgetItem(items, quit ) ;
container -> show();
return app.exec();
delete container ;
delete Q ;
delete listview ;
return 0;
}
Qt Code:
-L/usr/lib/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lmTo copy to clipboard, switch view to plain text mode
I don't see any reference to the library that you compiled. What is it called? You should have something like:
-L/usr/lib/qt3/lib -L/usr/X11R6/lib -lQpu -lqt-mt -lXext -lX11 -lm
Also, it's not really appropriate to put any library that you build in $QTDIR/lib. You should put it in a user-defined place and make sure that it is on your linker path (with -L). If it is a shared lib, you also have to make sure it is on the LD_LIBRARY_PATH when you run the program.
BTW, for this test, you don't really need to build a library at all. You can just place the source code for QpuListView in the same project as your application.
Save yourself some pain. Learn C++ before learning Qt.
Hai,
I tried out the Pulistview. I created an application with one Listview. I implemented this QPUListView class in the project. But i got lot of errors.
I added QT3 Support Library in the Project. I am using QT 4.3.4. So i am not able to modify this class as i am new to QT.
Could you please help to solve this problem.
Thanks and regards.
V. Santhosh
Bookmarks