int main(int argc, char *argv[]) { QApplication a(argc, argv); HelloDialog w; w.show(); return a.exec(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), mDialog(0), mWebView(0), mCurrentNoteIndex(0) { loadSettings(); checkExistenceTempImgDir(); setWindowTitle(tr("Zoth Reader")); setWindowIcon(QIcon(":/images/green_book_zoth.png")); createCentralWidget(); //showFullScreen(); showMaximized(); setContextMenuPolicy(Qt::NoContextMenu); mDialog = new SettingsDialog(); connect(&mEnExport, SIGNAL(exported()), SLOT(notesReloaded())); connect(&mEnExport, SIGNAL(exported()), SLOT(displayNotes())); connect(&mEnExport, SIGNAL(exported()), SLOT(refreshNavigationLabel())); connect(mDialog, SIGNAL(accepted()), SLOT(saveDialogSettings())); if(isFirstRun){ HelloDialog* helloDialog = new HelloDialog(this); QPalette palette; palette.setColor(QPalette::Window, QColor(mBgColor)); helloDialog->setPalette(palette); helloDialog->setBackgroundRole(QPalette::Window); helloDialog->activateWindow(); helloDialog->show(); connect(helloDialog, SIGNAL(tagAccepted(QString)), SLOT(setTagAndReload(QString))); }else{ reloadNotes(); } }
virtual void draw(SDL_Surface *pScreen) { m_pDialog->update(); // Clear the screen SDL_FillRect(pScreen, NULL/*&r*/, 0x000000); // Draw the dialog blitImage(pScreen, m_screenRect.x, m_screenRect.y, m_pDialog->image()); }
virtual bool onMousePos(int x, int y) { return m_pDialog->handleMousePos(x - m_screenRect.x, y - m_screenRect.y); }
virtual void onMouseUp(int nButton, int x, int y) { m_pDialog->releaseButton(nButton); }
virtual void onMouseDown(int nButton, int x, int y) { m_pDialog->pressButton(nButton, x - m_screenRect.x, y - m_screenRect.y); }
virtual void onChar(char c) { m_pDialog->handleChar(c); }