コード例 #1
0
ファイル: QtWindow.cpp プロジェクト: Scylardor/pokedex
// Main initialization function.
// Proceeds by steps the multiple components of the window:
// - the buttons : on/off, blue "LIST" button, prev/next arrows buttons
// - and then the other "big" components (the database, the main and second screen)
// Then hide all the widgets to give a "shut down" appearance
void	QtWindow::initialize()
{
  std::stringstream	styleStream;

  this->criticalError_ = false;
  this->setWindowTitle("Light Pokedex");
  this->OnOff_ = false;
  this->currentPkmnId_ = 0;
  this->initializePokeFont();

  this->onOffButton_ = new QPushButton("START", this);
  this->onOffButton_->setGeometry(448, 446, 120, 62);
  makeButtonTransparent(this->onOffButton_);
  styleStream << "background-image: url("<< ON_BUTTON_IMG << ");" << "font: bold 12px;";
  this->onOffButton_->setStyleSheet(styleStream.str().c_str());
  connect(this->onOffButton_, SIGNAL(clicked()), this, SLOT(toggleOnOff()));

  this->listButton_ = new QPushButton("LIST", this);
  this->listButton_->setGeometry(470, 287, 35, 25);
  makeButtonTransparent(this->listButton_);
  styleStream << "font: bold italic 10px;";
  this->listButton_->setStyleSheet("font: bold italic 10px;");
  connect(this->listButton_, SIGNAL(clicked()), this, SLOT(showTheList()));

  this->prevButton_ = new QPushButton(this);
  this->prevButton_->setGeometry(468, 392, 37, 37);
  makeButtonTransparent(this->prevButton_);
  connect(this->prevButton_, SIGNAL(clicked()), this, SLOT(showPrevPokemon()));

  this->nextButton_ = new QPushButton(this);
  this->nextButton_->setGeometry(507, 390, 37, 37);
  makeButtonTransparent(this->nextButton_);
  connect(this->nextButton_, SIGNAL(clicked()), this, SLOT(showNextPokemon()));

  this->initializeDatabase();
  this->initializeMainScreen();
  this->initializeSecondScreen();

  // this->pokemonArena_ = new QWidget(this);
  // this->pokemonSearchForm_ = new QWidget(this);

  this->hideEverything();
}
コード例 #2
0
ファイル: ChatPanel.cpp プロジェクト: pljones/JamTaba
void ChatPanel::turnOff()
{
    if (on)
        toggleOnOff();
}