Page 4 of 4 FirstFirst ... 234
Results 61 to 66 of 66

Thread: linking of combox with lineEdit.

  1. #61
    Join Date
    Jul 2009
    Posts
    55
    Thanks
    3

    Default Re: linking of combox with lineEdit.

    HELP ME!!! I AM GOING CRAZY! THIS IS KILLING ME!!! can you please help me take a look at the code:????? PLEASE PLEASE PLEASE!!!

    this is the .h

    Qt Code:
    1. #include <QGraphicsItem>
    2. #include <QList>
    3. #include <QTime>
    4. #include <QFont>
    5. #include <QPixmap>
    6. #include <QBrush>
    7. #include <QSound>
    8.  
    9. #include <qlcdnumber.h>
    10.  
    11. #include "edge.h"
    12. #include "settingswindow.h"
    13.  
    14.  
    15.  
    16. class Edge;
    17. class NetworkView;
    18. class NodeDb;
    19.  
    20.  
    21.  
    22. class Node : public QGraphicsItem, public QObject
    23. {
    24. public:
    25. typedef enum{ACCESS_POINT, END_DEVICE}NODE_TYPE;
    26. typedef struct
    27. {
    28. NODE_TYPE type;
    29. int addr;
    30. int xPos;
    31. int yPos;
    32. int strength;
    33. float temp;
    34. float voltage;
    35. int re;
    36.  
    37. int t_time_on;
    38. int fadeNumber;
    39. int fadeTime;
    40. int newNode;
    41. int deletedNode;
    42. }NODE_DATA;
    43.  
    44. QBrush fill[40];
    45. Node(NetworkView *networkView);
    46. NODE_DATA nodeData;
    47. void addEdge(Edge *edge);
    48. QList<Edge *> edges() const;
    49.  
    50. enum { Type = UserType + 1 };
    51. int type() const { return Type; }
    52.  
    53. bool advance();
    54.  
    55. QRectF boundingRect() const;
    56. QPainterPath shape() const;
    57. void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    58. public slots:
    59. void setLoops() const;
    60.  
    61.  
    62. void setNodeData(int index);
    63. void updateData(int index);
    64. int getElapsedTime();
    65. void removeEdge(int childAddr = 0);
    66. int getAddr() { return nodeData.addr; }
    67. float getTemp() { return nodeData.temp; }
    68. int getType() { return nodeData.type; }
    69. void setTempUnit();
    70. void setColor(const NODE_TYPE type);
    71. int Node::find_active_node();
    72. void Node::current_updateData(int index);
    73. int timerId () const;
    74.  
    75. /*struct colors{
    76. int alpha;
    77. int r;
    78. int g;
    79. int b;
    80. int newnodeflag;
    81. int delnodeflag;
    82. };
    83. struct colors node_colors[100];*/
    84.  
    85.  
    86. protected:
    87. QVariant itemChange(GraphicsItemChange change, const QVariant &value);
    88.  
    89. void timerEvent(QTimerEvent *);
    90.  
    91. // NODE_DATA nodeData;
    92.  
    93. private:
    94. QList<Edge *> edgeList;
    95. QPointF newPos;
    96. NetworkView *graph;
    97. QPixmap pixmap,alpha_pix,back_pix,pixmap2,pix;
    98.  
    99. QColor nodeColor;
    100. QColor nodeColorDark;
    101. QColor nodeAlertColor;
    102. QColor nodeAlertColorDark;
    103.  
    104. QFont modeFont;
    105. QFont addrFont;
    106. QFont tempFont;
    107. QFont battFont;
    108. QFont strengthFont;
    109. QFont timeFont;
    110. QFont end_deviceFont;
    111. QFont keyFont;
    112. QFont smallFont;
    113. QFont txFont;
    114.  
    115. QTime timeStamp;
    116. QDate dateStamp;
    117.  
    118. QLineEdit *nameLine;
    119. NodeDb *pNodeDb;
    120.  
    121. // Flag used to highlight node.
    122. bool updated;
    123. int updateTimerId,fade_speed,updateTimerId2,updateTimerId3;
    124.  
    125. bool celsius;
    126. qreal arrowSize;
    127. double nodeAlertTemp;
    128.  
    129. };
    130.  
    131. #endif
    To copy to clipboard, switch view to plain text mode 

  2. #62
    Join Date
    Jul 2009
    Posts
    55
    Thanks
    3

    Default Re: linking of combox with lineEdit.

    and the .cpp is attached.
    Attached Files Attached Files

  3. #63
    Join Date
    Jul 2009
    Posts
    55
    Thanks
    3

    Default Re: linking of combox with lineEdit.

    at the very least let me know where is the widget subclass.

  4. #64
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: linking of combox with lineEdit.

    QGraphicsItem do not inherit the QWidget class so you cannot place a lineEdit inside it...
    what you can do is make another QGraphicsProxyWidget and put lineEdit inside it. read the doc of this.. then like you have inserted your node into a scene... add you proxywidgetitem to the scene as welll.. make sure to play with the z-order of proxywidget so that it always shows above the other items...

  5. #65
    Join Date
    Jul 2009
    Posts
    55
    Thanks
    3

    Default Re: linking of combox with lineEdit.

    Quote Originally Posted by MrDeath View Post
    QGraphicsItem do not inherit the QWidget class so you cannot place a lineEdit inside it...
    what you can do is make another QGraphicsProxyWidget and put lineEdit inside it. read the doc of this.. then like you have inserted your node into a scene... add you proxywidgetitem to the scene as welll.. make sure to play with the z-order of proxywidget so that it always shows above the other items...
    NO WONDER!!!! -_-! so what i wan still can be done right? using the QGraphicsProxyWidget class? alright i go read about it. you are a real Guru... lol

  6. #66
    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: linking of combox with lineEdit.

    Guys, just reminding you we're dealing with a school project here. Remember about our policy on helping with school projects - only hints, no ready solutions. The guy has to learn and based on the content of this lenghty thread, he needs it. Foremost the "concept of programming" is required. The programming language is just a tool.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qt linking problem
    By LovesTha in forum Newbie
    Replies: 3
    Last Post: 31st March 2009, 00:31
  2. How to update lineEdit
    By HelloDan in forum Qt Programming
    Replies: 9
    Last Post: 17th February 2009, 08:01
  3. Copy / Paste doesn't work with LineEdit
    By ia32 in forum Qt Tools
    Replies: 2
    Last Post: 5th May 2008, 22:44
  4. Replies: 4
    Last Post: 20th February 2006, 10:11
  5. subclassing or redrawing a lineEdit
    By jayw710 in forum Qt Programming
    Replies: 2
    Last Post: 7th February 2006, 19:26

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.