{
Q_OBJECT
public:
explicit CustomListWidget
(QWidget *parent
= 0);
signals:
//void currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous );
//void itemPressed ( QListWidgetItem * item );
public slots:
public:
int currentItemIndex;
protected:
};
class CustomListWidget : public QListWidget
{
Q_OBJECT
public:
explicit CustomListWidget(QWidget *parent = 0);
signals:
//void currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous );
//void itemPressed ( QListWidgetItem * item );
public slots:
void itemPressed_s ( QListWidgetItem * item );
void currentItemChanged_s ( QListWidgetItem * current, QListWidgetItem * previous );
public:
int currentItemIndex;
QListWidgetItem *currentItem;
protected:
void paintEvent(QPaintEvent *pe);
void keyPressEvent(QKeyEvent *event);
void mouseMoveEvent(QMouseEvent *event);
};
To copy to clipboard, switch view to plain text mode
I`ve tried to make connection in CustomListWidget constructor (my last post)
Also I`ve tried in MainWindow constructore like
MainWindow
::MainWindow(QWidget *parent
) :ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QObject::connect(ui->listWidget, SIGNAL(itemPressed( QListWidgetItem * item )), SLOT(itemPressed_s ( QListWidgetItem * item )));
}
To copy to clipboard, switch view to plain text mode
but nothing happened. I always rebuild my project.
p.s.
here is my slot
{
}
void CustomListWidget::itemPressed_s ( QListWidgetItem * item )
{
}
To copy to clipboard, switch view to plain text mode
Bookmarks