Skip to content

Instantly share code, notes, and snippets.

@yamato8
Last active January 1, 2016 15:19
Show Gist options
  • Save yamato8/8163300 to your computer and use it in GitHub Desktop.
Save yamato8/8163300 to your computer and use it in GitHub Desktop.
Combo Box の使い方:Qt
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_comboBox_currentIndexChanged(const QString &arg1)
{
qDebug() << "選択されたアイテム:" << arg1;
}
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_comboBox_currentIndexChanged(const QString &arg1);
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment