示例#1
0
UI_LoadMontagewindow::UI_LoadMontagewindow(QWidget *w_parent, char *path)
{
  int i;

  mainwindow = (UI_Mainwindow *)w_parent;

  mtg_path[0] = 0;

  if(path!=NULL)
  {
    strcpy(mtg_path, path);
  }

  if(mainwindow->files_open==1)
  {
    LoadMontageDialog = NULL;
    LoadButtonClicked();
    return;
  }

  LoadMontageDialog = new QDialog;

  LoadMontageDialog->setMinimumSize(QSize(800, 180));
  LoadMontageDialog->setMaximumSize(QSize(800, 180));
  LoadMontageDialog->setWindowTitle("Load montage");
  LoadMontageDialog->setModal(true);
  LoadMontageDialog->setAttribute(Qt::WA_DeleteOnClose, true);

  label1 = new QLabel(LoadMontageDialog);
  label1->setGeometry(QRect(10, 10, 780, 25));
  label1->setText("Choose to which file you want to apply the montage:");

  filelist = new QListWidget(LoadMontageDialog);
  filelist->setGeometry(QRect(10, 35, 780, 75));
  filelist->setSelectionBehavior(QAbstractItemView::SelectRows);
  filelist->setSelectionMode(QAbstractItemView::SingleSelection);
  for(i=0; i<mainwindow->files_open; i++)
  {
    new QListWidgetItem(QString::fromLocal8Bit(mainwindow->edfheaderlist[i]->filename), filelist);
  }

  LoadButton = new QPushButton(LoadMontageDialog);
  LoadButton->setGeometry(QRect(10, 140, 100, 25));
  LoadButton->setText("Load");

  CloseButton = new QPushButton(LoadMontageDialog);
  CloseButton->setGeometry(QRect(690, 140, 100, 25));
  CloseButton->setText("Close");

  QObject::connect(CloseButton,  SIGNAL(clicked()), LoadMontageDialog, SLOT(close()));
  QObject::connect(LoadButton,   SIGNAL(clicked()), this,              SLOT(LoadButtonClicked()));

  filelist->setCurrentRow(mainwindow->files_open - 1);

  LoadMontageDialog->exec();
}
示例#2
0
GameStateViewer::GameStateViewer(QWidget *parent, int *_restTime, int *_selfTimeUsed, int *_opponentTimeUsed,STATE *_blackTurn,STATE _isBlack):
    GameViewPanel(parent),restTime(_restTime),selfTimeUsed(_selfTimeUsed),opponentTimeUsed(_opponentTimeUsed),BlackTurn(_blackTurn),isBlack(_isBlack)
{
    this->setGeometry(parent->width()*0.05,parent->height()*0.05,parent->width()*0.9,parent->height()*0.1);

    timer.setInterval(1000);
    connect(&timer,SIGNAL(timeout()),this,SLOT(update()));
    timer.start();

    QPalette palette;
    palette.setBrush(QPalette::WindowText,Qt::white);

    Title = new QLabel("Game State",this);
    Title->setPalette(palette);
    Title->setFont(QFont("Kristen ITC",16));
    Title->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

    restTimeViewer = new QLabel(this);
    restTimeViewer->setPalette(palette);
    restTimeViewer->setFont(QFont("Franklin Gothic Book",14));
    restTimeViewer->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);

    palette.setBrush(QPalette::WindowText,Qt::yellow);
    usedTimeViewer = new QLabel(this);
    usedTimeViewer->setPalette(palette);
    usedTimeViewer->setFont(QFont("Franklin Gothic Book",10));
    usedTimeViewer->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
    usedTimeViewer->setWordWrap(true);

    undoButton = new GameButton("Undo",this);
    quitButton = new GameButton("Quit",this);
    loadButton = new GameButton("Load",this);
    saveButton = new GameButton("Save",this);

    connect(undoButton,SIGNAL(Clicked()),this,SIGNAL(UndoButtonClicked()));
    connect(quitButton,SIGNAL(Clicked()),this,SIGNAL(QuitButtonClicked()));
    connect(loadButton,SIGNAL(Clicked()),this,SIGNAL(LoadButtonClicked()));
    connect(saveButton,SIGNAL(Clicked()),this,SIGNAL(SaveButtonClicked()));
}