Search This Blog

Wednesday, October 24, 2012

type QWidget is not a direct base of MyWidget

Qt Code:

class MyWidget : public QMainWindow 
explicit MyWidget(QWidget *parent = 0); 

Ui::MyWidget *ui; 

MyWidget::MyWidget(QWidget *parent) 
: QWidget(parent)//ERROR 
QPushButton *quit = new QPushButton("Close Application", this); 



Error: Type "QWidget" is not direct base of 'MyWidget'.
you will need to pass the parent to the QMainWindow constructor

MyWidget::MyWidget(QWidget *parent) 

: QMainWindow(parent) // no ERROR 

you will need to pass the parent to the QMainWindow constructor:

If this even does not fix the issue then you may have forgot to include the header file in .h file

# include 

Monday, October 22, 2012

Eclipse: convert upper case text to lower case and viceversa with a simple shortcut

This is just a quick post to share these 2 little shortcuts to convert text from lower case to uppercase and viceversa in Eclipse.

Lower case: CTRL+SHIFT+Y (CMD+SHIFT+Y on Mac OS X)

Upper case: CTRL+SHIFT+X (CMD+SHIFT+X on Mac OS X)

In both the combination you can select one or more character to convert.

you can change this setting via Eclipse > Window > Preferences > General > Keys