Page 1 of 9 123 ... LastLast
Results 1 to 20 of 179

Thread: wwWidgets

  1. #1
    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

    Lightbulb wwWidgets

    Beta release of wwWidgets4 - a set of widgets for Qt4 has been released

    Download package

    The set consists of the following widgets:
    • QwwColorButton Button acting as a colour chooser
    • QwwColorComboBox Combobox that allows to pick colors. (unstable)
    • QwwHueSatPicker A widget allowing color picking in a form of a hue-saturation rectangle
    • QwwHueSatRadialPicker A widget allowing color picking in a form of hue-saturation circle
    • QwwLineEdit QLineEdit with regular expression validation support
    • QwwListWidget An enhanced QListWidget
    • QwwLongSpinBox A spinbox taking long long values
    • QwwNavigationBar Widget simmilar to MS Outlook navigation bar. (unstable)
    • QwwNumPad A numeric keypad widget
    • QwwTaskPanel Task panel simmilar to the one from WindowsXP.(unstable)
    • QwwTipWidget Widget that displays application tips
    • QwwTwoColorIndicator A widget allowing to choose a foreground and background colour


    Widgets marked as unstable are hardly or even not at all usable. The color combobox has beed disabled and will not be built, so you won't see it in your widget box.

    To build and install the set issue qmake, (n)make and (n)make install commands. The set should install cleanly on Unix and MSVC installations. There is a little problem with MinGW - you have to copy the .a file to the appropriate directory yourself.

    To use the set simply add "CONFIG += wwWidgets" to your project file.

    The set is not completed, but I decided to release it now anyway (GPL licence), because I don't know when I'll be able to finish the set so in the meantime it may be of benefit to someone. If you want to use any of the widgets in a commercial product, please contact me.

    Comments about the release are welcome and appreciated - you can send me a private message, just please don't send reports about obviously not completed functionality. Please don't send reports about unstable widgets.

    Due to a lack of functionality in Qt (at least up to versions 4.3beta1) Designer made custom container classes (such as the navigation bar and the task panel) will not work (hand coded classes should work fine).

  2. The following 5 users say thank you to wysota for this useful post:

    ball (22nd April 2007), Brandon_R (17th August 2011), hakermania (27th August 2011), KL-7 (14th September 2009), yeaiping (6th July 2011)

  3. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: wwWidgets

    Hehe, looking at the list it looks to me, you collected all reoccuring (in the forum) widgeds that users try to make, or look for.
    Kind'a "see a need, feel a need"

    Not bad, I will have a look at it as soon as I can.

    Cheers!
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  4. #3
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: wwWidgets

    Hi wysota

    To get my VS2005 SP1 to compile/link this correctly, I needed to change qwwtwocolorindicator.h from


    Qt Code:
    1. .
    2. .
    3. class QwwTwoColorIndicatorPrivate;
    4. class Q_GUI_EXPORT QwwTwoColorIndicator : public QWidget, QwwPrivatable
    5. {
    6. Q_OBJECT
    7. .
    8. .
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. .
    2. .
    3. class QwwTwoColorIndicatorPrivate;
    4. class Q_WW_EXPORT QwwTwoColorIndicator : public QWidget, QwwPrivatable
    5. {
    6. Q_OBJECT
    7. .
    8. .
    To copy to clipboard, switch view to plain text mode 
    This looked right compared to other classes in the distro.

    Other things causing minor problems
    • The nmake install installs the dll into the QTDIR/lib folder, not the bin folder - yet another PATH entry required then?
    • There's no "d" suffix to discriminate between debug and release build as suggested in the help pages. (I tend to use bin/bind folders as a model for my app builds but this is supposed to act a standard Qt extension)
    • The "plugin" is being built with a staticlib setting in the pro file - I'm not sure if this is what you intended.


    Still trying to get it working - I'm after one of those marvellous "Outlook 2003" navigation bars (and I saw some of the flame wars on the "other" Qt forum). However I've already sorted out the styling of QPushButtons - just trying to get the behaviours the same. Current screen shot attached.



    Pete
    Attached Images Attached Images
    Last edited by pdolbey; 26th April 2007 at 22:59.

  5. #4
    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: wwWidgets

    Oh, yes... sorry about that... I thought I corrected that. I'll update the archive right away.

  6. #5
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: wwWidgets

    Thank you for a Great collection of widgets ...
    These widgets help us to have a better understand of the Qt Sources. Your pimpl implementation rocks :-) . I liked the way you used a Base class to handle the destruction of d_ptr. Is that an implementation of RAII Idiom ?


    One Question,
    I found that you have used some undocumented features like the Q_Q and Q_D macros ... and trolltech warns us against the use of these macros. So is it fine to use it or should you create your own Q_WW_D ?
    We can't solve problems by using the same kind of thinking we used when we created them

  7. The following user says thank you to sunil.thaha for this useful post:

    boudie (24th January 2010)

  8. #6
    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: wwWidgets

    [QUOTE=sunil.thaha;35595]Is that an implementation of RAII Idiom ?
    I don't have the slightest idea. If it is, then it's unintentional

    I found that you have used some undocumented features like the Q_Q and Q_D macros ... and trolltech warns us against the use of these macros. So is it fine to use it or should you create your own Q_WW_D ?
    It depends. I use it on my own pointers so it's safe. But you shouldn't use it on pointers Qt provides - I tried

  9. #7
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Some doubts

    Since we are expecting the our private data to be derived from QwwPrivate. Why do the functions like d_func() use reinterpret_cast rather than a dynamic_cast ?
    Last edited by sunil.thaha; 30th April 2007 at 17:26. Reason: spelling error
    We can't solve problems by using the same kind of thinking we used when we created them

  10. #8
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: wwWidgets

    wysota,

    I know you said not to to comment about "unstable" widgets, but I had some minor success yesterday hacking the qwwnavigationbar component into some sort of stability. I've got the primary functionality working with the PushButtons activating the correct QWidget in the top half of the splitter and have sucessfully "styled" the PushButtons to the original "Outlook" (silver version) look similar to my screen grab above but without the minimize bar. The question is if you want the code fed back - I've changed both the header (replacing the topButton with a QLabel) and cpp and have added pngs to the resource file. Any interest?

    Pete

  11. #9
    Join Date
    Apr 2007
    Posts
    44
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: wwWidgets

    How to install component?

    After i build ,i got wwwidgets4.dll and wwwidgets4.lib

    i put 2 files into qtdesigner plugin folder but nothing new component load.

    ???

  12. #10
    Join Date
    Jan 2006
    Posts
    368
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: wwWidgets

    On linux this creates a file called libwwwidgets4plugin.a, I was under the impression that the plugins should be *.so files...?

    not workign here as well.

  13. #11
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: wwWidgets

    See my bullet point 3 above

    The "plugin" is being built with a staticlib setting in the pro file - I'm not sure if this is what you intended.
    Pete

  14. #12
    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: wwWidgets

    I'm back now, so I can answer all the questions

    Quote Originally Posted by sunil.thaha View Post
    Since we are expecting the our private data to be derived from QwwPrivate. Why do the functions like d_func() use reinterpret_cast rather than a dynamic_cast ?
    1) Qt works exactly the same way
    2) dynamic cast is not needed as the component designer knows the class name, so there is no point of using dynamic cast because you can't access pimpl from outside the class anyway.
    3) dynamic_cast relies on RTTI from the compiler, so you'd want to avoid that if possible.

    Quote Originally Posted by pdolbey View Post
    I know you said not to to comment about "unstable" widgets,
    That was because some things may not work, so I didn't want to see comments like "X doesn't work" - I already know it doesn't work Any other comments on unstable widgets are welcome.

    but I had some minor success yesterday hacking the qwwnavigationbar component into some sort of stability.
    The navigation bar is stable, the problem with it is that you can't use its Designer plugin correctly, because of a major bug in Qt.

    I've got the primary functionality working with the PushButtons activating the correct QWidget in the top half of the splitter and have sucessfully "styled" the PushButtons to the original "Outlook" (silver version) look similar to my screen grab above but without the minimize bar. The question is if you want the code fed back - I've changed both the header (replacing the topButton with a QLabel) and cpp and have added pngs to the resource file. Any interest?
    Sure, let's have a look . I don't think you have to add any images to the resource file, as CSS capabilities from Qt should allow you to make use of external images. About the button in the header - you can access the button and disable its "clicking" functionality if you don't like it without modifying the actual class (or you can subclass of course).

    Quote Originally Posted by Teerayoot View Post
    How to install component?
    After i build ,i got wwwidgets4.dll and wwwidgets4.lib
    i put 2 files into qtdesigner plugin folder but nothing new component load.
    You should have run "nmake install" after the compilation. The dll needs to be present in both the lib directory (so that you can make use of the component from your applications) and in the bin directory (so that Designer can access it). Furthermore you should have the file "wwwidgets4plugin.dll" available as well and it should land in your plugins/designer folder (nmake install should take care of that).

    Quote Originally Posted by elcuco View Post
    On linux this creates a file called libwwwidgets4plugin.a, I was under the impression that the plugins should be *.so files...?
    Well... you should have received a .so file if you didn't stick any "static" keywords during preconfiguration. I'll have a look at the project file to see what might have gone wrong and I'll get back to you on that.

  15. #13
    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: wwWidgets

    Looks like I missed some comments...

    Quote Originally Posted by pdolbey View Post
    The nmake install installs the dll into the QTDIR/lib folder, not the bin folder - yet another PATH entry required then?
    No, it should have installed in both directories. As QMake doesn't seem to support installing into two dirs I had to hack the install script a little and didn't have time to test it properly, so it might have not worked.

    There's no "d" suffix to discriminate between debug and release build as suggested in the help pages. (I tend to use bin/bind folders as a model for my app builds but this is supposed to act a standard Qt extension)
    True, I didn't think of that, although the library is meant to be compiled against release version of Qt as that's how Designer is compiled. So if you want a debug release of the widget library, you have to adjust the name yourself for now. I'll correct it later.

    The "plugin" is being built with a staticlib setting in the pro file - I'm not sure if this is what you intended.
    No, it certainly shouldn't happen. Maybe KDevelop changed the project file behind my back again.

    Still trying to get it working - I'm after one of those marvellous "Outlook 2003" navigation bars (and I saw some of the flame wars on the "other" Qt forum).
    I was throwing the flames myself as I consider the bar stupid (waste of space, etc.), but if people need it, then it might be worth creating one.

    However I've already sorted out the styling of QPushButtons - just trying to get the behaviours the same.
    It should be very easy to change the appearance using CSS. If you have any comments about the functionality of the component, please don't hesitate to put them here. I have never used the Outlook bar myself, so I might be wrong about how it should work.

    Thanks for the comments, I'm waiting for more.

  16. #14
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: wwWidgets

    Quote Originally Posted by wysota View Post
    I was throwing the flames myself as I consider the bar stupid (waste of space, etc.), but if people need it, then it might be worth creating one.
    I noticed that - thats why I was suprised to see the widget in your package

    Quote Originally Posted by wysota View Post
    It should be very easy to change the appearance using CSS. If you have any comments about the functionality of the component, please don't hesitate to put them here. I have never used the Outlook bar myself, so I might be wrong about how it should work.
    See my second post - I have the widget both functioning stable enough for my needs, and styled to the MS look (but not necessarily feel). I thought I might change your interface to allow the style to be removed to give a vanilla OS look to the pushbuttons. However it is your library and it wouldn't be fair of me to make changes that might become a core element of my own project without telling you or giving you the opportunity to review them.

    Cheers, Pete

  17. #15
    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: wwWidgets

    Quote Originally Posted by pdolbey View Post
    I thought I might change your interface to allow the style to be removed to give a vanilla OS look to the pushbuttons. However it is your library and it wouldn't be fair of me to make changes that might become a core element of my own project without telling you or giving you the opportunity to review them.
    From what I understand the only change needed is to call (or not) setStylesheet() with a proper string that will change the look (and possibly some of the "feel" as well) of the widget.

  18. #16
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Talking Re: wwWidgets

    Quote Originally Posted by wysota View Post
    The navigation bar is stable, the problem with it is that you can't use its Designer plugin correctly, because of a major bug in Qt.
    Unfortunately, when you claimed the widget was unstable it wasn't clear what this meant. When I started testing it I used a test routine like this

    Qt Code:
    1. #include <QtGui>
    2. #include <qwwnavigationbar.h>
    3.  
    4. int main(int argc, char ** argv)
    5. {
    6. QApplication app(argc, argv);
    7. QMainWindow* win = new QMainWindow();
    8. QwwNavigationBar* nav = new QwwNavigationBar(win);
    9. nav->addWidget(new QFrame(), "First Widget");
    10. nav->addWidget(new QFrame(), "Second Widget");
    11. nav->addWidget(new QFrame(), "Third Widget");
    12. win->setCentralWidget(nav);
    13. win->show();
    14. return app.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 

    which creates the screen window attached. The text for the second and third widgets was missing. This is when I started hacking . I believe I have a working solution, but as I can't be sure that this matches your original design, I'd rather PM the changes to you.

    Pete
    Attached Images Attached Images

  19. #17
    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: wwWidgets

    AFAIR the titles are taken from the "windowTitle" property of widgets added to the bar (that's one of the workarounds for one of Qt Designer problems), so this should work:

    Qt Code:
    1. QwwNavigationBar* nav = new QwwNavigationBar(win);
    2. QFrame *frm = new QFrame;
    3. frm->setWindowTitle("First widget");
    4. nav->addWidget(frm);
    5. frm = new QFrame;
    6. frm->setWindowTitle("Second widget");
    7. nav->addWidget(frm);
    8. frm = new QFrame;
    9. frm->setWindowTitle("Third widget");
    10. nav->addWidget(frm);
    To copy to clipboard, switch view to plain text mode 

    The same goes for windowIcon property and the decoration of the button. I can't be certain the current code works this way (and I can't test it on this computer), but it is the way it was meant to work.

  20. #18
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: wwWidgets

    Unfortunately that pattern isn't obvious from either the interface description, or from my initial test with only one button that worked "correctly". I could see that window titles were being used in the code, but I didn't realise that these were supposed to be the primary title source, and when I have specified text in my method call I would have expected it to have been displayed. Thats whay I thought the widget was inherenently unstable.

    Pete

  21. #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: wwWidgets

    Quote Originally Posted by pdolbey View Post
    Unfortunately that pattern isn't obvious from either the interface description, or from my initial test with only one button that worked "correctly". I could see that window titles were being used in the code, but I didn't realise that these were supposed to be the primary title source, and when I have specified text in my method call I would have expected it to have been displayed. Thats whay I thought the widget was inherenently unstable.
    That's why the widget is called "unstable" and the whole release "beta" The interface of the navigation bar will change a bit because some things will be done outside the widget and inside Designer (just like with the task panel). When this is done, the behaviour will be coherent.

  22. The following user says thank you to wysota for this useful post:

    pdolbey (5th May 2007)

  23. #20
    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: wwWidgets

    Ok, I finally forced myself and published the next, (almost) fully usable beta of wwWidgets.

    http://www.wysota.eu.org/wwwidgets

    All comments are of course welcome.

    Oh... and of course a screenshot of some of the widgets.


Similar Threads

  1. wwWidgets
    By mickey in forum Qt Programming
    Replies: 22
    Last Post: 17th July 2006, 16:20

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.