
Originally Posted by
wysota
Do you place widgets inside that QFrame? I'm sorry, I just have trouble to understand how is your application implemented and you're not giving any details. Guessing again - but I take it that you draw directly on the frame, so my answer would be not to use any widgets for the header but draw it directly on the frame. I admit, that I would use the QCanvas framework instead

Sorry,
Let me explain about my application
I have a class similar to like this
class chemCanvas
: public QFrame{
//some code to draw on QFrame using QPainter
};
//"chemEdit.cpp"
{
scrollChemCanvas = new ScrollChemCanvas ( this, readonly, "scrolledCanvas" );
CHECK_PTR( scrollChemCanvas );
canvas = scrollChemCanvas->getCanvas();
setCentralWidget( scrollChemCanvas );
};
//"chemEdit.h"
//declaration for canvas and scrollChemCanvas is as follows
ChemCanvas* canvas;
ScrollChemCanvas *scrollChemCanvas;
class ScrollChemCanvas : public QScrollView
{
canvas = new ChemCanvas( viewport(), readonly );
};
class chemCanvas : public QFrame
{
//some code to draw on QFrame using QPainter
};
//"chemEdit.cpp"
class chemEdit : public QMainWindow
{
scrollChemCanvas = new ScrollChemCanvas ( this, readonly, "scrolledCanvas" );
CHECK_PTR( scrollChemCanvas );
canvas = scrollChemCanvas->getCanvas();
setCentralWidget( scrollChemCanvas );
};
//"chemEdit.h"
//declaration for canvas and scrollChemCanvas is as follows
ChemCanvas* canvas;
ScrollChemCanvas *scrollChemCanvas;
class ScrollChemCanvas : public QScrollView
{
canvas = new ChemCanvas( viewport(), readonly );
};
To copy to clipboard, switch view to plain text mode
Here chemCanvas is the class where I do all the painting operations.
chemEdit is the QMainWindow class with all the menuItems, and other widgets
ScrollChemCanvas is the QScrollView which creates Scrollable area
Now I want to provide a Insert button in class chemEdit, which will have a popup menu Header and Footer
Insert->Header and Footer
then when I click on Header and Footer I should get a rectangular area which I think is QLineEdit (not sure), also there will be a widget with InsertAutoText, Insert PageNo, Insert Date, Insert Time etc buttons as shown in the zipped file attached.
Now first thing first what is the widget(or most suitable thing might not be a widget) that I should use for rectangular area, how can I Preview the current page on chemCanvas( just like "Print Preview").
What is the best possible way that I can use to create header and footer for my aplication?
It should be user friendly
Hope this helped you to understand!!!
Thankx
Bookmarks