ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ModeSelectDialog Class Reference

#include <src/ckb/modeselectdialog.h>

+ Inheritance diagram for ModeSelectDialog:
+ Collaboration diagram for ModeSelectDialog:

Public Member Functions

 ModeSelectDialog (QWidget *parent, KbMode *currentMode, QList< KbMode * > modeList, const QString &textLabel)
 
 ~ModeSelectDialog ()
 
QList< KbMode * > selection ()
 

Private Slots

void on_selAllButton_clicked ()
 
void on_selNoneButton_clicked ()
 

Private Attributes

Ui::ModeSelectDialogui
 
QList< KbMode * > _modeList
 

Detailed Description

Definition at line 13 of file modeselectdialog.h.

Constructor & Destructor Documentation

ModeSelectDialog::ModeSelectDialog ( QWidget parent,
KbMode currentMode,
QList< KbMode * >  modeList,
const QString &  textLabel 
)

Definition at line 4 of file modeselectdialog.cpp.

References _modeList, Ui_ModeSelectDialog::label, Ui_ModeSelectDialog::modeList, KbMode::name(), Ui_ModeSelectDialog::setupUi(), and ui.

4  :
5  QDialog(parent), ui(new Ui::ModeSelectDialog),
6  _modeList(modeList)
7 {
8  ui->setupUi(this);
9  _modeList.removeAll(currentMode);
10  ui->label->setText(textLabel);
11  // Populate list
12  foreach(KbMode* mode, _modeList)
13  ui->modeList->addItem(mode->name());
14 }
Ui::ModeSelectDialog * ui
QList< KbMode * > _modeList
Definition: kbmode.h:36
const QString & name() const
Definition: kbmode.h:50
void setupUi(QDialog *ModeSelectDialog)

+ Here is the call graph for this function:

ModeSelectDialog::~ModeSelectDialog ( )

Definition at line 16 of file modeselectdialog.cpp.

References ui.

16  {
17  delete ui;
18 }
Ui::ModeSelectDialog * ui

Member Function Documentation

void ModeSelectDialog::on_selAllButton_clicked ( )
privateslot

Definition at line 30 of file modeselectdialog.cpp.

References Ui_ModeSelectDialog::modeList, and ui.

30  {
31  int count = ui->modeList->count();
32  for(int i = 0; i < count; i++)
33  ui->modeList->item(i)->setSelected(true);
34 }
Ui::ModeSelectDialog * ui
void ModeSelectDialog::on_selNoneButton_clicked ( )
privateslot

Definition at line 36 of file modeselectdialog.cpp.

References Ui_ModeSelectDialog::modeList, and ui.

36  {
37  int count = ui->modeList->count();
38  for(int i = 0; i < count; i++)
39  ui->modeList->item(i)->setSelected(false);
40 }
Ui::ModeSelectDialog * ui
QList< KbMode * > ModeSelectDialog::selection ( )

Definition at line 20 of file modeselectdialog.cpp.

References _modeList, Ui_ModeSelectDialog::modeList, and ui.

Referenced by KbBindWidget::on_copyButton_clicked(), KPerfWidget::on_copyButton_clicked(), and MPerfWidget::on_copyButton_clicked().

20  {
21  QList<KbMode*> res;
22  int count = ui->modeList->count();
23  for(int i = 0; i < count; i++){
24  if(ui->modeList->item(i)->isSelected())
25  res.append(_modeList[i]);
26  }
27  return res;
28 }
Ui::ModeSelectDialog * ui
QList< KbMode * > _modeList

+ Here is the caller graph for this function:

Field Documentation

QList<KbMode*> ModeSelectDialog::_modeList
private

Definition at line 31 of file modeselectdialog.h.

Referenced by ModeSelectDialog(), and selection().


The documentation for this class was generated from the following files: