Results 1 to 13 of 13

Thread: QlineEdit is not showing the Current Focused Widget,

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    May 2010
    Posts
    100
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QlineEdit is not showing the Current Focused Widget,

    Dear High_flyer,

    Here i am putting the Header and source file code.

    file:dynscrn.h

    Qt Code:
    1. class dynscrn : public QWidget
    2. {
    3. Q_OBJECT
    4. public:
    5.  
    6. dynscrn(QStringList str, int msgid, QWidget *parent=0);
    7. ~dsynsrn();
    8.  
    9. QWidget *dynwid;
    10. QGraphicsProxyWidget *proxy;
    11.  
    12. QLabel *info1;
    13. QLabel *info2;
    14. }
    To copy to clipboard, switch view to plain text mode 
    //////////////////////////////////////////////////////////////////////////////////////////
    File: dynscrn.CPP

    Qt Code:
    1. dynscrn :: dynscrn(QStringList str, int msgid, QWidget *parent=0):QWidget(parent)
    2. {
    3. dynwid = new QWidget(); //Widget on which i paste my text or Image
    4. dynwid -> setGeoMetry(0,0,460,570);
    5. dynwid -> setWindowOpacity(0.75);
    6.  
    7. info1 = new QLabel(dynwid );
    8. info2 = new QLabel(dynwid );
    9.  
    10. info1 -> setText(str.at(0));
    11. info2 -> setText(str.at(1));
    12.  
    13. //rotate above dynwid
    14. scene =new QGraphicsScene();
    15. proxy = scene -> addWidget(dynwid );
    16. view = new QGraphicsView(scene);
    17. view -> setParent( parent, Qt::FrameLessWindowHint);
    18. view ->setFixedSize(570+4, 460+4);
    19. view -> setGeoMetry(0,0,570,460); //change the width and height
    20.  
    21. view -> rotate(-90); //rotate at -90
    22. view -> show(); //display dynwid
    23. }
    24.  
    25. dsynsrn ::~dsynsrn() //deletes whole dynwid and its children
    26. {
    27. delete info1;
    28. delete info2;
    29. delete dynwid;
    30. delete scene;
    31. delete view;
    32. }
    To copy to clipboard, switch view to plain text mode 

    /////////////////////////////////////////////////////////////////////////
    Now in Another Class File I used this as below:
    In this Both dynamic and static screen object will be used as per requirement.

    Qt Code:
    1. void Widget:: RxMessageAtQt(messgeid, stringlist)
    2. {
    3.  
    4. if(static Screen is visible)
    5. {
    6. hide static screen;
    7. }
    8.  
    9. if(dynscrn is object ! = NULL) //means dynamic widget is currently exist
    10. {
    11.  
    12. delete dynamic widget;
    13. dynamic widget = NULL;
    14. }
    15.  
    16. if(messageid == 500) //show dynamic scrn
    17. {
    18. create a dynamic widget from dynscrn and will be displayed by its constructor;
    19. }
    20. else //show static screen
    21. {
    22. if(static screen is not visible)
    23. {
    24. show static screen;
    25. // Static screen is a statcked of widgets.Its basically a Menu, and we can
    26. // navigate by the button on that screen.
    27. //User can enter some valued like ethernet parameters and save ,delete and
    28. // cancel it. or move to the next or previous menu widget.
    29. //Thede are not editable when i come second time over this page.
    30. }
    31. }
    32.  
    33.  
    34. }
    To copy to clipboard, switch view to plain text mode 

    /*************end *******************


    I cant find any bug in the above code.
    If some one knows let know.

    THANKING YOU ALL.
    Last edited by high_flyer; 17th December 2010 at 08:53. Reason: code tags

Similar Threads

  1. Replies: 4
    Last Post: 29th September 2010, 19:21
  2. Replies: 0
    Last Post: 11th August 2010, 10:02
  3. Widget not showing
    By kaushal_gaurav in forum Qt Programming
    Replies: 3
    Last Post: 24th July 2008, 09:37
  4. Showing the output from cmake on my widget
    By jsmax in forum Qt Programming
    Replies: 3
    Last Post: 18th May 2007, 20:17
  5. Replies: 1
    Last Post: 5th November 2006, 23:50

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.