//--------------------------------------------------------------------------- TableDialog::TableDialog(TableModel *tableModel, QWidget *parent) : QDialog(parent) { // Setup the dialog. setupUi(this); this->tableModel = tableModel; // Setup the table view. tableView->setModel(tableModel); tableView->hideColumn(3); selectModel = tableView->selectionModel(); QHeaderView *header = tableView->header(); int len = header->length(); header->resizeSection(0, 4*len/10); header->resizeSection(1, 6*len/10); // ... connect(upButton, SIGNAL(clicked()), this, SLOT(moveUp())); connect(downButton, SIGNAL(clicked()), this, SLOT(moveDown())); connect(enableButton, SIGNAL(clicked()), this, SLOT(enable())); connect(disableButton, SIGNAL(clicked()), this, SLOT(disable())); connect(installButton, SIGNAL(clicked()), this, SLOT(chooseDir())); }
A2DPTest::A2DPTest(QWidget *parent) :QWidget(parent) { setupUi(this); device = NULL; aplay.closeReadChannel(QProcess::StandardOutput); // | QProcess::StandardError); aplay.closeWriteChannel(); audioFilesModel = new QFileSystemModel; audioFilesModel->setNameFilters(QStringList() << "*.wav"); audioFilesModel->setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); audioFilesModel->setRootPath(QDir::homePath()); treeView->setModel(audioFilesModel); // Just the filname header. QHeaderView *headers = treeView->header(); for (int i = 1; i < headers->length(); i++) headers->hideSection(i); }
int HeaderView::length(lua_State * L) // const : int { QHeaderView* obj = QtObject<QHeaderView>::check( L, 1); Util::push( L, obj->length() ); return 1; }