Page 1 of 2 12 LastLast
Results 1 to 20 of 28

Thread: Is there a QT widget similar to the Task Panel's used in many XP applications.

  1. #1
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Is there a QT widget similar to the Task Panel's used in many XP applications.

    I'm writing an application using QT 4.1. I'm designing the UI to have a look and feel similar to other UI's used in applications designed for Windows XP. I would like to have a task panel, which will lists the tasks available to the user. Is there a widget like this for QT 4.1, that will work in Windows and Linux? The url below will take you to a site that can show you what I'm looking for. Thanks.

    http://www.codejock.com/products/taskpanel/

  2. #2
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    Once upon a time, in a land far far away, we used call these things "context menus". Is there any reason you can't use a QMenu context menu?

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    As far as I remember, Qt's "toolbox" aka QToolBox allows only one "tab" to be expanded at time. So presumably it's not what you're after. A QTreeView however, could be customized to achieve the both, look 'n feel & functionality.
    J-P Nurmi

  4. #4
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    I guess I'm confused as to what is wanted. I thought he was referring to the task menu shown on his link.

  5. #5
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    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.

  6. The following user says thank you to Chicken Blood Machine for this useful post:

    gfunk (14th August 2006)

  7. #6
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    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.

  8. #7
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    Cool. Be sure to post if you need any help.
    Save yourself some pain. Learn C++ before learning Qt.

  9. #8
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    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
    Attached Files Attached Files

  10. #9
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    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.

  11. #10
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    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.

  12. #11
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    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;

    }

  13. #12
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    Qt Code:
    1. -L/usr/lib/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
    To 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.

  14. #13
    Join Date
    Jan 2006
    Location
    Munich, Germany.
    Posts
    111
    Thanks
    29
    Thanked 3 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    How about just sub-classing QDockWidget and putting a QGroupBox into it. Stick all your buttons and widgets into the group box.
    you get something like the attachement. And it's dockable.
    Attached Images Attached Images

  15. #14
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    Thanks again Chicken Blood Machine. Including the Widgets sources in the project worked perfectly. Now I'll attempt to port it to QT4. It ports OK, except for a function that uses QObjectListIterator. I'll have to research what QT4 is using for a QObjectListIterator and how it works.

    Kedge, thanks for the suggestion. I'll look at that to.

  16. #15
    Join Date
    Jun 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    Hi gsQT4,

    plz. have you already this QpuListView ported to Qt4 ?

  17. #16
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    DoNaLd,

    I did port it for QT4. It still requires qt3support, but does appear to work. I'm a novice developer, so I cannot say the way I implemented to port is correct.

    Glenn

    Qt Code:
    1. /*******************************************************
    2. **
    3. ** Definition of QpuListView
    4. **
    5. ** Copyright (C) 2004 Prashanth N Udupa
    6. **
    7. ** QpuListView is an enhanced list view for providing
    8. ** XP look and feel left pane widget
    9. ** you and distribute and modify is under terms of GNU
    10. ** Library General Public License as published by the
    11. ** Free Software Foundation; either version 2, or (at
    12. ** your option) any later version.
    13. **
    14. ********************************************************/
    15.  
    16. /***************************************************************************
    17.   QpuListView.h
    18.   -------------------
    19.   begin : Thu 03 June 2004
    20.   copyright : (C) 2004 by Prashanth Udupa
    21.   email : udupaprashanth@yahoo.com
    22.  ***************************************************************************/
    23.  
    24. /***************************************************************************
    25.  * *
    26.  * This program is free software; you can redistribute it and/or modify *
    27.  * it under the terms of the GNU General Public License as published by *
    28.  * the Free Software Foundation; either version 2 of the License, or *
    29.  * (at your option) any later version. *
    30.  * *
    31.  ***************************************************************************/
    32.  
    33. /**
    34. With contributions from Volker Götz
    35. */
    36.  
    37. #ifndef Qpu_LIST_VIEW_H
    38. #define Qpu_LIST_VIEW_H
    39.  
    40. #include <q3listview.h>
    41. //Added by qt3to4:
    42. #include <QPixmap>
    43. #include <QResizeEvent>
    44.  
    45. /**
    46. Some notes
    47.  
    48. 1. This list view should only be used for tree
    49.   structured single column data.
    50. 2. By default the first column is created.
    51. 3. Header is stretchable and is hidden
    52. */
    53.  
    54. class QpuListView;
    55. class QpuListViewItem;
    56.  
    57. class QpuListViewItem : public Q3ListViewItem
    58. {
    59. public:
    60. QpuListViewItem(QpuListView* parent, const QString &text1);
    61. QpuListViewItem(QpuListViewItem* parent, const QString &text2);
    62. ~QpuListViewItem();
    63.  
    64. void setMinimumHeight(int height) { _MinHeight = height; }
    65. int minimumHeight() const { return _MinHeight; }
    66.  
    67. int height() const;
    68. void setup();
    69.  
    70. void paintCell(QPainter* p, const QColorGroup &cg, int column, int width, int align);
    71. void paintBranches(QPainter* p, const QColorGroup &cg, int w, int y, int h);
    72. void paintFocus(QPainter *p, const QColorGroup &cg, const QRect &r);
    73.  
    74. virtual bool isWidgetItem() const { return false; }
    75.  
    76. QpuListViewItem* findItem(const QString &text);
    77.  
    78. void setOpen(bool o);
    79.  
    80. friend class QpuListView;
    81. friend class QpuPainter;
    82.  
    83. protected:
    84. void invalidateChildrenHeight();
    85. void setHeight(int height); // reimplemented from QListView
    86. QRect itemRect() const;
    87. QpuListView* qpuListView() const {
    88. return (QpuListView*)(listView());
    89. }
    90.  
    91. protected:
    92. enum ItemType {
    93. TopLevelItem = 0,
    94. ChildItem,
    95. LastTopLevelItem
    96. } _ItemType;
    97. void setItemType(QpuListViewItem::ItemType type);
    98. const QpuListViewItem* getItemBelow() const;
    99. int belowDepthDiff();
    100. int belowDepthDiff() const;
    101.  
    102. public:
    103. static QPixmap* DownArrow;
    104. static QPixmap* UpArrow;
    105. QpuListViewItem* _ItemBelow;
    106.  
    107. private:
    108. int _MinHeight;
    109. };
    110.  
    111.  
    112. class QpuWidgetItem : public QpuListViewItem
    113. {
    114. public:
    115. // It would not look good if the top level list view item
    116. // was a widget.
    117. // QpuWidgetItem(QpuListView* parent, const QString &text1);
    118. QpuWidgetItem(QpuListViewItem* parent, QWidget* widget=0);
    119. ~QpuWidgetItem();
    120.  
    121. void setWidget(QWidget *widget);
    122. QWidget* widget() const;
    123.  
    124. void setAutoDelete(bool del);
    125. bool autoDelete() const;
    126.  
    127. bool isWidgetItem() const { return true; }
    128.  
    129. void paintCell(QPainter* p, const QColorGroup &cg, int column, int width, int align);
    130.  
    131. friend class QpuListView;
    132. friend class QpuPainter;
    133.  
    134. protected:
    135. virtual QWidget *createWidget() { return 0; }
    136.  
    137. public:
    138. QWidget* _Widget;
    139. bool _AutoDelete;
    140. };
    141.  
    142.  
    143. class QpuListView : public Q3ListView
    144. {
    145. Q_OBJECT
    146. public:
    147. QpuListView(QWidget* parent=0, const char *name=0);
    148. ~QpuListView();
    149.  
    150. QpuListViewItem* findItem(const QString &text) const;
    151.  
    152. void setLastItem(QpuListViewItem* item) { _LastItem = item; }
    153. QpuListViewItem* lastItem() const { return _LastItem; }
    154.  
    155. void setXpLook(bool val);
    156. bool getXpLook() const;
    157.  
    158. void clear();
    159.  
    160. protected slots:
    161. void mouseOverItem(Q3ListViewItem* item);
    162. void itemClicked(Q3ListViewItem *item);
    163. void itemExpanded(Q3ListViewItem*);
    164.  
    165. protected:
    166. void viewportResizeEvent ( QResizeEvent *e );
    167.  
    168. protected:
    169. bool _XpLook;
    170. QpuListViewItem* _LastItem;
    171. };
    172.  
    173. #endif
    To copy to clipboard, switch view to plain text mode 

  18. #17
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    Here are the files.
    Attached Files Attached Files

  19. #18
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    It looks like the port is not working properly. If you look at the attached pictures, you will see the difference. The main issue is the background color. Notice that the QT3 version paints the entire ListView object purple. The QT4 version does not paint the entire background. I've tried many things, and it looks like it is painted when a QPuListViewItem or QpuWidgetItem is added to the QPUListView object. The QT3 version will paint the Listview objects when there are no items.

    Does anyone have a suggestion on how to fix this?

    Thanks,
    Glenn
    Attached Images Attached Images

  20. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    Did you try setting the QPalette::Base brush?

  21. #20
    Join Date
    May 2006
    Posts
    20
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Is there a QT widget similar to the Task Panel's used in many XP applications.

    I added this line to the function that creates the QPUListView object.

    taskView -> Q3ListView::setBackgroundRole(QPalette::Base) ;

    This will make the background white. If I set it to Dark or Window, it is still white when there are no QPUListViewItem or QPUListViewWidgets inserted into the QPUListView object. If I insert a QPUListViewItem it will make the background under the QPUListViewItem object dark or light grey. The rest of it is still white. I'm trying to make the entire back ground the color of the Window.

Similar Threads

  1. Replies: 2
    Last Post: 19th April 2006, 20:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.